Skip to content

NetBird systemd service fails after package update due to missing log directory #3866

Open
@kimasplund

Description

@kimasplund

NetBird systemd service fails after package update due to missing log directory

Description

After updating NetBird through the package manager, the systemd service fails to start with exit code 209/STDOUT. The root cause is that the uninstaller removes the /var/log/netbird/ directory during package updates, but the installer/updater does not recreate it.

Environment

  • OS: Ubuntu 25.04 (Linux 6.14.6-061406-generic)
  • NetBird version: 0.44.0
  • Installation method: Package manager (systemd service)

Steps to Reproduce

  1. Have NetBird installed and running
  2. Update NetBird package (e.g., via apt upgrade)
  3. Check service status: sudo systemctl status netbird
  4. Service fails with exit code 209/STDOUT

Expected Behavior

The NetBird service should start successfully after package updates without manual intervention.

Actual Behavior

The service fails to start because the log directory /var/log/netbird/ is missing.

Error Logs

May 23 09:16:50 Kim-UB25-TP systemd[1]: Started netbird.service - A WireGuard-based mesh network that connects your devices into a single private network..
May 23 09:16:50 Kim-UB25-TP (netbird)[28159]: netbird.service: Failed to set up standard output: No such file or directory
May 23 09:16:50 Kim-UB25-TP (netbird)[28159]: netbird.service: Failed at step STDOUT spawning /usr/bin/netbird: No such file or directory
May 23 09:16:50 Kim-UB25-TP systemd[1]: netbird.service: Main process exited, code=exited, status=209/STDOUT
May 23 09:16:50 Kim-UB25-TP systemd[1]: netbird.service: Failed with result 'exit-code'.

Workaround

Manually create the log directory after updates:

sudo mkdir -p /var/log/netbird
sudo chown root:root /var/log/netbird
sudo chmod 755 /var/log/netbird
sudo systemctl restart netbird

Proposed Solution

The package post-install script should ensure the log directory exists:

  1. Check if /var/log/netbird/ exists
  2. If not, create it with appropriate permissions
  3. This should be done in both the installer and updater scripts

Additional Context

The systemd service configuration expects to write logs to /var/log/netbird/client.log as specified in the ExecStart command:

ExecStart=/usr/bin/netbird service run --config /etc/netbird/config.json --log-level info --daemon-addr unix:///var/run/netbird.sock --log-file /var/log/netbird/client.log

This appears to be a packaging issue where the uninstall process (during updates) removes the log directory but the install process doesn't recreate it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions