1

No matter what value I set in the line DAEMON=/home/odoo/odoo/odoo-bin it always runs the old process in ExecStart. In other words, my changes aren't applied. I am running sudo nano /etc/init.d/odoo and then sudo service odoo start and it never applies my changes.

#!/bin/bash
### BEGIN INIT INFO
# Provides:          odoo
# 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: Start odoo daemon at boot time
# Description:       Enable service provided by daemon.
### END INIT INFO
## more info: http://wiki.debian.org/LSBInitScripts

. /lib/lsb/init-functions

PATH=/usr/local/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin
WORKDIR=/home/odoo/
DAEMON=/home/odoo/odoo/odoo-bin
NAME=odoo
DESC=odoo
CONFIG=/home/odoo/odoo.conf
LOGFILE=/var/log/odoo/odoo.log
PIDFILE=/var/run/${NAME}.pid
USER=odoo
export LOGNAME=$USER

test -x $DAEMON || exit 0
set -e

function _start() {
    start-stop-daemon --chdir=${WORKDIR} --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

I tried changing

 DAEMON=/home/odoo/odoo/odoo-bin

to

DAEMON=/home/odoo/odoo/odoo-binFAKEPATH

then ran:

sudo service odoo start 
sudo service odoo status

But I still get:

● odoo.service - odoo
    Loaded: loaded (/etc/systemd/system/odoo.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2018-04-11 21:45:20 CDT; 2s ago
   Process: 4467 **ExecStart=/home/odoo/odoo/server/odoo-bin** --config /home/odoo/odoo.conf (code=exited, status=203/EXEC)
 Main PID: 4467 (code=exited, status=203/EXEC)

What I was expecting to see:

ExecStart=/home/odoo/odoo/odoo-binFAKEPATH

1 Answer 1

0

Changing that file did nothing. I was editing the wrong file. I had to also update

sudo nano /etc/systemd/system/odoo.service

since my system uses systemd not init.d

3
  • This is not an answer - please edit your question.
    – fosslinux
    Commented Apr 12, 2018 at 2:50
  • The redundant file would be /etc/init.d/odoo. If you're on a version of Ubuntu using systemd, the systemd service is of course going to get the higher priority.
    – muru
    Commented Apr 12, 2018 at 3:06
  • " the systemd service is of course going to get the higher priority" I don't like redundancy between systems, because it's not clear which one is real
    – Jonathan
    Commented Apr 13, 2018 at 21:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .