Ubuntu: Fixing the myserious “Failed to stop apt-daily.timer: Connection timed out”
Posted by jpluimers on 2018/05/14
Ubuntu is the only Linux system I had that – after installing a text-mode console setup – gets itself in the below state with only running apt update and apt-get upgrade.
Preparing to unpack .../archives/apt_1.2.19_armhf.deb ... Failed to stop apt-daily.timer: Connection timed out See system logs and 'systemctl status apt-daily.timer' for details. Failed to get load state of apt-daily.timer: Connection timed out dpkg: warning: subprocess old pre-removal script returned error exit status 1
I could not find meaningful search results for the above thing, nor did systemctl status apt-daily.timer return anything better than
Failed to get properties: Failed to activate service 'org.freedesktop.systemd1': timed out
Heck, it doesn’t even reboot any more (no helpful search results either):
# reboot Failed to start reboot.target: Failed to activate service 'org.freedesktop.systemd1': timed out See system logs and 'systemctl status reboot.target' for details. Failed to open /dev/initctl: No such device or address Failed to talk to init daemon.
Nor did systemctl status reboot.target return anything better than
Failed to get properties: Failed to activate service 'org.freedesktop.systemd1': timed out
From the ubuntu-16.04-minimal-odroid-c1-20160817.img.xz base system, it only had these extra packages installed:
etckeepertmuxspeedtest-clisendemail
Workaround found, but still unsure why this happened in the first place
Despite the workaround below, I still don’t know why I got into this situation and this leaves me with a very uncomfortable feeling.
Too bad some systems (like ODroid) only have Ubuntu based distributions as sorting out stuff like above took me way too much effort.
Workaround
So I went digging, especially since both error messages are the same:
Failed to get properties: Failed to activate service 'org.freedesktop.systemd1': timed out
No freedesktop service was installed nor running:
# service --status-all [ - ] bootmisc.sh [ - ] checkfs.sh [ - ] checkroot-bootclean.sh [ - ] checkroot.sh [ - ] console-setup [ - ] cron [ - ] dbus [ - ] hostname.sh [ - ] hwclock.sh [ - ] keyboard-setup [ - ] killprocs [ - ] kmod [ - ] mountall-bootclean.sh [ - ] mountall.sh [ - ] mountdevsubfs.sh [ - ] mountkernfs.sh [ - ] mountnfs-bootclean.sh [ - ] mountnfs.sh [ - ] networking [ - ] ondemand [ - ] postfix [ - ] procps [ - ] rc.local [ - ] resolvconf [ - ] rsync [ - ] rsyslog [ - ] sendsigs [ - ] ssh [ - ] udev [ - ] umountfs [ - ] umountnfs.sh [ - ] umountroot [ - ] unattended-upgrades [ - ] urandom
However, there was some freedesktop though I never asked for it, as a simple find / | grep freedesktop shows:
/lib/systemd/system/dbus-org.freedesktop.locale1.service
/lib/systemd/system/dbus-org.freedesktop.hostname1.service
/lib/systemd/system/dbus-org.freedesktop.login1.service
/lib/systemd/system/dbus-org.freedesktop.network1.service
/lib/systemd/system/dbus-org.freedesktop.resolve1.service
/lib/systemd/system/dbus-org.freedesktop.timedate1.service
/usr/share/mime/packages/freedesktop.org.xml
/usr/share/dbus-1/services/org.freedesktop.systemd1.service
/usr/share/dbus-1/system-services/org.freedesktop.network1.service
/usr/share/dbus-1/system-services/org.freedesktop.hostname1.service
/usr/share/dbus-1/system-services/org.freedesktop.login1.service
/usr/share/dbus-1/system-services/org.freedesktop.systemd1.service
/usr/share/dbus-1/system-services/org.freedesktop.resolve1.service
/usr/share/dbus-1/system-services/org.freedesktop.locale1.service
/usr/share/dbus-1/system-services/org.freedesktop.timedate1.service
/usr/share/polkit-1/actions/org.freedesktop.login1.policy
/usr/share/polkit-1/actions/org.freedesktop.locale1.policy
/usr/share/polkit-1/actions/org.freedesktop.timedate1.policy
/usr/share/polkit-1/actions/org.freedesktop.systemd1.policy
/usr/share/polkit-1/actions/org.freedesktop.hostname1.policy
/etc/dbus-1/system.d/org.freedesktop.locale1.conf
/etc/dbus-1/system.d/org.freedesktop.login1.conf
/etc/dbus-1/system.d/org.freedesktop.timedate1.conf
/etc/dbus-1/system.d/org.freedesktop.network1.conf
/etc/dbus-1/system.d/org.freedesktop.resolve1.conf
/etc/dbus-1/system.d/org.freedesktop.hostname1.conf
/etc/dbus-1/system.d/org.freedesktop.systemd1.conf
The org.freedesktop.systemd1.conf is there from the beginning of the etckeeper history and exactly matches https://github.com/systemd/systemd/blob/master/src/timedate/org.freedesktop.systemd1.conf.
I finally went to more drastic measures:
# systemctl reboot --force
Failed to execute operation: Failed to activate service 'org.freedesktop.systemd1': timed out
# systemctl reboot --force --force
Rebooting.
This worked as per [WayBack] systemctl:
-f, --forceWhen used with enable, overwrite any existing conflicting symlinks.
When used with edit, create all of the specified units which do not already exist.
When used with halt, poweroff, reboot or kexec, execute the selected operation without shutting down all units. However, all processes will be killed forcibly and all file systems are unmounted or remounted read-only. This is hence a drastic but relatively safe option to request an immediate reboot. If
--forceis specified twice for these operations (with the exception of kexec), they will be executed immediately, without terminating any processes or unmounting any file systems.Warning: specifying
--forcetwice with any of these operations might result in data loss. Note that when--forceis specified twice the selected operation is executed by systemctl itself, and the system manager is not contacted. This means the command should succeed even when the system manager hangs or crashed.
Now I could apt-get update/upgrade, but after that, a reboot dumped core:
# reboot Broadcast message from systemd-journald@odroidC1 (Sat 2017-03-04 21:32:05 UTC): "odroidC1" 21:31 04-Mar-17 systemd[1]: Caught , dumped core as pid 11600. Broadcast message from systemd-journald@odroidC1 (Sat 2017-03-04 21:32:05 UTC): systemd[1]: Freezing execution. Broadcast message from systemd-journald@odroidC1 (Sat 2017-03-04 21:32:05 UTC): systemd[1]: Caught , dumped core as pid 11600. Warning! D-Bus connection terminated. Failed to wait for response: Connection reset by peer Failed to open /dev/initctl: No such device or address Failed to talk to init daemon. Broadcast message from systemd-journald@odroidC1 (Sat 2017-03-04 21:32:05 UTC): systemd[1]: Freezing execution. root@odroidC1:~# reboot Failed to start reboot.target: Failed to activate service 'org.freedesktop.systemd1': timed out See system logs and 'systemctl status reboot.target' for details. Failed to open /dev/initctl: No such device or address Failed to talk to init daemon. root@odroidC1:~# systemctl reboot --force --forpacket_write_wait: Connection to 192.168.71.20 port 22: Broken pipe
–jeroen
Not many installed packages:
https://gist.github.com/jpluimers/edba8823d4a72047386a7fead140a168






S G said
Were you able to fix this?
jpluimers said
Nope. I gave up.