User:Herodotus/Rc-Local-Systemd

From ArchWiki

Saved content from Systemd, having been deleted by Lahwaacz:

Systemd does not by default execute /etc/rc.local, which was used to store miscellaneous commands to be run at startup in pre-Systemd systems. Although some argue that it is cleaner to create a separate named unit file for each command that needs to be executed at startup, reproducing rc.local functionality is a common request and a good example of creating a unit file. Here is an example:

/etc/systemd/system/rc-local.service
[Unit]
Description=/etc/rc.local compatibility

[Service]
Type=oneshot
ExecStart=/etc/rc.local
# disable timeout logic
TimeoutSec=0
#StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99

[Install]
WantedBy=multi-user.target

After creating this file, enable the service at bootup with

# systemctl enable rc-local.service

Uncomment the commented line if your service needs to use the terminal. See [1], [2].