SJrX / systemdUnitFilePlugin

GNU General Public License v2.0
28 stars 7 forks source link

[Service] Type=notify-reload is not supported #263

Closed LtdJorge closed 5 months ago

LtdJorge commented 5 months ago

The values supported for Type in the Service section are [simple, forking, oneshot, dbus, notify, idle, exec], which lacks the notify-reload variant.

For reference, this is the description of that variant:

Behavior of notify-reload is similar to notify, with one difference: the SIGHUP UNIX process signal is sent to the service's main process when the service is asked to reload and the manager will wait for a notification about the reload being finished.

When initiating the reload process the service is expected to reply with a notification message via sd_notify(3) that contains the "RELOADING=1" field in combination with "MONOTONIC_USEC=" set to the current monotonic time (i.e. CLOCK_MONOTONIC in clock_gettime(2)) in μs, formatted as decimal string. Once reloading is complete another notification message must be sent, containing "READY=1". Using this service type and implementing this reload protocol is an efficient alternative to providing an ExecReload= command for reloading of the service's configuration.

The signal to send can be tweaked via ReloadSignal=, see below.