custom systemd rc.local compatibility
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
sam 8fd8e5fbcb install: follow the repo rename and move to the systemd org
mainpkg still held the pre-rename name, so while curl followed Forgejo's
redirect and downloaded the tarball, it extracts into rc-local/ while
the script looked under /tmp/snix-systemd-rc-local: nothing was copied
and systemctl enable then failed on a unit that was never installed.

repobasedir follows the transfer from linux/ to systemd/, and the README
title and install line use the current name.
2026-09-02 14:45:59 +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 install: follow the repo rename and move to the systemd org 2026-09-02 14:45:59 +02:00
README.md install: follow the repo rename and move to the systemd org 2026-09-02 14:45:59 +02:00

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/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