summaryrefslogtreecommitdiff
path: root/business/openerp-server/rc.openerp-server
diff options
context:
space:
mode:
authorHeinz Wiesinger <pprkut@liwjatan.at>2010-05-13 00:57:33 +0200
committerRobby Workman <rworkman@slackbuilds.org>2010-05-13 00:57:33 +0200
commitb85ca6c5a998685631293a9ca60bc218cab7d207 (patch)
tree48b188bd935148d74b02c6d2efdbbd962233143d /business/openerp-server/rc.openerp-server
parent1da880f92e55737f2bc6bdecd2018da0c33197c0 (diff)
downloadslackbuilds-b85ca6c5a998685631293a9ca60bc218cab7d207.tar.gz
business/openerp-server: Added to 13.0 repository
Diffstat (limited to 'business/openerp-server/rc.openerp-server')
-rw-r--r--business/openerp-server/rc.openerp-server52
1 files changed, 52 insertions, 0 deletions
diff --git a/business/openerp-server/rc.openerp-server b/business/openerp-server/rc.openerp-server
new file mode 100644
index 0000000000..37fa2d5bee
--- /dev/null
+++ b/business/openerp-server/rc.openerp-server
@@ -0,0 +1,52 @@
+#!/bin/sh
+# Start/stop/restart openerp-server.
+# $Id: rc.openerp-server,v 1.1 2009/03/31
+# Author: Heinz Wiesinger <pprkut@liwjatan.at>
+# ---------------------------------------------------------------------------
+
+PIDFILE=/var/spool/openerp/openerp-server.pid
+LOCKFILE=/var/lock/subsys/openerp-server
+LOGFILE=/var/log/openerp/openerp-server.log
+
+# Start openerp:
+openerp_start() {
+ if [ -x /usr/bin/openerp-server ]; then
+ echo "Starting openerp server: /usr/bin/openerp-server "
+ if [ -e "$LOCKFILE" ]; then
+ echo "openerp server already running!"
+ echo "Please remove $LOCKFILE"
+ else
+ /usr/bin/openerp-server --pidfile=$PIDFILE --logfile=$LOGFILE \
+ -c /etc/openerp/openerp-server.conf &
+ touch $LOCKFILE
+ fi
+ fi
+}
+
+# Stop openerp:
+openerp_stop() {
+ echo "Stopping openerp-server"
+ kill -TERM $(cat $PIDFILE) > /dev/null 2>&1
+ rm -f $LOCKFILE
+}
+
+# Restart openerp:
+openerp_restart() {
+ openerp_stop
+ sleep 1
+ openerp_start
+}
+
+case "$1" in
+'start')
+ openerp_start
+ ;;
+'stop')
+ openerp_stop
+ ;;
+'restart')
+ openerp_restart
+ ;;
+*)
+ echo "usage $0 start|stop|restart"
+esac