Understanding init Scripts and the Final Stage of Initialization

Each /etc/init.d script, or init script, contains logic that determines what to do when receiving a start or stop value. The logic might be a simple switch statement for execution, as in this example:

case "$1" in  start)        start        ;;  stop)        stop        ;;  restart)        restart        ;;  reload)        reload         ;;  status)        rhstatus        ;;  condrestart)        [ -f /var/lock/subsys/smb ] && restart || :        ;;  *)        echo $"Usage: $0 {start|stop|restart|status|condrestart}"        exit 1esac

Although you can use the scripts to customize the way that the system runs from power-on, absent the replacement of the kernel, this script approach ...

Get Ubuntu Unleashed 2013 Edition: Covering 12.10 and 13.04, Eighth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.