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