# Autorun PAcket Forwarder when booting Raspi

**URL:** <https://www.thethingsnetwork.org/forum/t/autorun-packet-forwarder-when-booting-raspi/55222>\
**Category:** Raspberry Pi Gateways\
**Tags:** gateways\
**Created:** [February 15, 2022, 4:13pm UTC](https://www.thethingsnetwork.org/forum/t/autorun-packet-forwarder-when-booting-raspi/55222 "2022-02-15T16:13:49Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![cslorabox](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/cslorabox/32/35697_2.png) [@cslorabox](https://www.thethingsnetwork.org/forum/u/cslorabox)\
**Post date:** [February 15, 2022, 4:38pm UTC](https://www.thethingsnetwork.org/forum/t/autorun-packet-forwarder-when-booting-raspi/55222/2 "2022-02-15T16:38:17Z")

</div>

That would depend on your pi’s Linux install.

Most recent debian/raspbian type ones would probably need a systemd service.

Here’s an example of the service - notice it’s running a script that toggles the reset, not directly starting the packet forwarder

as root create /lib/systemd/system/ttn-gateway.service

> [Unit]  
> Description=The Things Network Gateway
> 
> [Service]  
> WorkingDirectory=/opt/ttn-gateway/packet\_forwarder/lora\_pkt\_fwd/  
> ExecStart=/opt/ttn-gateway/packet\_forwarder/lora\_pkt\_fwd/start.sh  
> SyslogIdentifier=ttn-gateway  
> Restart=always  
> RestartSec=5
> 
> [Install]  
> WantedBy=multi-user.target

And then you need to activate it

```auto
sudo systemctl enable ttn-gateway.service
sudo systemctl restart ttn-gateway.service

```

---

_[View the full topic](https://www.thethingsnetwork.org/forum/t/autorun-packet-forwarder-when-booting-raspi/55222)._
