Chkconfig: Configure which services start on boot

Most of the times if I install some services on my laptop or desktop computer, I don't want them to be running all the time. Some examples are apache or ssh. Of course, I can stop them manually like this:

% service apache2 stop
% service ssh stop


% /etc/init.d/apache2 stop
% /etc/init.d/ssh stop

But if you reboot often or turn off the computer at night if quickly becomes a pain, and a waste of time.

Enter chkconfig. This little tool handles the symbolic links to the startup scripts for you. There is a package available in the debian repositories, so this is enough to install it:

% aptitude install chkconfig

To list the installed services and their current configuration:

% chkconfig -l

To start services on boot:

% chkconfig apache2 on
% chkconfig ssh on

To prevent a service from starting on boot:

% chkconfig apache2 off
% chkconfig ssh off