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
4 Answers
5
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 16.04, this is how you create a service for Odoo10:

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

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

[Install]
WantedBy=default.target

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

sudo systemctl daemon-reload (Reloads services) (18.04)

sudo systemctl start odoo10.service (starts service)
sudo systemctl stop odoo10.service (stops service)
sudo systemctl restart odoo10.service (restarts Service)
sudo systemctl status odoo10.service (status of service)
sudo systemctl enable odoo10.service (starts service at boot)
sudo systemctl disable odoo10.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.