0
votes

I'm trying to set the configuration file of my odoo server to certain file, I know that running odoo with the -c <path> or --config <path> will do the work, but I'm running it in the server like a service so I can't do this, neither adding the configs to /etc/odoo/odoo.conf because I need 2 configuration files.

Does someone knows how can I can make odoo service run with certain flags(-c and --load)

Here's my config at /etc/odoo/odoo.conf

[options]
addons_path = /usr/lib/python2.7/distpackages/odoo/addons,/opt/odoo/addons/odoodoto
admin_passwd = XXXXXXXXXXXX
data_dir = /var/lib/odoo
db_host = False
db_name = False
db_password = False
db_port = 5432
db_user = False
demo = {}
log_level = warn
logfile = /var/log/odoo/odoo-server.log
logrotate = True
proxy_mode = False

And my second config:

[connector-options]
workers = 4
export ODOO_CONNECTOR_CHANNELS=root:5
export ODOO_CONNECTOR_PORT=8069
log-level = warn

And the --load=web,connector is the other flag I need

2
Show me the entire files and i may help you - dccdany

2 Answers

0
votes

Without getting into many details of the init systems of Ubuntu, you should have a bash script inside /etc/init.d (probably /etc/init.d/odoo-server).

Inside that file insert a line:

DAEMON_OPTS="-c /etc/odoo/odoo.conf"

Use commas to pass more parameters

0
votes

The file I was looking for is /etc/systemd/system/odoo.service there you can specify in the [Service] options something like this ExecStart=/usr/local/bin/odoo --load=web,connector -c /somedir/odoo-server.conf.

You can also configure some of the service settings in /etc/init.d/odoo like George Daramouskas sayed but I don't really know how and if you can add the flags I wanted