311e560282520f4f5488e5921b2f20ce7d3933d3
[public/netxms.git] / contrib / startup / ubuntu / nxhttpd.in
1 #!/bin/sh
2 #
3 #######################################
4 #
5 # NetXMS web server startup script
6 # For Ubuntu Linux
7 #
8 # Written by Dmitry Chernyshov
9 # dchernyshov@cogito.ru
10 #
11 #######################################
12
13 NETXMS_BINDIR="~BINDIR~"
14 NETXMS_LIBDIR="~LIBDIR~"
15
16 NAME=nxhttpd
17 DAEMON=$NETXMS_BINDIR/nxhttpd
18 PIDFILE=/var/run/$NAME.pid
19
20 test -x $DAEMON || exit 5
21
22
23 . /lib/lsb/init-functions
24 case "$1" in
25 start)
26 # start daemon
27 log_daemon_msg "Starting NetXMS agent" "$NAME"
28 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- -p $PIDFILE -d
29 log_end_msg $?
30 ;;
31 stop)
32 log_daemon_msg "Stopping NetXMS agent" "$NAME"
33 start-stop-daemon --stop --quiet --pidfile $PIDFILE
34 log_end_msg $?
35 ;;
36 restart)
37 $0 stop && sleep 2 && $0 start
38 ;;
39 esac