custom systemd rc.local compatibility
- Shell 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
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. |
||
| etc | ||
| usr/lib/systemd/system | ||
| install | ||
| README.md | ||
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