#1074540 anacron: Anacron hangs on removal

Package:
anacron
Source:
anacron
Description:
cron-like program that doesn't go by time
Submitter:
Balbir Thomas
Date:
2025-06-09 14:23:03 UTC
Severity:
normal
#1074540#5
Date:
2024-06-30 14:20:53 UTC
From:
To:
Dear Maintainer,

I was experiencing long delays on shutdown of my laptop because
anacron was running a long running task with no time limit.
I found anacron was only installed because it was a dependency
of task-laptop. I removed task-laptop then I tried to remove
anacron using "apt remove --purge anacron" . However this
lead to a hang and the removal process never terminates, requiring
killall.

#1074540#10
Date:
2024-07-03 15:31:16 UTC
From:
To:
Other than task-laptop, logrotate also depends on anacron, so I would
not recommend removal. If you know which task is long running, you could
disable the task in "/etc/cron.*", "/etc/anacrontab", or "/etc/crontab".
I am not familiar with "apt remove --purge", so I have added the apt
team mailing list to help with debugging this issue. Any logs or other
information you could provide would also be be good to have.

#1074540#15
Date:
2025-06-09 12:21:16 UTC
From:
To:
I am appending this comment to bug 1074540 because I suspect they're
related.

A recent `apt-get --auto-remove dist-upgrade` in Debian Testing hung for
me at this line in the output:

Installing new version of config file /etc/cron.d/anacron ...

`pstree` showed this:

dpkg(2935259)─┬─anacron.postins(2935268)───deb-systemd-inv(2935625)───systemctl(2935633)───systemd-tty-ask(2935634)
               └─sh(2935263)───sh(2935264)───dpkg-status(2935265)

The `systemd-tty-ask` process command line was
`/usr/bin/systemd-tty-ask-password-agent --watch`. The `systemctl`
command line was `systemctl --quiet --system restart anacron.service
anacron.timer`. I tried killing the `systemd-tty-ask-password-agent`
process, but it refused to die, even with `kill -9`. I had to kill the
`systemctl --quiet --system restart anacron.service anacron.timer`
process to get the upgrade to continue.