Posts

Showing posts with the label terminal

[init.d] adding launch time script to linux

Making scripts run at boot time with Debian Posted by Steve on Mon 11 Oct 2004 at 13:01 Tags: boot , debian-specific commands , initscripts , scheduling Debian uses a Sys-V like init system for executing commands when the system runlevel changes - for example at bootup and shutdown time. If you wish to add a new service to start when the machine boots you should add the necessary script to the directory /etc/init.d/ . Many of the scripts already present in that directory will give you an example of the kind of things that you can do. Here's a very simple script which is divided into two parts, code which always runs, and code which runs when called with "start" or "stop". #! /bin/sh # /etc/init.d/blah # # Some things that run always touch /var/lock/blah # Carry out specific functions when asked to by the system case "$1" in start) echo "Starting script blah " echo "Could do more here" ;; stop) echo "Stopp...