Lesson 7

Dates: 3/5/2014
Start-up and Run Levels. Scheduled jobs (at, cron)
Linux for Engineering and IT Applications


Adding/removing scripts from startup (Legacy)

The scripts in /etc/rcN.d are links to the scripts in directory /etc/init.d, for example
K10unattended-upgrades -> ../init.d/K10unattended-upgrades
S35networking -> ../init.d/networking


To add/remove startup scripts at a particular run level, create/remove the symbolic links, for example,

ln -s /etc/init.d/networking  /etc/rc6.d/S35networking
rm /etc/rc6.d/S35networking


Alternatively, you can use command update-rc.d to add/remove the links, for example:

/usr/sbin/update-rc.d  portmap defaults
/usr/sbin/update-rc.d -f portmap remove

Using update-rc.d for a service

update-rc.d service defaults  #Enable service at boot time
update-rc.d service stop 0 1 2 3 4 5 6  #Stops service at boot time (sets K).
update-rc.d -f service remove   #Removes service from the startup
update-rc.d service start 20 2 3 4 5 . stop 80 0 1 6 .   #Sets  S20 at rl=2 3 4 5,  K80 at rl 0 1 6 

Adding/removing in the startup can also be accomplished by the menu-based command, sysv-rc-conf


Take me to the Course Website