-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Note: performing this in a docker container means I don't have systemctl available and i am violating container philosophy somewhat by the entry point being bash
and then installing and running influxd in the container.
NOTE: This only impacts the SystemV init.sh script. The systemd script doesn't have this issue.
I noticed an inconsistency when running the 1.x ubuntu packaging. The exact file I encountered the issue on is 1.11.8 for arm.
I'm using a ubuntu container. I run service influxdb start
which let's me know You must be root to run this script
and terminates. so I run sudo service influxdb start
but then the buildtsi
tool runs and says.
You are currently running as root. This will build your
index files with root ownership and will be inaccessible
if you run influxd as a non-root user. You should run
buildtsi as the same user you are running influxd.
Are you sure you want to continue? (y/N):
The init script passes yes
to build tsi so it then automatically creates the tsi files with root ownership which influxdb running as the influxdb user (which is the package's default) can't read those files and fails to start.
I worked around the issue by commenting out buildtsi
as that is important for version upgrades. Influxdb will automatically build tsi and series index files if they are missing. buildtsi
forces rebuild if they are already present.
Here are the sections of the init.sh script in question.
# Check for sudo or root privileges before continuing | |
if [ "$UID" != "0" ]; then | |
echo "You must be root to run this script" | |
exit 1 | |
fi |
influxdb/.circleci/packages/influxdb/fs/usr/lib/influxdb/scripts/init.sh
Lines 156 to 164 in 61f965a
if [[ ( -d "${DATA_DIR}" ) && ( -d "${WAL_DIR}" ) ]] | |
then | |
# If this daemon is configured to run as root, influx_inspect hangs | |
# waiting for confirmation before executing. Supplying "yes" allows | |
# the service to continue without interruption. | |
yes | /usr/bin/influx_inspect buildtsi -compact-series-file \ | |
-datadir "${DATA_DIR}" \ | |
-waldir "${WAL_DIR}" | |
fi |