[Solved] rc.local not running on reboot after 6.20.6 update


I’ve noticed that rc.local isn’t automatically running on boot since updating to 6.20.6 (Native PC BIOS version) yesterday.
I added exec > /var/log/rc.local.log 2>&1 to rc.local to see where it was failing, however rc.local doesn’t appear to be called at boot as there is no log file.

systemctl status rc.local.service shows that the service is inactive(dead) on reboot, despite being enabled.
manually running systemctl restart rc.local.service after the system has booted works without issue and creates the rc.local.log file as expected

I did experience both the “chmod: cannot access ‘/etc/profile.d/dietpi-*.sh’: No such file or directory” & First Boot Setup issues when updating the system & don’t know if this is related to this issue.

I was also able to replicate this issue on an RPI3 by updating the system from 6.19.7 to 6.20.6 (experiencing the chmod & first boot upgrade issues along the way), so it doesn’t appear to be restricted to the Native PC Bios version. I also checked that the rc.local.service was operating correctly under 6.19.7 before updating the system to 6.20.6.

Appreciate any advice or pointers in troubleshooting this one, as I have limited experience with resolving systemctl issues.



The “chmod: cannot access '/etc/profile.d/dietpi-*.sh” is due to an update issue with v6.20.
Please do the following to assure successful update from your stage to v6.21:

> /DietPi/dietpi/.update_stage
> /etc/profile.d/dietpi-unsupported_terminal.sh
echo 1 > /DietPi/dietpi/.install_stage
dietpi-update 1

Note that rc.local is a deprecated feature. Nowadays you should invoke custom startup scripts via systemd units.
On DietPi you can also use our implementation and place a script into: /var/lib/dietpi/postboot.d/

But you can enable a backwards compatibility service: systemctl enable rc-local
EDIT: Ah this was what you already found out :slight_smile:

Hi i have the same issue with v6.21.

What can i do?

This is no fresh image right?

You did follow the above instructions, before redoing the update?

However, if this is no fresh image (so you already did all first run setup steps a while ago), please do the following:

killall -w dietpi-software
echo 2 > /DietPi/dietpi/.install_stage

Then log back in and you should be fine.

Hi MichaIng,

thanks, it wasn’t a fresh image.
The commands worked!

Great :slight_smile:.