Enable daemon so that it always runs

0

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.

    
asked by Guillermo Ricardo Spindola Bri 02.07.2018 в 19:54
source

0 answers