Help

3

Odoo 10 runs via ./odoo-bin but cannot get to run as a service - Is this a systemd / upstart thing?

Avatar
Cameron

I've installed odoo10 - by running ./odoo-bin all works, add mods, control etc, etc... happy days!

Ive create a service, and although the service appears to start  - nothing appears in my browser..

Is this a systemd / upstart thing?

Any ideas or direction would be greatly appreciated

I've even tried odoo 9 but same problem :(

I thought it was because I am also running openerp 7 - but no change when I stop that service

Avatar
Discard
7 Answers
6
Avatar
Ray Carnes
Best Answer

Yes - You need to convert upstart scripts to systemd.  See https://wiki.ubuntu.com/SystemdForUpstartUsers or https://www.digitalocean.com

On Ubuntu, this is how you create a service for Odoo X (tested with v10, v11, v12 and v13):

[Unit]
Description=Odoo
Documentation=http://www.odoo.com/

[Service]
# Ubuntu/Debian convention:
Type=simple
User=odoo
ExecStart=/opt/odoo/odoo-bin -c /etc/odoo-server.conf

[Install]
WantedBy=default.target

You put this in /etc/systemd/system and I called my file odooX.service so you can then do:

sudo systemctl daemon-reload (Reloads services) 

sudo systemctl start odooX.service (starts service)
sudo systemctl stop odooX.service (stops service)
sudo systemctl restart odooX.service (restarts Service)
sudo systemctl status odooX.service (status of service)
sudo systemctl enable odooX.service (starts service at boot)
sudo systemctl disable odooX.service (disables service at boot)

small edit...

Kept throw up error "OSError: [Errno 13] Permission denied: '/var/lib/odoo'"

to fix..

sudo mkdir /var/lib/odoo
sudo chown odoo:root /var/lib/odoo -R

.


2 Comments
Avatar
Discard
Avatar
Cameron
-

YES! yes yes yes yes yes yes yes yes yes yes yes yes yes yes- thank you so so much, have a great new year!

Avatar
deep
-

@Ray, this worked lilke a charm, thankQ so much. The same I would like to run for multi-user.target. Could you plz let me know what needs to done for that? I did place the service file in multi-user.target.wants, but got an error like, 'Unit not found'

1
Avatar
Stella Fredö
Best Answer

This one works on the CENTOS 7 .2for odoo 10 your service script [Unit] Description=ODOO Application Server After=network.service [Install] Alias=odoo-server.service [Service] Type=simple PermissionsStartOnly=true User=odoo Group=odoo SyslogIdentifier=odoo-server PIDFile=/run/odoo/odoo-server.pid ExecStartPre=/usr/bin/install -d -m755 -o odoo -g odoo /run/odoo ExecStart=/PATH-TO-YOUR/odoo-bin -c /etc/odoo-server.conf --pid=/run/odoo/odoo-server.pid --syslog ExecStop=/bin/kill $MAINPID [Install] WantedBy=multi-user.target

Avatar
Discard
0
Avatar
Antuan
Best Answer

This is the systemd file we are currently using

odoo.service
[Unit]
Description=ODOO Application Server
Requires=postgresql.service
After=postgresql.service
[Install]
Alias=odoo.service
[Service]
Type=simple
PermissionsStartOnly=true
User=ingeos
Group=ingeos
SyslogIdentifier=odoo
PIDFile=/run/odoo/odoo.pid
ExecStartPre=/usr/bin/install -d -m755 -o ingeos -g ingeos /run/odoo
ExecStart=/home/ingeos/odoo/server/odoo-bin -c /etc/odoo/odoo.conf --pid=/run/odoo/odoo.pid
ExecStop=/bin/kill $MAINPID
[Install]
WantedBy=multi-user.target
Avatar
Discard
0
Avatar
Alison Smith
Best Answer

Hi Cameron

We are an Odoo user in the UK and have a similar issue - any chance we can talk?

01572 338011

Thank you

Alison

1 Comment
Avatar
Discard

We are happy to help on same, Please contact at abhishek@erpharbor.com same email you can find on Skype too.