snix custom systemd rc.local compatibility
Find a file
2026-05-05 20:58:14 +02:00
etc update 2026-05-05 20:58:14 +02:00
usr/lib/systemd/system update 2026-05-05 07:42:13 +02:00
install update 2026-05-05 09:48:19 +02:00
README.md update 2026-05-05 08:34:46 +02:00

snix-systemd-rc-local

/etc/rc.local compatibility for systemd systems.

Structure

etc/
  rc.local              # main script executed at boot
  rc.local.d/
    pre                 # commands to run before systemd services
    systemd             # list of systemd services to start (one per line)
    post                # commands to run after systemd services
usr/
  lib/systemd/system/
    rc-local.service    # systemd unit

Installation

curl -fsSL https://git.snix.me/linux/snix-systemd-rc-local/raw/branch/main/install | sudo sh

Configuration

Start systemd services at boot

Add service names to /etc/rc.local.d/systemd, one per line:

# /etc/rc.local systemd services
nginx
postgresql

Run custom commands

  • Commands to run before services: /etc/rc.local.d/pre
  • Commands to run after services: /etc/rc.local.d/post

Enable the service

systemctl enable rc-local
systemctl start rc-local