# Raspberry Pi4 run on boot

**URL:** <https://forum.inductiveautomation.com/t/raspberry-pi4-run-on-boot/39390>\
**Category:** Ignition\
**Created:** [October 5, 2020, 8:15pm UTC](https://forum.inductiveautomation.com/t/raspberry-pi4-run-on-boot/39390 "2020-10-05T20:15:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lcs226](https://avatars.discourse-cdn.com/v4/letter/l/848f3c/32.png) [@lcs226](https://forum.inductiveautomation.com/u/lcs226)\
**Post date:** [October 5, 2020, 8:15pm UTC](https://forum.inductiveautomation.com/t/raspberry-pi4-run-on-boot/39390/1 "2020-10-05T20:15:21Z")

</div>

I am using RPi4 for clients and would like to have them automatically load the client software on boot.

I can currently boot the Pi to the desktop and run the script from there, but have not been successful in doing it automatically.

legacyclient.sh is located in a folder /home/pi/Ignition/

I have edited the following:

/etc/xdg/lxsession/LXDE-pi/autostart

Added

@xset s off  
@xset -dpms  
@xset s noblank  
/home/pi/Ignition/legacyclient.sh [http://192.168.12.200:8088](http://192.168.12.200:8088) C MIS F  
have also tried with no success  
@sh /home/pi/Ignition/legacyclient.sh [http://192.168.12.200:8088](http://192.168.12.200:8088) C MIS F

When I reboot, I come back to the desktop and no client load.

Any help please as I am fairly new to linux. My windows machine work flawlessly

Thanks

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [October 6, 2020, 9:47am UTC](https://forum.inductiveautomation.com/t/raspberry-pi4-run-on-boot/39390/2 "2020-10-06T09:47:09Z")

</div>

For my Pi3s and later, I ended up adding another script to act as a delay before running the legacyclient script. Big enough to ensure the desktop is loaded, small enough to keep my impatience at bay.

```bash
#! /bin/bash

sleep 30
/home/pi/legacyLaunch/legacyClient.sh

```

[delayLaunch.zip](https://forum.inductiveautomation.com/uploads/short-url/ne2x0zxQ6oHGQMYq0rp32KW9LEv.zip) (224 Bytes)

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [October 6, 2020, 1:38pm UTC](https://forum.inductiveautomation.com/t/raspberry-pi4-run-on-boot/39390/3 "2020-10-06T13:38:49Z")

</div>

Not sure if you did this yet but permissions are are a common issue with crontab if its not working. You should do a `chmod +x /home/pi/Ignition/legacyclient.sh` if you haven’t already. Also, which crontab are you doing it in? There’s a crontab for root and a crontab for your user. Make sure you’re using the right one. `sudo crontab -e` gives you the roots ccrontab and `crontab -e` will give you your user `pi`'s crontab.

---

<div class="post-metadata">

**Author:** ![lcs226](https://avatars.discourse-cdn.com/v4/letter/l/848f3c/32.png) [@lcs226](https://forum.inductiveautomation.com/u/lcs226)\
**Post date:** [October 6, 2020, 3:53pm UTC](https://forum.inductiveautomation.com/t/raspberry-pi4-run-on-boot/39390/4 "2020-10-06T15:53:00Z")

</div>

JordanCClark works great on Pi3 but will not work on Pi4.

Thanks for the tip.

Cannot get crontab to run either. Added following to end of it  
@reboot /home/pi/legacyLaunch/delayLaunch.sh

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [October 7, 2020, 7:25pm UTC](https://forum.inductiveautomation.com/t/raspberry-pi4-run-on-boot/39390/5 "2020-10-07T19:25:46Z")

</div>

Worth reading through this if you’re having cron issues [https://serverfault.com/questions/449651/why-is-my-crontab-not-working-and-how-can-i-troubleshoot-it](https://serverfault.com/questions/449651/why-is-my-crontab-not-working-and-how-can-i-troubleshoot-it)
