diff options
| author | Simon Lejeune <sle@openerp.com> | 2014-09-02 12:06:39 +0200 |
|---|---|---|
| committer | Simon Lejeune <sle@openerp.com> | 2014-09-02 14:13:00 +0200 |
| commit | 2cf4051a1556d64a1ff321658c4c2e0a60a13132 (patch) | |
| tree | 102fa79d2eaec332ab8e41faca86fde9ce1715ed /debian/init | |
| parent | 735924878f89041f3b74540848baef71790872a1 (diff) | |
[REF] Debian: renamed debhelpers scripts to not contain openerp in their filenames anymore, removed run_all_with_tests.sh script
Diffstat (limited to 'debian/init')
| -rw-r--r-- | debian/init | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/debian/init b/debian/init new file mode 100644 index 00000000000..98e653298b2 --- /dev/null +++ b/debian/init @@ -0,0 +1,62 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: openerp-server +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Should-Start: $network +# Should-Stop: $network +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Enterprise Resource Management software +# Description: Open ERP is a complete ERP and CRM software. +### END INIT INFO + +PATH=/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/bin/openerp-server +NAME=openerp-server +DESC=openerp-server +CONFIG=/etc/openerp/openerp-server.conf +LOGFILE=/var/log/openerp/openerp-server.log +USER=openerp + +test -x ${DAEMON} || exit 0 + +set -e + +do_start () { + echo -n "Starting ${DESC}: " + start-stop-daemon --start --quiet --pidfile /var/run/${NAME}.pid --chuid ${USER} --background --make-pidfile --exec ${DAEMON} -- --config=${CONFIG} --logfile=${LOGFILE} + echo "${NAME}." +} + +do_stop () { + echo -n "Stopping ${DESC}: " + start-stop-daemon --stop --quiet --pidfile /var/run/${NAME}.pid --oknodo + echo "${NAME}." +} + +case "${1}" in + start) + do_start + ;; + + stop) + do_stop + ;; + + restart|force-reload) + echo -n "Restarting ${DESC}: " + do_stop + sleep 1 + do_start + ;; + + *) + N=/etc/init.d/${NAME} + echo "Usage: ${NAME} {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 |
