docs/example-init.d-script
changeset 25 6c0a53a512d8
parent 24 0cdbd2735993
child 26 a7f74dd6d4e5
child 29 ee84c56d5019
equal deleted inserted replaced
24:0cdbd2735993 25:6c0a53a512d8
    14     start)
    14     start)
    15         echo "Starting fixbot:"
    15         echo "Starting fixbot:"
    16         echo -n "\tnexus... "
    16         echo -n "\tnexus... "
    17 
    17 
    18         start-stop-daemon --start --quiet --exec /usr/bin/twistd \
    18         start-stop-daemon --start --quiet --exec /usr/bin/twistd \
    19             --pidfile=$pidfile_nexus        \
    19             --pidfile="$pidfile_nexus"      \
    20             --rundir=$rundir                \
    20             --rundir="$rundir"              \
    21             --logfile=$logfile_nexus        \
    21             --logfile="$logfile_nexus"      \
    22             nexus                           \
    22             fixbot_nexus                    \
    23             $args_nexus                     \
    23             $args_nexus                     \
    24         && echo "[OK]" || echo "[FAIL]"
    24         && echo "[OK]" || echo "[FAIL]"
    25         
    25         
    26         echo -n "\tlogwatch... "
    26         echo -n "\tlogwatch... "
    27 
    27 
    28         start-stop-daemon --start --quiet --exec /usr/bin/twistd \
    28         start-stop-daemon --start --quiet --exec /usr/bin/twistd \
    29             --pidfile=$pidfile_logwatch     \
    29             --pidfile="$pidfile_logwatch"   \
    30             --rundir=$rundir                \
    30             --rundir="$rundir"              \
    31             --logfile=$logfile_logwatch     \
    31             --logfile="$logfile_logwatch"   \
    32             logwatch                        \
    32             fixbot_logwatch                 \
    33             $args_logwatch                  \
    33             $args_logwatch                  \
    34         && echo "[OK]" || echo "[FAIL]"
    34         && echo "[OK]" || echo "[FAIL]"
    35     ;;
    35     ;;
    36 
    36 
    37     stop)
    37     stop)
    38         echo -n "Stopping fixbot:"
    38         echo -n "Stopping fixbot:"
    39         
    39         
    40         echo "logwatch... "	
    40         echo "logwatch... "	
    41         start-stop-daemon --stop --quiet              --pidfile $pidfile_logwatch
    41         start-stop-daemon --stop --quiet    \
       
    42             --pidfile "$pidfile_logwatch"
    42 
    43 
    43         echo "nexus... "
    44         echo "nexus... "
    44         start-stop-daemon --stop --quiet              --pidfile $pidfile_nexus
    45         start-stop-daemon --stop --quiet    \
       
    46             --pidfile "$pidfile_nexus"
    45 
    47 
    46     ;;
    48     ;;
    47 
    49 
    48     restart)
    50     restart)
    49         $0 stop
    51         $0 stop
    53     force-reload)
    55     force-reload)
    54         $0 restart
    56         $0 restart
    55     ;;
    57     ;;
    56 
    58 
    57     *)
    59     *)
    58         echo "Usage: /etc/init.d/fixbot {start|stop|restart|force-reload}" >&2
    60         echo "Usage: $0 {start|stop|restart|force-reload}" >&2
    59         exit 1
    61         exit 1
    60     ;;
    62     ;;
    61 esac
    63 esac
    62 
    64 
    63 exit 0
    65 exit 0