sábado, 16 de abril de 2016

Initialize script on startup the system

This article will show you how to start at system startup scripts in Ubuntu and Debian.
First we must create the script in /etc/init.d.

#vi /etc/init.d/myscript.sh


#!/bin/bash
sleep 10 &&
conky &
exit

After creating the script in the /etc/init.d we should give execute permission with the chmod command.

#chmod +x myscript.sh

Now we go using command:
update-rc.d /etc/init.d/myscritp.sh defaults



This exemple will go initialize the conky a software the hardware monitoring. When the system up, the script will initialize with the operational system.

If you want to remove the script from system startup:
  • You can delete the script 
  • Remove permission with the command 
#chmod -x /etc/init.d/myscript.sh
  • Or  remove the boot witch own update-rc.d
#update -rc.d -n -f myscritp.sh remove








Nenhum comentário:

Postar um comentário