first submodule: house_booking
[odoo/odoo.git] / debian / openerp.init
1 #!/bin/sh
2
3 ### BEGIN INIT INFO
4 # Provides:             openerp-server
5 # Required-Start:       $remote_fs $syslog
6 # Required-Stop:        $remote_fs $syslog
7 # Should-Start:         $network
8 # Should-Stop:          $network
9 # Default-Start:        2 3 4 5
10 # Default-Stop:         0 1 6
11 # Short-Description:    Enterprise Resource Management software
12 # Description:          Open ERP is a complete ERP and CRM software.
13 ### END INIT INFO
14
15 PATH=/sbin:/bin:/usr/sbin:/usr/bin
16 DAEMON=/usr/bin/openerp-server
17 NAME=openerp-server
18 DESC=openerp-server
19 CONFIG=/etc/openerp/openerp-server.conf
20 LOGFILE=/var/log/openerp/openerp-server.log
21 USER=openerp
22
23 test -x ${DAEMON} || exit 0
24
25 set -e
26
27 do_start () {
28     echo -n "Starting ${DESC}: "
29     start-stop-daemon --start --quiet --pidfile /var/run/${NAME}.pid --chuid ${USER} --background --make-pidfile --exec ${DAEMON} -- --config=${CONFIG} --logfile=${LOGFILE}
30     echo "${NAME}."
31 }
32
33 do_stop () {
34     echo -n "Stopping ${DESC}: "
35     start-stop-daemon --stop --quiet --pidfile /var/run/${NAME}.pid --oknodo
36     echo "${NAME}."
37 }
38
39 case "${1}" in
40     start)
41         do_start
42         ;;
43
44     stop)
45         do_stop
46         ;;
47
48     restart|force-reload)
49         echo -n "Restarting ${DESC}: "
50         do_stop
51         sleep 1
52         do_start
53         ;;
54
55     *)
56         N=/etc/init.d/${NAME}
57         echo "Usage: ${NAME} {start|stop|restart|force-reload}" >&2
58         exit 1
59         ;;
60 esac
61
62 exit 0