rc-local.service - Start without any configuration

Hello.

Cannot prevent rc-local.service to start

systemctl stop rc-local.service
systemctl disable rc-local.service

After reboot, rc-local.service start again.

After removing file /usr/lib/systemd/system/rc-local.service

systemctl status rc-local.service
Unit rc-local.service could not be found. 

The file /etc/init.d/boot.local is still called.

/etc/init.d/boot.local


PARENT_COMMAND=$(ps -o args= $PPID)
logger "CALLER : $PARENT_COMMAND"

journalctl -a -b --no-pager --no-tail -f show :

août 17 16:49:44 localhost JCD_BACKUP_SYS_ETC_INIT-D_BOOT.LOCAL[414]: hB  - /etc/init.d/boot.local - CALLER : /usr/lib/systemd/systemd --switched-root --system --deserialize 24  - CUR_USER : root - CUR_ID : 0

Any help is welcome

Hi
You need to stop, disable and then mask the service :wink:


systemctl mask rc-local.service

Remove /etc/init.d/boot.local

systemctl disable rc-local.service

It does nothing - there is nothing to disable.

After removing file /usr/lib/systemd/system/rc-local.service

systemctl status rc-local.service
Unit rc-local.service could not be found. 

The file /etc/init.d/boot.local is still called.

/etc/init.d/boot.local

PARENT_COMMAND=$(ps -o args= $PPID)
logger “CALLER : $PARENT_COMMAND”

If you want to see which service unit calls this file, print cgroups to which this process belongs.

This is what /usr/lib/systemd/system/rc-local.service says:

# This unit gets pulled automatically into multi-user.target by
# systemd-rc-local-generator if /etc/init.d/boot.local is executable.

So remove the execute permission bits.

Or maybe even remove the whole of /etc/init.d/boot.local . I do not have such a file.

And of course, masking is also not bad.

Great.
Many thanks to everybody for helping.