[systemd-devel] Automatically stop a service when a dependent service exits

Jakob Schöttl jschoett at gmail.com
Thu Feb 15 09:06:07 UTC 2018


Hi,

can I ask a configuration question here?

I have an upload.service, started by an upload.timer. The upload.service
has a Require=ssh-tunnel.service (After= is also set). When the
upload.service is finished how can I make systemd to also stop the
ssh-tunnel.service?

Currently I use systemctl stop ssh-tunnel.service in the upload script.
But since the upload.service has User=<non-root>, I also have to
configure sudo to allow my script to stop the service.

Is there already a systemd solution for this problem?

- Jakob



More information about the systemd-devel mailing list