I was reading the manpage for systemctl reload and found this sentence about reload.

reload PATTERN...
    Asks all units listed on the command line to reload their


How does systemd do that? What API does systemd use to ask a unit to reload its configuration?

I also found reload-or-restart.

 reload-or-restart PATTERN...
     Reload one or more units if they support it. If not, restart them

How does systemd know if the unit supports reload?


1 Answer 1


Here's what the man page systemd.service says about reloading:

           Commands to execute to trigger a configuration reload in the 
           service. This argument takes multiple command lines, following
           the same scheme as described for ExecStart= above. Use of
           this setting is optional. Specifier and environment variable
           substitution is supported here following the same scheme as
           for ExecStart=.

           One additional, special environment variable is set: if known,
           $MAINPID is set to the main process of the daemon, and may
           be used for command lines like the following:

               /bin/kill -HUP $MAINPID

           Note however that reloading a daemon by sending a signal
           (as with the example line above) is usually not a good
           choice, because this is an asynchronous operation and hence
           not suitable to order reloads of multiple services against
           each other. It is strongly recommended to set ExecReload=
           to a command that not only triggers a configuration reload
           of the daemon, but also synchronously waits for it to complete.

(The only way to know that systemd.service is the correct man page to look in was to Google for ExecReload, a string I guessed after digging through Systemd's source code.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.