You have a simple way of doing it.
You need to write a custom script that will manage the start/stop/restart of the service that is being added.
The skeleton of that script looks like this.
ReturnVal=0
start()
{
echo "Service is being started..."
}
stop()
{
echo "Service is being stopped..."
}
restart()
{
echo "Service is being Restarted..."
stop
start
}
case '$1' in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo "Invalid Option related to the Service."
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
exit $ReturnVal
The above script template can be used to create a custom script that can be used to manage a new service.
After this script is created place the file under
/etc/init.d
Make sure the sctipt is working properly by executing the following commands
service start
service stop
service restart
This can then be added using the chkconfig command.
chkconfig -add scriptname
For adding this to the auto start during bootup you can use the option.
ntsysv