4

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,643

0 Answers0