3

In Ubuntu cloud server images, apt update/upgrade is performed from different services, causing locking issues.

How do I find out what is exactly invoking apt-daily?

A ps aux --forest doesn't tell what's the parent:

root      0000  0.0  0.0   0000   000 ?        Ss   00:00   0:00 /bin/sh /usr/lib/apt/apt.systemd.daily install
root      0000  0.0  0.0   0000  0000 ?        S    00:00   0:00  \_ /bin/sh /usr/lib/apt/apt.systemd.daily lock_is_held install
root      0000  0.0 00.0 000000 000000 ?       Sl   00:00   0:00      \_ /usr/bin/python3 /usr/bin/unattended-upgrade

In addition to the difficulty of tracking the parent/invoking process, what puzzles me is that this machine has all the seemingly relevant services disabled:

systemctl disable apt-daily-upgrade.timer
systemctl disable apt-daily.timer
systemctl disable cloud-init
systemctl disable cron
systemctl disable unattended-upgrades

I still get locking issues even rebooting.

How can I find out what's invoking apt-daily? I can change everything at my will for example, I can modify /usr/lib/apt/apt.systemd.daily to perform any operation.

Output of systemctl list-timers:

NEXT                         LEFT        LAST PASSED UNIT                         ACTIVATES
Tue 2020-02-18 11:38:11 UTC  11min left  n/a  n/a    motd-news.timer              motd-news.service
Tue 2020-02-18 11:41:34 UTC  14min left  n/a  n/a    systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
Wed 2020-02-19 01:08:41 UTC  13h left    n/a  n/a    apt-daily.timer              apt-daily.service
Wed 2020-02-19 06:13:55 UTC  18h left    n/a  n/a    apt-daily-upgrade.timer      apt-daily-upgrade.service
Mon 2020-02-24 00:00:00 UTC  5 days left n/a  n/a    fstrim.timer                 fstrim.service

5 timers listed.
Pass --all to see loaded but inactive timers, too.
Marcus
  • 2,475
  • I am missing systemctl list-timers in the question ;) That should show all timers for systemd. Maybe there is another one that needs to be stopped. – Rinzwind Feb 14 '20 at 13:21
  • 1
    Does this answer your question? How to stop apt from doing anything – N0rbert Feb 14 '20 at 18:34
  • @N0rbert thanks for the comment. while the questions are essentially about the same concept, that answer does not solve the problem, I suspect due to cloud-init, but not sure. For this reason, I've formulated this question as a more generic "how to find out", as opposed as "what's causing it. – Marcus Feb 17 '20 at 08:48
  • 1
    the 3rd and 4th line look like the services you need to halt(?) – Rinzwind Feb 18 '20 at 12:33
  • @Rinzwind those two are disabled as part of the sytemctl disable... commands. The issue persists also after a reboot, so it's not caused by them. – Marcus Feb 19 '20 at 08:41

0 Answers0