If you have /etc/rc.local
as an executable file, it will be pulled in to the boot process by systemd-rc-local-generator
/ rc-local.service
.
At least /etc/rc.local
is the default path it uses, but this is set by the distribution. Because it's mainly for backwards compatibility, and different distributions were using different paths. E.g. on Fedora, the path is /etc/rc.d/rc.local
. You can check the path as follows:
$ systemctl cat rc-local.service
# /usr/lib/systemd/system/rc-local.service
# ...
# This unit gets pulled automatically into multi-user.target by
# systemd-rc-local-generator if /etc/rc.d/rc.local is executable.
[Unit]
Description=/etc/rc.d/rc.local Compatibility
ConditionFileIsExecutable=/etc/rc.d/rc.local
After=network.target
[Service]
Type=forking
ExecStart=/etc/rc.d/rc.local start
TimeoutSec=0
RemainAfterExit=yes
GuessMainPID=no
It seems this is not very well known. There's several posts which show a previous version of the file, which has no such comment.