Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing RuntimeDirectory in Systemd service file (Ubuntu 24.04 Server) #25600

Open
melroy89 opened this issue Nov 28, 2024 · 0 comments
Open

Comments

@melroy89
Copy link

melroy89 commented Nov 28, 2024

Steps to reproduce:

  1. Running InfluxDB v1.11.8
  2. Edit the influxdb.conf and enable unix socket:
    unix-socket-enabled = true
    bind-socket = "/var/run/influxdb/influxdb.sock"
    
  3. Using the default /usr/lib/systemd/system/influxdb.service file, provided by you.
  4. Failing to start InfluxDB!

Expected behavior:

Influxdb starting without errors and write the socket file.

Actual behavior:

Ubuntu Server 24.04 prohibits the writing of the socket file (/var/run/influxdb/influxdb.sock) to disk, because you didn't allow the systemd service file write access to the /var/run/influxdb directory..... See fix below!

InfluxDB unable to start in Ubuntu 24.04, because the service file is unable to write the socket file to /var/run/influxdb directory.

Fix:

The fix is easy, please extend your official influxdb.service in your Ubuntu packages with the following:

[Service]
....
RuntimeDirectory=influxdb
RuntimeDirectoryMode=0755

Config:
Copy any non-default config values here or attach the full config as a gist or file.

unix-socket-enabled = true
bind-socket = "/var/run/influxdb/influxdb.sock"

Logs:

Nov 28 17:59:21 ubuntu-server influxd-systemd-start.sh[41891]: InfluxDB API unavailable after 1 attempts...
Nov 28 17:59:22 ubuntu-server influxd-systemd-start.sh[41891]: InfluxDB API unavailable after 2 attempts...
Nov 28 17:59:23 ubuntu-server influxd-systemd-start.sh[41891]: InfluxDB API unavailable after 3 attempts...
Nov 28 17:59:24 ubuntu-server influxd-systemd-start.sh[41891]: InfluxDB API unavailable after 4 attempts...
Nov 28 17:59:25 ubuntu-server influxd-systemd-start.sh[41891]: InfluxDB API unavailable after 5 attempts...
Nov 28 17:59:25 ubuntu-server influxd-systemd-start.sh[41891]: InfluxDB API unavailable after 6 attempts...
Nov 28 17:59:25 ubuntu-server influxd-systemd-start.sh[41891]: InfluxDB API unavailable after 7 attempts...
Nov 28 17:59:25 ubuntu-server influxd-systemd-start.sh[41891]: InfluxDB API unavailable after 8 attempts...
Nov 28 17:59:25 ubuntu-server influxd-systemd-start.sh[41891]: InfluxDB API unavailable after 9 attempts...
Nov 28 17:59:25 ubuntu-server influxd-systemd-start.sh[41891]: InfluxDB API unavailable after 10 attempts...
Nov 28 17:59:25 ubuntu-server influxd-systemd-start.sh[41891]: InfluxDB API unavailable after 11 attempts...
Nov 28 17:59:25 ubuntu-server influxd-systemd-start.sh[41891]: InfluxDB API unavailable after 12 attempts...
Nov 28 17:59:25 ubuntu-server influxd-systemd-start.sh[41891]: InfluxDB API unavailable after 13 attempts..

.. Well.. it won't never start..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant