I don’t want to make them mutually dependent per say. I want to make transmission dependent of openvpn status. I don’t want to make the vpn status depend on the transmission one actually.
If you have added the line Requires=openvpn.service
to transmission-daemon.service, then that’s what you’ll get.
Is there no way to make transmission always trying to restart (except if manually stopped)… And the only condition that allows it to start is having the vpn running?
as it was done on xbian previously:
Transmission is disabled at startup, and when the vpn starts, it launches transmission at the same time. And when the vpn is down, transmission goes down too (supported by the Requires command in unit section of transmission under systemd ) but it tries to restart automatically, but only succeeds when the vpn is successfully running.
Restart=always in the systemd unit will do it.
Add this to the [Service] section of transmission-daemon.service
Restart=always
RestartSec=5
If manually stopped, it won’t restart. You’ll probably want to add this to openvpn@.service, as well.
Already dealt with by having Required=openvpn.service, the effect of which is to start openvpn, if it’s not already running.
As mentioned, if you enable (or manually start) transmission, it will cause openvpn to start (assuming it’s not already running). So it’s transmission that in effect starts openvpn, though you can still start openvpn without causing transmission to run.
I see.
It works like a charm !!!
this topic is closed. I achieved all I wanted thanks to you guys.
THANK you Dill, THANK YOU Tom & THANK YOU Sam for this awesome OSMC !!!