first make a new script- here 'my_own_script'. Open the file in gedit and add the following:
#! /bin/bashYou need to change to the correct path in 3rd line. Here 345 means different run levels and 40 and 60 are the order for start and stop. save the file in /etc/init.d .
# chkconfig: 345 40 60
mkdir /home/tom/Desktop/folder
Then open terminal and execute this command:
chkconfig --level 345 my_own_script onThen restart you computer and you can see a directory named 'folder' on your desktop in each start up. For more details, use:
man chkconfigThe mkdir command can be replaced by your own custom scripts. This worked on my PC powered with fedora 12. I found in linux forums that, it will work on Redhat/CentOS/Mandriva.
Start up programs are sometimes irritating and delay start up. So if you want to turn off your script from next start up, use command:
chkconfig --level 345 my_own_script off
No comments:
Post a Comment