problem with AutoStart after update

After update from 6.19.x to 6.20.5 and later to 6.20.6, a script that I added to refuses to start. I am not sure after which update it happened. runs the commands before my script, but stops when reach it.


# - Chromium
#xinit chromium

# - LXDE

# - Print hello
#echo -e "Hello"

#---Put your code below this line---

#sudo mount /dev/sda1 /media/usb_hdd

sudo echo ' start' >> /home/dietpi/startup.txt

sudo /home/dietpi/

sudo echo ' end' >> /home/dietpi/startup.txt

startup.txt start

After I remove my script from

startup.txt start end

If manually run my script it works.
Also my script is running in infinite loop, may that be the problem?

Thanks! :slight_smile:

*Sorry if my English is bad!

What you mean by infinite loop?

You should see related output on the terminal at end of boot stage. Also check: systemctl status dietpi-autostart_custom

And finally if you could paste the output of your script, we could run some local tests. In some cases systemd units/services behave different than running a script/command directly from shell.

Unfortunately my sd card died (this is my 3dr dead card) and I can’t get any data out of it, nigher I have a backup. It would take a while until I get a new one and reproduce the same setup.
If you still want to run your tests, my script was something like that:


gpio mode 0 out

while(sleep 10)

temperature=$(< /sys/devices/virtual/thermal/thermal_zone1/temp)

if [ $temperature -gt 45 ]
    echo $lineToLog $(date) >> logfan.txt                                   
    gpio write 0 1                                                 
#    lineToLog+="OFF-"
#    lineToLog+="$temperature"
#    echo $lineToLog $(date) >> logfan.txt
    gpio write 0 0                                                                                                              

I am not sure if this would work, cuz I can’t test it right now. :smiley:

Also I forget to mention that I was using Orange Pi Zero.