1

I have problem in multiple servers (it happened twice, one per month) where starting Daily apt upgrade and clean activities for some reason stops my specific service and then never starts it, so it is turned off and then I need to start it manually.

In syslogs I see this:

Mar  7 06:59:24 server systemd[1]: Starting Daily apt upgrade and clean activities...
Mar  7 06:59:38 server systemd[1]: Reloading.
Mar  7 06:59:38 server systemd[1]: Started ACPI event daemon.
Mar  7 06:59:38 server systemd[1]: Stopping Odoo 11...
Mar  7 06:59:39 server systemd[1]: Stopped Odoo 11.
Mar  7 06:59:39 server systemd[1]: Stopped PostgreSQL RDBMS.
Mar  7 06:59:39 server systemd[1]: Stopping PostgreSQL Cluster 9.5-main...
Mar  7 06:59:41 server systemd[1]: Stopped PostgreSQL Cluster 9.5-main.
Mar  7 06:59:42 server systemd[1]: Reloading.
Mar  7 06:59:42 server systemd[1]: Starting Daily apt download activities...
Mar  7 06:59:42 server systemd[1]: Started ACPI event daemon.
Mar  7 06:59:42 server systemd[1]: Reloading.
Mar  7 06:59:42 server systemd[1]: Started ACPI event daemon.
Mar  7 06:59:42 server systemd[1]: Starting PostgreSQL Cluster 9.5-main...
Mar  7 06:59:45 server systemd[1]: Started PostgreSQL Cluster 9.5-main.
Mar  7 06:59:45 server systemd[1]: Starting PostgreSQL RDBMS...
Mar  7 06:59:45 server systemd[1]: Started PostgreSQL RDBMS.
Mar  7 06:59:51 server systemd[1]: Started Daily apt upgrade and clean activities.
Mar  7 06:59:59 server systemd[1]: Started Daily apt download activities.

As you can see from log, when it starts that, it also starts ACPI event daemon, which then stops Odoo 11 service, but this service stays stopped, even though it should not be.

And here is systemd config for Odoo 11 service:

[Unit]
Description=Odoo 11
Requires=postgresql.service
After=postgresql.service

[Service]
Type=simple
PermissionsStartOnly=true
User=odoo
Group=odoo
SyslogIdentifier=odoo11
ExecStart=/opt/odoo/venv/bin/python3 /opt/odoo/odoo/odoo-bin -c /etc/odoo11.conf

[Install]
WantedBy=multi-user.target

Maybe something wrong with systemd start-stop service config? Though if I run that service myself, it works as intended.

1 Answer 1

1

You probably want to to use Wants= with your PostgreSQL service dependency instead of Requires=.

With Wants=, your app won't be stopped just because PostgreSQL was stop/started for a software upgrade.

Read about the distinction more in man systemd.unit.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .