Change Hostname

Debian based systems use the file /etc/hostname to read the hostname of the system at boot time and set it up using the init script /etc/init.d/ So on a Debian based system we can edit the file /etc/hostname and change the name of the system and then run,

# /etc/init.d/ start

To make the change active. The hostname saved in this file will be saved on system reboot.

Start applications on boot (Debian)

update-rc.d is the utility that Debian provides to manage init scripts. It is similiar to Redhat’s chkconfig. Say, you have a new service called “mine” that you would like to start at boot time. Make sure that the file “/etc/init.d/mine” exists. Below is the command that you can type to make your service run at boot time.

# update-rc.d mine defaults

This will make sure that when your system reaches runlevel 2, 3, 4 or 5 that the “mine” service will start up and that in runlevel 0, 1 or 6 it will be stopped. So you’re done with your “mine” and you would like to stop them from starting up when you reboot? Use the command to remove it from starting up at boot time:

# update-rc.d mine remove

To start up in runlevels 2 or 3, you could run the following command:

# update-rc.d mine start 45 stop 01236

Mine will start up when your system reaches runlevels 4 or 5, but stop at 0, 1, 2, 3 or 6.

rcconf ( apt-get install rcconf ) tool is a graphical interface that can be used from the shell to configure your init scripts.