Unattended-upgrades order of restart caused failure to bind address
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
unattended-upgrades (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
This morning, nginx wan't working, so I checked the journal. It appears an overnight unattended-upgrades restarted a lot of services, including systemd-networkd and nginx. Logs pasted at the end, I am running Ubuntu 24.04.
I bind nginx to specific IP addresses, because different daemons listen on different addresses. When nginx was brought back up, it failed because the requested IP address had not yet come back up.
It would appear unattended-upgrades attempted to restart a lot of services at once, causing nginx to attempt to bind to an address which had not yet come back up.
Could there be more careful ordering of execution to avoid such problems?
May 24 06:27:54 alpha systemd[1]: Stopping packagekit.service - PackageKit Daemon...May 24 06:27:54 alpha systemd[1]: packagekit.service: Deactivated successfully.
May 24 06:27:54 alpha systemd[1]: Stopped packagekit.service - PackageKit Daemon.
May 24 06:27:54 alpha systemd[1]: exim4.service: Deactivated successfully.
May 24 06:27:54 alpha systemd[1]: Stopped exim4.service - exim Mail Transport Agent.
May 24 06:27:54 alpha systemd[1]: exim4.service: Consumed 15.241s CPU time, 26.4M memory peak, 0B memory swap peak.
May 24 06:27:54 alpha systemd[1]: Starting exim4.service - exim Mail Transport Agent...
May 24 06:27:54 alpha systemd[1]: Starting packagekit.service - PackageKit Daemon...
May 24 06:27:54 alpha systemd[1]: Stopping php8.3-fpm.service - The PHP 8.3 FastCGI Process Manager...
May 24 06:27:54 alpha systemd[1]: Stopping ssh.service - OpenBSD Secure Shell server...
May 24 06:27:54 alpha sshd[1427]: Received signal 15; terminating.
May 24 06:27:54 alpha systemd-
May 24 06:27:55 alpha systemd[1]: Stopping systemd-
May 24 06:27:55 alpha systemd-
May 24 06:27:55 alpha systemd[1]: netplan-
May 24 06:27:55 alpha systemd[1]: systemd-
May 24 06:27:55 alpha systemd[1]: Stopped systemd-
May 24 06:27:55 alpha systemd[1]: Stopping systemd-
May 24 06:27:55 alpha systemd[1]: Stopping systemd-
May 24 06:27:55 alpha systemd[1]: ssh.service: Deactivated successfully.
May 24 06:27:55 alpha systemd[1]: Stopped ssh.service - OpenBSD Secure Shell server.
May 24 06:27:55 alpha systemd[1]: Starting ssh.service - OpenBSD Secure Shell server...
May 24 06:27:55 alpha systemd[1]: nginx.service: Deactivated successfully.
May 24 06:27:55 alpha systemd[1]: Stopped nginx.service - A high performance web server and a reverse proxy server.
May 24 06:27:55 alpha systemd[1]: nginx.service: Consumed 6.168s CPU time, 21.6M memory peak, 0B memory swap peak.
May 24 06:27:55 alpha systemd[1]: Starting nginx.service - A high performance web server and a reverse proxy server...
May 24 06:27:55 alpha systemd[1]: Stopping systemd-
May 24 06:27:55 alpha systemd[1]: systemd-
May 24 06:27:55 alpha systemd[1]: Stopped systemd-
May 24 06:27:55 alpha systemd[1]: systemd-
May 24 06:27:55 alpha systemd[1]: systemd-
May 24 06:27:55 alpha systemd[1]: Stopped systemd-
May 24 06:27:55 alpha systemd[1]: systemd-
May 24 06:27:55 alpha systemd[1]: systemd-
May 24 06:27:55 alpha systemd[1]: Stopped systemd-
May 24 06:27:55 alpha systemd[1]: systemd-
May 24 06:27:55 alpha systemd[1]: Starting systemd-
May 24 06:27:55 alpha systemd[1]: Starting systemd-
May 24 06:27:55 alpha systemd-
May 24 06:27:55 alpha systemd[1]: Starting systemd-
May 24 06:27:55 alpha systemd[1]: Started ssh.service - OpenBSD Secure Shell server.
May 24 06:27:55 alpha systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
May 24 06:27:55 alpha systemd[1]: nginx.service: Failed with result 'exit-code'.
May 24 06:27:55 alpha systemd-
May 24 06:27:55 alpha systemd-
May 24 06:27:55 alpha systemd[1]: Failed to start nginx.service - A high performance web server and a reverse proxy server.
May 24 06:27:54 alpha systemd-
May 24 06:27:54 alpha named[186157]: received control channel command 'stop'
May 24 06:27:54 alpha named[186157]: no longer listening on 127.0.0.1#53
May 24 06:27:55 alpha nginx[224476]: nginx: [emerg] bind() to [2603:c020:
May 24 06:27:55 alpha nginx[224476]: nginx: configuration file /etc/nginx/
Contents of unattended-upgrades log, to confirm unattended-upgrades initiated the updates:
2024-05-24 06:27:37,661 INFO Starting unattended upgrades script a=noble- security, o=UbuntuESMApps ,a=noble- apps-security, o=UbuntuESM, a=noble- infra-security, o=Ubuntu, a=noble- updates, o=Ubuntu, a=noble- proposed, o=Ubuntu, a=noble- backports unattended- upgrades/ unattended- upgrades- dpkg.log
2024-05-24 06:27:37,662 INFO Allowed origins are: o=Ubuntu,a=noble, o=Ubuntu,
2024-05-24 06:27:37,662 INFO Initial blacklist:
2024-05-24 06:27:37,662 INFO Initial whitelist (not strict):
2024-05-24 06:27:40,144 INFO Packages that will be upgraded: klibc-utils libklibc libssl3t64 openssl
2024-05-24 06:27:40,144 INFO Writing dpkg log to /var/log/
2024-05-24 06:27:57,367 INFO All upgrades installed