# Adding a delay?

**URL:** https://dietpi.com/forum/t/adding-a-delay/4889
**Category:** General Discussion
**Created:** [22 January 2021 06:03 UTC](https://dietpi.com/forum/t/adding-a-delay/4889 "2021-01-22T06:03:34Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Zuse](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/z/a9adbd/32.png) [@Zuse](https://dietpi.com/forum/u/Zuse)
#### Post date: [22 January 2021 06:03 UTC](https://dietpi.com/forum/t/adding-a-delay/4889/1 "2021-01-22T06:03:34Z")

</div>

Hi,

Hope everyone is safe, and happy late new year! 🕶

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/add-a-program-to-autostart/3703/1)  
[https://dietpi.com/forum/t/custom-autostart-script-not-working/1960/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](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

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [22 January 2021 09:13 UTC](https://dietpi.com/forum/t/adding-a-delay/4889/2 "2021-01-22T09:13:21Z")

</div>

Hi,

what exactly is the goal to delay transmission?

---

<div class="post-metadata">

### Author: ![Zuse](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/z/a9adbd/32.png) [@Zuse](https://dietpi.com/forum/u/Zuse)
#### Post date: [22 January 2021 17:34 UTC](https://dietpi.com/forum/t/adding-a-delay/4889/3 "2021-01-22T17:34:00Z")

</div>

> [@](#):
>
> 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!

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [22 January 2021 18:26 UTC](https://dietpi.com/forum/t/adding-a-delay/4889/4 "2021-01-22T18:26:30Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Zuse](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/z/a9adbd/32.png) [@Zuse](https://dietpi.com/forum/u/Zuse)
#### Post date: [22 January 2021 18:43 UTC](https://dietpi.com/forum/t/adding-a-delay/4889/5 "2021-01-22T18:43:15Z")

</div>

> [@](#):
>
> 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

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [22 January 2021 18:52 UTC](https://dietpi.com/forum/t/adding-a-delay/4889/6 "2021-01-22T18:52:20Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Zuse](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/z/a9adbd/32.png) [@Zuse](https://dietpi.com/forum/u/Zuse)
#### Post date: [22 January 2021 19:26 UTC](https://dietpi.com/forum/t/adding-a-delay/4889/7 "2021-01-22T19:26:10Z")

</div>

> [@](#):
>
> 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?](https://dietpi.com/forum/t/openvpn-with-pia/997/1) 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

 ![](https://dietpi.com/forum/uploads/default/original/2X/f/feb22eeda222c5d0448d0bd92fad205947f89024.png)

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

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [22 January 2021 20:10 UTC](https://dietpi.com/forum/t/adding-a-delay/4889/8 "2021-01-22T20:10:55Z")

</div>

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

```nohighlight
TimeoutStartSec=infinity
ExecStartPre=/bin/sleep 1800

```
