climagic Logo climagic

Some services are configured to start in your Xen virtual machine out of the box. The scripts that run on start up are stored in the /etc/init.d/ directory. You can start/stop/restart services with out rebooting your Xen virtual machine by running the script with the argument of start, stop, or restart. For example:

/etc/init.d/scriptname restart

/etc/init.d/scriptname start

/etc/init.d/scriptname stop


Adding a script to run at startup

To make a script run at startup of your Xen virtual machine you need to put the script in /etc/init.d and make sure it will take the start and stop arguements. Once the script is in /etc/init.d you need to tell the system when to run the script. You can use the following command:

rc-update add scriptname default

The default in the above command tells the system what runlevel the script needs to be run at. For most scipts the default runlevel will work fine.

for more info on runlevels check out http://en.wikipedia.org/wiki/Runlevel. The runlevel for a script is not something to play with, please know what you are doing before changing the runlevel for scripts.


Stopping a script from running at startup

If you wish to stop a script in the /etc/init.d directory from running on startup you can use the following command:

rc-update del scriptname