Setup Odoo 10 to run as service
If you've followed my previous article on Odoo Setup, you would have an odoo setup running in your machine. Today i'll show you how to setup odoo to run as a service.
The following are the assumptions.
odoo sources are at the path /opt/code/odoo.
Local user odoo is part of the group odoo and owner and group of odoo sources folder is set to odoo.
Now follow the below steps to make odoo run as a service.
Move odoo binary into /usr/bin/odoo.
sudo cp /opt/code/odoo/odoo-bin /usr/bin/odoo
Create directory for saving odoo configuration
sudo mkdir /etc/odoo && sudo chown -R odoo:odoo /etc/odoo
Create directory for odoo logs.
sudo mkdir /var/log/odoo && sudo chown -R odoo:odoo /var/log/odoo
Create odoo configuration file.
odoo --save --config odoo.conf --stop-after-init mv odoo.conf /etc/odoo/odoo.conf
If you need to update any configuration, please do the necessary changes in /etc/odoo/odoo.conf file. Refer odoo reference for more information.
Create odoo service.
sudo cp /opt/code/odoo/debian/init /etc/init.d/odoo sudo chmod +x /etc/init.d/odoo sudo update-rc.d -f odoo start 20 2 3 4 5 .
Start odoo server.
sudo service odoo start
Now you can use ubuntu services to start/stop odoo server. If you face any difficutly mention me on twitter @shahalpk.










