segunda-feira, 1 de fevereiro de 2010

Add a script to run on boot

So if you have a script and you wish to run them each time you boot up. This will tell you how to do that.

Write a script. put it in the /etc/init.d/ directory.
Lets say you called it XPTO.
  • Give them execution privileges using:
$chmod + XPTO
  •  Now run

$update-rc.d XPTO defaults

You can check out
% man update-rc.d for more information. It is a Debian utility to install scripts. The option “defaults” puts a link to start XPTO in run levels 2, 3, 4 and 5. (and puts a link to stop XPTO into 0, 1 and 6.)

  • To know which runlevel you are in use:
  $runlevel


Sem comentários:

Enviar um comentário