Useful snippets #2: rc.local support on systemd

Systemd-using Linuxes like Arch Linux does not generally support the old SysV init functions like rc.local. The support is easy to add, though.

Edit /usr/lib/systemd/system/rc-local.service:

  1. [Unit]
  2. Description=/etc/rc.local compatibility
  3.  
  4. [Service]
  5. Type=oneshot
  6. ExecStart=/etc/rc.local
  7. RemainAfterExit=yes
  8.  
  9. [Install]
  10. WantedBy=multi-user.target

Enable it:

systemctl enable rc-local.service

Original source: Raymii

This entry was posted in Linux and tagged , . Bookmark the permalink.