Bug#754103: apt: support option to wait for lockfile
Package: apt
Version: 1.0.5
Severity: wishlist
apt-get immediately returns with an error if the lock file
(/var/lib/dpkg/lock) can't be locked.
It would be nice, if apt-get could provide an option for a timeout
option to retry locking the file before actually giving up; similar
to what reprepro(1) is providing with its --waitforlock's option:
,---- [ man 1 reprepro ]
| --waitforlock count
|
| If there is a lockfile indicating another
| instance of reprepro is currently using the
| database, retry count times after waiting for
| 10 seconds each time. The default is 0 and
| means to error out instantly.
`----
It's not uncommon in certain setups that a monitoring check executes
apt-get actions while another script (cron, config management,...)
tries to execute another apt-get action in parallel. Either of them
then sadly fails and causes unneeded overhead.
I'm aware that apt's Debug::NoLocking option is available, though it
would be much more preferable to have a consistent system state and
an option like "--waitforlock $COUNT" would be very useful for that
(maybe even with a sane default of a few seconds).
regards,
-mika-
Reply to: