To make an init script compatible with chkconfig (to autostart on next runlevel change), add the following header to your script within it's /etc/init.d/ file, for example, /etc/init.d/myscript
#!/bin/bash
#
# myscript init script to manage myserver
#
# chkconfig: 2345 90 35
# description: A server which does amazing things.
#
Now, add it with these commands:
/bin/chmod +x /etc/init.d/myscript
/sbin/chkconfig myscript --add
/sbin/chkconfig myscript on
/sbin/chkconfig myscript --list
myserver 0:off 1:off 2:on 3:on 4:on 5:on 6:off
Within the chkconfig definition line, 2345 means the runlevels it will be started under, and 90 35 are the start and kill priorities, an integer between 0 and 99. In this example, it would be started as one of the last services, and killed (stopped) as one of the earlier processes.
This is a repository of all of my Linux/Unix writings as well as useful tips and tricks for systems administration, engineering, and programming.
Showing posts with label chmod. Show all posts
Showing posts with label chmod. Show all posts
Wednesday, December 14, 2011
Tuesday, August 25, 2009
chmod calculator
The best that I have found for quickly calculating numerical permissions:
http://www.javascriptkit.com/script/script2/chmodcal.shtml
http://www.javascriptkit.com/script/script2/chmodcal.shtml
Subscribe to:
Posts (Atom)