2

In Ubuntu cloud server images, apt update/upgrade is performed very aggressively, from different services, which causes the typical locking issue.

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.
  • 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 at 13:21
  • 1
    Does this answer your question? How to stop apt from doing anything – N0rbert Feb 14 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 yesterday
  • @Rinzwind thanks! updated the question. – Marcus 5 hours ago
  • the 3rd and 4th line look like the services you need to halt(?) – Rinzwind 4 hours ago

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.