X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=setup%2Fredhat%2Fpostinstall.sh;fp=setup%2Fredhat%2Fpostinstall.sh;h=04ea928b13a388fdf907690d5dc8e9fdd058f544;hb=c15f748be05b3709f5e16680569abdc2949468e2;hp=437fdcec4261c4aaa4550d2eec0806887caf013e;hpb=1dbf153eb51303c4186ca5e2dacd729aadd95f28;p=odoo%2Fodoo.git diff --git a/setup/redhat/postinstall.sh b/setup/redhat/postinstall.sh index 437fdce..04ea928 100644 --- a/setup/redhat/postinstall.sh +++ b/setup/redhat/postinstall.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh set -e @@ -25,7 +25,7 @@ db_host = False db_port = False db_user = $ODOO_USER db_password = False -addons_path = /usr/local/lib/python2.7/dist-packages/openerp/addons +addons_path = /usr/lib/python2.7/site-packages/openerp/addons " > $ODOO_CONFIGURATION_FILE chown $ODOO_USER:$ODOO_GROUP $ODOO_CONFIGURATION_FILE chmod 0640 $ODOO_CONFIGURATION_FILE @@ -37,81 +37,21 @@ chmod 0750 $ODOO_LOG_DIR mkdir -p $ODOO_DATA_DIR chown $ODOO_USER:$ODOO_GROUP $ODOO_DATA_DIR -INIT_FILE=/etc/init.d/openerp +INIT_FILE=/lib/systemd/system/odoo.service touch $INIT_FILE chmod 0700 $INIT_FILE -# FIXME this is a copy of debian/init file. -# If anyone know how to tell bdist_rpm to use this file directly... cat << 'EOF' > $INIT_FILE -#!/bin/bash -### BEGIN INIT INFO -# Provides: openerp-server -# Required-Start: $remote_fs $syslog -# Required-Stop: $remote_fs $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Start openerp daemon at boot time -# Description: Enable service provided by daemon. -# X-Interactive: true -### END INIT INFO -## more info: http://wiki.debian.org/LSBInitScripts - -PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin -DAEMON=/usr/bin/openerp-server -NAME=openerp -DESC=openerp -CONFIG=/etc/odoo/openerp-server.conf -LOGFILE=/var/log/odoo/openerp-server.log -PIDFILE=/var/run/${NAME}.pid -USER=odoo -export LOGNAME=$USER - -test -x $DAEMON || exit 0 -set -e - -function _start() { - start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid $USER:$USER --background --make-pidfile --exec $DAEMON -- --config $CONFIG --logfile $LOGFILE -} - -function _stop() { - start-stop-daemon --stop --quiet --pidfile $PIDFILE --oknodo --retry 3 - rm -f $PIDFILE -} - -function _status() { - start-stop-daemon --status --quiet --pidfile $PIDFILE - return $? -} - - -case "$1" in - start) - echo -n "Starting $DESC: " - _start - echo "ok" - ;; - stop) - echo -n "Stopping $DESC: " - _stop - echo "ok" - ;; - restart|force-reload) - echo -n "Restarting $DESC: " - _stop - sleep 1 - _start - echo "ok" - ;; - status) - echo -n "Status of $DESC: " - _status && echo "running" || echo "stopped" - ;; - *) - N=/etc/init.d/$NAME - echo "Usage: $N {start|stop|restart|force-reload|status}" >&2 - exit 1 - ;; -esac - -exit 0 +[Unit] +Description=Odoo Open Source ERP and CRM +After=network.target + +[Service] +Type=simple +User=odoo +Group=odoo +ExecStart=/usr/bin/odoo.py --config=/etc/odoo/openerp-server.conf + +[Install] +WantedBy=multi-user.target EOF +easy_install pyPdf vatnumber pydot psycogreen