Page MenuHomeVyOS Platform

isc-dhcp-server(6).service reports startup success immediately even if dhcpd fails to start up
Closed, ResolvedPublic

Description

The default of systemd services Type=simple isn't suitable for dhcpd and other daemons:

•   If set to simple (the default if ExecStart= is specified but neither Type= nor BusName= are), the service manager will consider the unit started immediately after the main service process
    has been forked off. It is expected that the process configured with ExecStart= is the main process of the service. In this mode, if the process offers functionality to other processes on
    the system, its communication channels should be installed before the service is started up (e.g. sockets set up by systemd, via socket activation), as the service manager will immediately
    proceed starting follow-up units, right after creating the main service process, and before executing the service's binary. Note that this means systemctl start command lines for simple
    services will report success even if the service's binary cannot be invoked successfully (for example because the selected User= doesn't exist, or the service binary is missing).

This was introduced in T2185 where an inappropriate service type was chosen.

Type=forking is correct, also PIDFile needs to be specified and the shell pre-start script moved to ExecStartPre.

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)