~openerp-dev/openobject-server/trunk-bug-1161881-ishwar

« back to all changes in this revision

Viewing changes to debian/openerp.init

  • Committer: Vo Minh Thu
  • Date: 2013-04-04 13:07:04 UTC
  • mfrom: (4743.1.176 openobject-server)
  • Revision ID: vmt@openerp.com-20130404130704-24vsmczw34cssytd
[MERGE] forward merge 7.0 until revision 4919.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
NAME=openerp-server
18
18
DESC=openerp-server
19
19
CONFIG=/etc/openerp/openerp-server.conf
20
 
LOGFILE=/var/log/openerp-server.log
 
20
LOGFILE=/var/log/openerp/openerp-server.log
21
21
USER=openerp
22
22
 
23
23
test -x ${DAEMON} || exit 0
24
24
 
25
25
set -e
26
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
 
27
39
case "${1}" in
28
 
        start)
29
 
                echo -n "Starting ${DESC}: "
30
 
 
31
 
                start-stop-daemon --start --quiet --pidfile /var/run/${NAME}.pid \
32
 
                        --chuid ${USER} --background --make-pidfile \
33
 
                        --exec ${DAEMON} -- --config=${CONFIG} \
34
 
                            --logfile=${LOGFILE}
35
 
 
36
 
                echo "${NAME}."
37
 
                ;;
38
 
 
39
 
        stop)
40
 
                echo -n "Stopping ${DESC}: "
41
 
 
42
 
                start-stop-daemon --stop --quiet --pidfile /var/run/${NAME}.pid \
43
 
                        --oknodo
44
 
 
45
 
                echo "${NAME}."
46
 
                ;;
47
 
 
48
 
        restart|force-reload)
49
 
                echo -n "Restarting ${DESC}: "
50
 
 
51
 
                start-stop-daemon --stop --quiet --pidfile /var/run/${NAME}.pid \
52
 
                        --oknodo
53
 
 
54
 
                sleep 1
55
 
 
56
 
                start-stop-daemon --start --quiet --pidfile /var/run/${NAME}.pid \
57
 
                        --chuid ${USER} --background --make-pidfile \
58
 
                        --exec ${DAEMON} -- --config=${CONFIG} \
59
 
                            --logfile=${LOGFILE}
60
 
 
61
 
                echo "${NAME}."
62
 
                ;;
63
 
 
64
 
        *)
65
 
                N=/etc/init.d/${NAME}
66
 
                echo "Usage: ${NAME} {start|stop|restart|force-reload}" >&2
67
 
                exit 1
68
 
                ;;
 
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
        ;;
69
60
esac
70
61
 
71
62
exit 0