Adding a delay?

Hi,

Hope everyone is safe, and happy late new year! :sunglasses:

I’m trying to add a delay/sleep to transmission. However, I’m having issues finding out how. I have Google it and found:
https://dietpi.com/forum/t/add-a-program-to-autostart/3703/1
https://dietpi.com/forum/t/custom-autostart-script-not-working/1960/1
https://dietpi.com/forum/t/how-where-to-delay-squeezebox-service-start/1075/1
etc…

My issue is /etc/systemd/system/dietpi-autostart_custom.service doesn’t exist and it seems dietpi has dietpi-autostart. I have no idea how it works.

Thanks!
z

Hi,

what exactly is the goal to delay transmission?

Hi Joulinar,

Transmission will start before my VPN connects which exposes my real IP, I do have my VPN setup with a killswitch it’s just transmission starts up than my VPN.

I was hoping to add a delay to transmission to allow my VPN to connect first, even if my VPN fails to connect (for some unknown reason) the killswitch would kick in till there is a connection, again transmission starts just before the VPN starts up.

Thanks!

well you could try to add your VPN service as dependency to Transmission service. What VPN you are using?

How would I go about doing this? I’m using Transmission web and I don’t have that many options. I’m using PIA (privateinternetaccess)

Thanks

do you know the name of the service pia is using?

I’m not sure; I installed my PIA differently from other guides I found here, i.e. OpenVPN with PIA? and the git guide ended up with me formatting dietpi and doing a fresh install.

I installed TigerVNC from there I installed the desktop version of PIA

This method has worked a treat, and I can use the VPN killswitch and split tunnel. However, Transmission loads before PIA (which I’m guessing Transmission loads before TigerVNC), and as a result, my real IP shows till PIA kicks in.

I thought it would be easier to add a delay to Transmission to sleep x seconds giving TigerVNC/PIA time to start.

It is not the best method to install the VPN, but it works and is the most simple.

Thanks again

basically you could add a sleep command to Transmission service definition.

TimeoutStartSec=infinity
ExecStartPre=/bin/sleep 1800