Skip to content

Instantly share code, notes, and snippets.

@dperaltab
Created October 11, 2016 05:58
Show Gist options
  • Save dperaltab/5b54dcb0873e96b12c05daecd37ca82d to your computer and use it in GitHub Desktop.
Save dperaltab/5b54dcb0873e96b12c05daecd37ca82d to your computer and use it in GitHub Desktop.
#!/bin/sh
# replace odoo8 per odoo version
# Start/stop odoo8
PIDFILE=/var/run/odoo8.pid
. /lib/lsb/init-functions
NAME=odoo8
# id user odoo8git
RUN_AS=`id -u odoo`
# Path start.sh
CMD=/opt/odoo/config_odoo_deploy/start.sh
OPTS=
do_start() {
start-stop-daemon --start --background --user $RUN_AS --pidfile $PIDFILE --chuid $RUN_AS --startas $CMD -- $OPTS
}
do_stop() {
start-stop-daemon --stop --user $RUN_AS
}
case "$1" in
start)
log_action_msg "Starting $NAME"
do_start
;;
stop)
log_action_msg "Stopping $NAME"
do_stop
;;
restart)
log_action_msg "Restarting $NAME"
do_stop
do_start
;;
*)
log_action_msg "Usage: /etc/init.d/odoo8 {start|stop|restart}"
exit 2
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment