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

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
DankerLlama
Posts: 1
Joined: Fri Feb 01, 2019 11:52 am

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

Post by DankerLlama »

Hi,

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.

Cheers

Llama.
User avatar
MichaIng
Site Admin
Posts: 2295
Joined: Sat Nov 18, 2017 6:21 pm

Re: rc.local not running on reboot after 6.20.6 update

Post by MichaIng »

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:

Code: Select all

> /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 :)
SPI0
Posts: 9
Joined: Sun Jul 29, 2018 10:24 pm

Re: rc.local not running on reboot after 6.20.6 update

Post by SPI0 »

Hi i have the same issue with v6.21.

What can i do?

Image
Image
User avatar
MichaIng
Site Admin
Posts: 2295
Joined: Sat Nov 18, 2017 6:21 pm

Re: rc.local not running on reboot after 6.20.6 update

Post by MichaIng »

@SPI0
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:

Code: Select all

killall -w dietpi-software
echo 2 > /DietPi/dietpi/.install_stage
logout
Then log back in and you should be fine.
SPI0
Posts: 9
Joined: Sun Jul 29, 2018 10:24 pm

Re: rc.local not running on reboot after 6.20.6 update

Post by SPI0 »

Hi MichaIng,

thanks, it wasn't a fresh image.
The commands worked!
User avatar
MichaIng
Site Admin
Posts: 2295
Joined: Sat Nov 18, 2017 6:21 pm

Re: rc.local not running on reboot after 6.20.6 update

Post by MichaIng »

Great :).
Post Reply