You are not logged in.
Hi,
consider the following examplified systemd service
[Unit]
Description=splone file system
[Service]
RemainAfterExit=yes
ExecStart=/usr/bin/echo starting service
ExecStop=/usr/bin/echo stopping stopping service
Conflicts=sleep.target shutdown.target
Starting and stopping it via
# systemctl {start|stop} myservice.service
works fine. However, I want the service to be stopped on sleep in order to execute the ExecStop= command. I thought, I can achive this with the Conflicts= parameter.
What I can do, is having a seperate service which calls the ExecStop= command in its ExecStart= parameter which runs before the sleep.target. But I really would like a solution with only one file. Does anyone have an idea?
Last edited by mkind (2015-07-08 19:56:27)
Offline
Conflicts does not belong in [Service].
Offline
Boah, big thanks. I have no idea, why I missed that!
Offline