SYSV init service
copy init to /etc/init.d/ from the Odoo source Debian directory and rename it to Odoo
Cd/opt/odoo
sudo cp/opt/odoo/debian/init/etc/init.d/odoo
turn on odoo to modify the installation
For example
to modify the USER to Odoo
Set the ODOO binary to /opt/odoo/odoo-bin
Set the ODOO configuration to /opt/odoo/odoo.conf
run the following command Enable Odoo Services
sudo chmod +x/etc/init.d/odoo
sudo update-rc.d odoo default
run sudo/etc/init.d/odoo start service
run Sudo/etc/init.d/odoo stop stop service
systemd service
for Ubunttu , start with systemd Management Service
of course, Ubuntu16 is also compatible with the INIT format service and will automatically convert it to the SYSTEMD format
Create Service Description /lib/systemd/system/odoo.service
The contents are as follows
[Unit]
Description=odoo
After=postgresql.service
[Service]
Type=simple
User=odoo
Group=odoo
Execstart=/opt/odoo/odoo-bin-c/opt/odoo/odoo.conf
[Install]
Wantedby=multi-user.target
Enable Odoo Services
sudo systemctl enable Odoo.service
View service Status
sudo systemctl odoo status
Use Command start / stop service
sudo systemctl odoo start
sudo systemctl odoo stop
Installing Odoo Services