Tuesday, December 20, 2011

Linux - startup script

I never had the necessity of creating a start up script, but I need one for creating a folder within the /var/run path as it gets delete it on each reboot.

open a konsole and do the following:
1.cd /etc/init.d/
2.touch makedir
3.vim makedir
4. enter mkdir /var/run/pgpool  | chown wwwrun -R /var/run/pgpool
5.save the file
6.chmod +x makedir
7.chkconfig -a makedir

The above commands does the following
1. changes directory to a directory which contains the startup scripts
2. creates a file named makedir
3. edit the file makedir (vim is a text editor....use man vim if you are not familiar with it)
4. write your command in this file
5. save the file (again....use man vim to learn how to save the file)
6. change the file to executable making it a script
7. add makedir script to startup so it starts even after reboot


No comments:

Post a Comment