Page MenuHomeVyOS Platform

Start daemons with systemd units instead of with start-stop-daemon
Closed, ResolvedPublic

Description

Since we moved to Debian Buster, the primary init system became systemd. A lot of vyos scripts still use start-stop-daemon, which is a leftover from sysvinit. We should migrate all uses of it to systemd services, as this allows systemd to monitor the daemons and restart them in case they crash, which is IMO very important on a router (services shouldn't crash, but if they do for any reason, ie memory shortage or due to a attack, they should be restarted immediately). Some (if not all) of the daemons that are used already ship with service files from Debian with suitable defaults (or with minor tweaking necessary) that should be used. If any tweaks are needed, the first choice should be to use overrides, only shipping complete modified service files if absolutely necessary (as was the case with isc-dhcp-server, where a change was made in Debian to start both v4 and v6 daemons from the same config file, which wasn't suitable for our use).
All conf mode and op mode scripts should be migrated.

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Behavior change
Issue type
Internal change (not visible to end users)

Event Timeline

jjakob triaged this task as Normal priority.Mar 31 2020, 4:37 AM
jjakob created this task.
jjakob created this object in space S1 VyOS Public.

+1 on that, already migrated l2tp and sstp VPN to systemd today

c-po changed the task status from Open to In progress.Apr 12 2020, 11:28 AM
c-po claimed this task.

Todo (migrate to systemd or migrate generated configs to /run, to not leave behind corpses after a system reboot)

  • salt-stack -> postponed as it seems to have additional errors
  • intel-qat -> seems to be rather hard and only a one time thing on bootup

I've fixed the service files for isc-dhcp (in T2438), other service files still ned to be moved to Type=forking or a suitable type (notify/dbus...) to fix their behavior, unless they already are.

erkin set Issue type to Internal change (not visible to end users).Aug 30 2021, 7:51 AM
erkin removed a subscriber: Active contributors.