I would like to set up a Timer which will stop a service, execute a script and restart the service.
One of the possibilities is to use
Type=oneshot ExecStartPre=/bin/systemctl stop myservice ExecStart=/usr/local/bin/myscript.sh ExecStartPost=/bin/systemctl start myservice
Another one is to have
myscript.sh handling the whole thing, including
I find it awkward, though, to use
systemctl within a service declaration, when there may be systemd built-in mechanisms to interact with services. Is there a cleaner way to perform these operations?