I have the following script in Bash that executes a script in Python. At the moment I only have the options of "start", "restart" and "stop":
#!/bin/bash
# /etc/init.d/test
### BEGIN INIT INFO
...
### END INIT INFO
case "$1" in
start)
echo "Starting server"
python /usr/local/nagios/nan/mailer/mailer.py start
;;
stop)
echo "Stopping server"
python /usr/local/nagios/nan/mailer/mailer.py stop
;;
restart)
echo "Restarting server"
python /usr/local/nagios/nan/mailer/mailer.py restart
;;
*)
echo "Usage: /etc/init.d/demonioprueba.sh {start|stop|restart}"
exit 1
;;
esac
exit 0
But I do not have an option to see the status of that demon. In what way could you add it to display the status of the service ?. I would also like to enable it so that it runs without needing to run it every time I start it. As I understand it would have to be with "chkconfig on", but in what way I could do it.