influxdata / influxdata/influxdb
Missing RuntimeDirectory in Systemd service file (Ubuntu 24.04 Server)
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
__Steps to reproduce:__
1. Running InfluxDB v1.11.8
2. Edit the `influxdb.conf` and enable unix socket:
```conf
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:
```ini
[Service]
....
RuntimeDirectory=influxdb
RuntimeDirectoryMode=0755
```
__Config:__
Copy any non-default config values here or attach the full config as a gist or file.
```conf
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..
```
Contributor guide
Research direction
Inspect /usr/lib/systemd/system/influxdb.service alongside the unix-socket and bind-socket settings shown in the issue. Verify the service creates or permits /var/run/influxdb on Ubuntu 24.04, then confirm InfluxDB starts and writes influxdb.sock successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, ubuntu
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100