wok view openerp-server/stuff/etc/init.d/openerp-server @ rev 22449

vlc: remove chromaprint-dev since it fails at that step
author Erkan Yilmaz <erkan@slitaz.org>
date Mon Dec 23 16:17:42 2019 +0000 (2019-12-23)
parents 0d8a1a3edc72
children
line source
1 #!/bin/sh
2 # /etc/init.d/openerp-server : Start, stop and restart OpenERP server on SliTaz, at
3 # boot time or with the command line.
4 #
5 # To start OpenERP server at boot time, just put openerp-server in the $RUN_DAEMONS
6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf
7 #
8 . /etc/init.d/rc.functions
9 . /etc/daemons.conf
11 NAME=OpenERP
12 DESC="$(_ '%s server' OpenERP)"
13 DAEMON=/usr/bin/openerp-server
14 OPTIONS=$OPENERP_OPTIONS
15 PIDFILE=/var/run/openerp/openerp-server.pid
16 LOGFILE=/var/log/openerp/openerp-server.log
17 CONFIGFILE=/etc/openerp/openerp-server.cfg
19 if [ -z "$OPTIONS" ]; then
20 OPTIONS="--pidfile=$PIDFILE --logfile=$LOGFILE -c $CONFIGFILE"
21 LANG=$(. /etc/locale.conf; echo $LANG)
22 [ -f /usr/lib/python*/site-packages/tinyerp-server/i18n/$LANG.csv ] && \
23 OPTIONS="$OPTIONS -l $LANG"
24 fi
26 if [ ! -d /var/run/openerp ]; then
27 mkdir -p /var/run/openerp
28 chmod 777 /var/run/openerp
29 fi
30 case "$1" in
31 start)
32 if active_pidfile $PIDFILE python ; then
33 _ '%s is already running.' $NAME
34 exit 1
35 fi
36 action 'Starting %s: %s...' "$DESC" $NAME
37 $DAEMON $OPTIONS &
38 status
39 sleep 4
40 # At boot OpenERP don't start correctly if we start it in background.
41 if ! active_pidfile $PIDFILE python ; then
42 sleep 6
43 $DAEMON $OPTIONS > $LOGFILE
44 fi ;;
45 stop)
46 if ! active_pidfile $PIDFILE python ; then
47 _ '%s is not running.' $NAME
48 exit 1
49 fi
50 action 'Stopping %s: %s...' "$DESC" $NAME
51 kill $(cat $PIDFILE)
52 rm -f $PIDFILE
53 status
54 sleep 2 ;;
55 restart)
56 if ! active_pidfile $PIDFILE python ; then
57 _ '%s is not running.' $NAME
58 exit 1
59 fi
60 action 'Restarting %s: %s...' "$DESC" $NAME
61 kill $(cat $PIDFILE)
62 rm -f $PIDFILE 2>/dev/null
63 sleep 2
64 $DAEMON $OPTIONS &
65 status
66 sleep 2 ;;
67 *)
68 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
69 newline
70 exit 1 ;;
71 esac
73 exit 0