2022-10-01 18:57:37 +02:00
|
|
|
[Unit]
|
|
|
|
After=risotto.target
|
|
|
|
|
|
|
|
[Service]
|
2022-10-19 18:37:51 +02:00
|
|
|
Environment="PGSSLROOTCERT=%%pg_client_crt_file"
|
|
|
|
Environment="PGSSLCERT=%%pg_client_crt_file"
|
|
|
|
Environment="PGSSLKEY=%%pg_client_key_file"
|
2022-10-01 18:57:37 +02:00
|
|
|
Environment="PGPASSFILE=/etc/odoo/postgresql.pass"
|
|
|
|
|
|
|
|
#if database not imported, imported it active addons
|
|
|
|
%set %%addons = ','.join(%%odoo_addons)
|
|
|
|
ExecStartPre=/usr/bin/bash -c '/usr/bin/psql --set=sslmode=verify-full -h %%pg_client_server_domainname -U %%pg_client_username %%pg_client_database -c "\dt account_account" 2>&1 | grep -vq "not find" || (echo "INIT DATABASE"; /usr/bin/odoo --config /etc/odoo/odoo.conf -i %%addons --stop-after-init; echo "OK")'
|
|
|
|
#change default values in database
|
|
|
|
ExecStartPre=+/usr/local/lib/sbin/config_odoo.py
|
|
|
|
|
|
|
|
ExecStart=
|
|
|
|
ExecStart=/usr/bin/odoo --config /etc/odoo/odoo.conf
|
|
|
|
TimeoutStartSec=360
|