I'm running Odoo on Ubuntu 16. Odoo is installed in /opt/odoo/odoo10 and its config is /etc/odoo.conf.
My service /lib/systemd/system/odoo-server.service is:
[Unit]
Description=Odoo Open Source ERP and CRM
Requires=postgresql.service
After=network.target postgresql.service
[Service]
Type=simple
PermissionsStartOnly=true
SyslogIdentifier=odoo-server
User=odoo
Group=odoo
ExecStart=/opt/odoo/odoo-bin --config=/etc/odoo-server.conf --addons-path=/opt/odoo/addons/
WorkingDirectory=/opt/odoo/
StandardOutput=journal+console
[Install]
WantedBy=multi-user.target
The service works well when I don't use workers. But when I enable them I start getting errors in the log and even log messages I don't have set. Have set type to log to error but I'm getting all types of log messages. It's like a worker cannot read the config file.
When I look at the status of the server there is only one difference when running without workers. One worker that has a added parameter "gevent" uses /usr/bin/python!
949 /usr/bin/python /opt/odoo/odoo10/odoo-bin gevent --config=/etc/odoo.conf --addons-path=/opt/odoo/odoo10/addons/,/opt/odoo/customaddons
All other use python
943 python /opt/odoo/odoo10/odoo-bin --config=/etc/odoo.conf --addons-path=/opt/odoo/odoo10/addons/,/opt/odoo/customaddons
How to fix that this odoo-bin gevent runs like others?
what is status of the service (sudo systemctl status odoo-server) ?
what is logs of sudo journalctl -u odoo-server ?
hey Ravi... The only problem is that the gevent worker process doesn't use the log type defined in the odoo.conf and that it accesses the old, not used database. I had an old database that I don't use and it's not up to date. Was for the old domain. All the errors were from the not used database. Had to remove all active sessions on the databases and set the allow connection to false. Now There are no more errors. I figured it out half an hour ago. Thanks for trying to help.
Great, how can we set the allow connection to false is there any config parameter?
From postgresql 9.5 you can do ALTER DATABASE <db_name> WITH ALLOW_CONNECTIONS false;