I want to reload (not restart!) a group of services upon an event.
For example, if I update my SSL certificates, I want every service that uses them reloaded (nginx
and postfix
come to mind). Neither I want to remember which services on a given server use SSL certificates. It should be enough to have them grouped when they were configured.
On the other hand, I'd like to avoid changing .service
files provided with the packages, because this will require manual intervention during updates.
How do I accomplish that?
There is an option to stop a group of services on request, but this would make them inaccessible for a second or two, or worse - they may stay down until fixed. I can't afford that.
/opt/letsencrypt/letsencrypt-auto renew --pre-hook "service nginx stop; service postfix stop; service squid stop" --post-hook "service nginx start; service postfix start; service squid start"
also: certmonger has postsave and presave commands.service
file edits as overrides you can avoid the updating problem.sudo systemctl edit foo.service
will store your changes in/etc/systemd/system/foo.service.d/override.conf
rather than alter the installedfoo.service
file.