xf.li | 8611891 | 2025-03-19 20:07:27 -0700 | [diff] [blame^] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # Run the daemon |
| 4 | # |
| 5 | |
| 6 | DAEMON="msm_svr" |
| 7 | PIDFILE="/var/run/$DAEMON.pid" |
| 8 | EXEC="/usr/bin/msm_svr" |
| 9 | |
| 10 | start() { |
| 11 | echo -n "Starting $DAEMON... " |
| 12 | start-stop-daemon --no-close -S -b -m -p $PIDFILE -x $EXEC |
| 13 | [ $? -eq 0 ] && echo "OK" || echo "ERROR" |
| 14 | } |
| 15 | |
| 16 | stop() { |
| 17 | echo -n "Stopping $DAEMON... " |
| 18 | start-stop-daemon -K -p $PIDFILE |
| 19 | [ $? -eq 0 ] && echo "OK" || echo "ERROR" |
| 20 | } |
| 21 | |
| 22 | restart() { |
| 23 | stop |
| 24 | start |
| 25 | } |
| 26 | |
| 27 | case "$1" in |
| 28 | start|stop|restart) |
| 29 | "$1" |
| 30 | ;; |
| 31 | *) |
| 32 | echo "Usage: $0 {start|stop|restart}" |
| 33 | exit 1 |
| 34 | esac |
| 35 | |
| 36 | exit $? |