Open [etc/init.d] Open [systemd]
Create a script in systemd folder
vim /etc/systemd/system/odoo11.service
Setup the content
[Unit]
Description=Odoo11
Requires=postgresql.service
After=network.target postgresql.service
[Service]
Type=simple
SyslogIdentifier=odoo11
PermissionsStartOnly=true
User=odoo
Group=odoo
ExecStart=/opt/odoo/odoo11-venv/bin/python3 /opt/odoo/odoo11/odoo-bin -c /etc/odoo11.conf
StandardOutput=journal+console
Restart=on-failure
RestartSec=1s
[Install]
WantedBy=multi-user.target
Reload daemons
systemctl daemon-reload
Start service
systemctl start odoo11
Check if working
systemctl status odoo11
Enable service at startup
systemctl enable odoo11
To see messagges of the service
journalctl -u odoo11