systemd does not run /etc/rc.local?

With systemd 188-2, systemd complains about having no [Install] section and as such being unable to enable the rc.local service. Might have been the case with earlier versions but since Arch devs only recently announced systemd will become the default I am fixing up my system.

To fix that, just add a section for the multiuser target in /etc/systemd/system/rc-local.service:

[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local

[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99

[Install]
WantedBy=multi-user.target

Create the /etc/rc.local script and make it executable with chmod +x /etc/rc.local


Arch might not have included the service unit file necessary to run rc.local.

Just create a file /etc/systemd/system/rc-local.service with the following contents (copied verbatim from my Fedora systemd system):

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.

[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local

[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99

Then, just run systemctl enable rc-local.service as root to enable it. You can also test it/run it now by running systemctl start rc-local.service.


Pkgfile (on my system) says:

$ pkgfile --search rc-local.service
community/initscripts-systemd

That package installs other stuff you may not want, but you can disable it. See also: https://wiki.archlinux.org/index.php/Systemd#The_initscripts-systemd_package

Tags:

Arch Linux