Using Systemd for maintanance

Hello! I am using the systemd to start and stop seafile this goes like this:

sudo systemctl stop seafile.service seahub.service
sudo systemctl start seafile.service seahub.service

So far so good, this is really amazing and works very well. Now I created a third systemd service to do some maintenance such as garbage collection and reporting. It is important, that seafile is stopped before executing the maintenance service and that it is started after the maintenance service. Its service file goes like this:

Description=Seafile Maintenance
Conflicts=seahub.service seafile.service



I used the Conflicts= filed, which should stop seafile and seahub before starting the maintenance. But this does not work. Even sudo journalctl -f does not show any error!? Does anybody know my mistake?

The conflicts should then shut down Seafile. I did not have the time to look up how to start it again after the job finishes.

Oh, you are right. Seafile and Seahub is stopped by the conflicts field, but is not started again when the maintenacne service is finished.

With the OnFailure filed the Seafile and Seahub can be started, if the executing service fails. But I find no option to start them when everything works fine within the maintenace service has finished.

Just have the maintenance script start the services at the end?