Adding/removing scripts from startup

The scripts in /etc/rcN.d are links to the scripts in directory /etc/init.d, for example
K20ssh -> ../init.d/ssh
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 , 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 20 0 1 6 .   #Sets  S20 at rl=2 3 4 5,  K20 at rl 0 1 6 

Previous Pageprevious First Pagetop Next Pagenext