Tuesday, August 4, 2009

Como crear (y que funcione) un servicio en /etc/init.d para SUSE

SDB:How to Create Your Own Init Script
From openSUSE

Situation:
You want to create your own script which will be started and stopped in certain runlevels.
You also want to control this script by means of:
rc<scriptname> {start|stop|status|reload|force-reload|try-restart|restart}

Procedure:
Copy the sample script to your new script:
cp /etc/init.d/skeleton /etc/init.d/<scriptname>
Edit the file /etc/init.d/<scriptname> with a text editor of your choice and read and follow its instructions.
Now activate your script so that it can be run when the system boots:
/sbin/insserv /etc/init.d/<scriptname>
Finally, create a link to /sbin:
ln -s /etc/init.d/<scriptname> /sbin/rc<scriptname>

Additional Information
For further information, please refer to the following manpages: init(8), init.d(7), insserv(8)

No comments:

Post a Comment