Re: rc-local.service and its future in systemd?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Am 24.04.2023 um 10:57 schrieb Aki Ketolainen <akik@xxxxxxxxxxx>:
> 
> Hi,
> I noticed in Rocky Linux 8.7 LXC container image that they've added a message to /etc/rc.d/rc.local:
> # In contrast to previous versions due to parallel execution during boot
> # this script will NOT be run after all other services.
> I created an issue report on this at github: https://github.com/systemd/systemd/issues/27340
> "How to run /etc/rc.d/rc.local as the last Linux bootup task?"
> Would it be possible to change the rc-local.service configuration as follows, so that it could be used similarly as before
> i.e. running close to the end of the "runlevel" or systemd target:
> [Unit]
> After=crond.service
> [Install]
> WantedBy=default.target
> chmod 700 /etc/rc.d/rc.local
> systemctl enable rc-local.service
> I tested this and see in ps output (ps auxwwf | sort -n -k 2,2 >> /var/tmp/boot.ps) that it starts after crond
> in both multi-user.target and graphical.target.
> Best regards,
> Aki

Hi Aki,

as Lennard already told you in the GitHub issue that "last" just doesn't make sense in systemd, there is also no need to change the dependencies global for everyone. Especially as there are systems out there which doesn't have crond installed (because there are .timer).

Your best bet is really to change all your custom scripts from rc.local into proper .service and instead of crond check out systemd.timer.

BR
Silvio



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux