Skip to content

Instantly share code, notes, and snippets.

@biiont
Last active October 1, 2015 08:27
Show Gist options
  • Save biiont/e66b5b70a457c19b3434 to your computer and use it in GitHub Desktop.
Save biiont/e66b5b70a457c19b3434 to your computer and use it in GitHub Desktop.
List, enable and disable rc.d scripts
# Here prefx "S" means start, and "K" means stop/kill.
# Two digits after mean order of start and kill operations.
# I have not found any standard defining this order,
# but orders above 90 usually are user scripts.
# List installed runlevels
ls /etc/rc.d/rc?.d/*someservice
# Remove from any runlevels
rm /etc/rc.d/rc?.d/*someservice
# Install to start and kill at default runlevels
for i in 2 3 4 5; do ln -s ../init.d/someservice /etc/rc.d/rc$i.d/S99someservice; done
for i in 0 1 6; do ln -s ../init.d/someservice /etc/rc.d/rc$i.d/K99someservice; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment