Tuesday, December 2, 2008

Ubuntu Service Management

To disable a startup service use: sudo update-rc.d -f mysql remove
(had to use -f option to force remove)
To make mysql startup when ubuntu boots: sudo update-rc.d mysql defaults

sudo update-rc.d mysql remove
update-rc.d: /etc/init.d/mysql exists during rc.d purge (use -f to force)

sudo update-rc.d -f mysql remove
Removing any system startup links for /etc/init.d/mysql ...
/etc/rc0.d/K21mysql
/etc/rc1.d/K21mysql
/etc/rc2.d/S19mysql
/etc/rc3.d/S19mysql
/etc/rc4.d/S19mysql
/etc/rc5.d/S19mysql
/etc/rc6.d/K21mysql

sudo update-rc.d mysql defaults
Adding system startup for /etc/init.d/mysql ...
/etc/rc0.d/K20mysql -> ../init.d/mysql
/etc/rc1.d/K20mysql -> ../init.d/mysql
/etc/rc6.d/K20mysql -> ../init.d/mysql
/etc/rc2.d/S20mysql -> ../init.d/mysql
/etc/rc3.d/S20mysql -> ../init.d/mysql
/etc/rc4.d/S20mysql -> ../init.d/mysql
/etc/rc5.d/S20mysql -> ../init.d/mysql

This is the link I followed: http://nixcraft.com/shell-scripting/542-ubuntu-linux-control-startup-services-scripts.html

No comments: