Add info about process locking /var/lib/dpkg/lock when having package reporting issues
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Landscape Client |
Confirmed
|
Wishlist
|
Unassigned | ||
dpkg (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
This is a feature request to add more information about which process is locking /var/lib/dpkg/lock instead of just saying "Could not get lock" when having package reporting issues.
The name and PID of the process and possibly its parent processes would give users more information as to what was using the lock.
Here is an example of the kind of additional information that would help the user find out what was locking apt:
# lsof /var/lib/dpkg/lock
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
apt-get 15935 root 4uW REG 0,47 0 87 /var/lib/dpkg/lock
# ps -f --pid 15935
UID PID PPID C STIME TTY TIME CMD
root 15935 1843 0 14:20 ? 00:00:00 apt-get upgrade
# ps -f --pid 1843
UID PID PPID C STIME TTY TIME CMD
root 1843 0 0 Jan23 ? 00:00:00 bash
Right now, when clicking on the alert "1 computer is having issues reporting packages" for this lock issue, the Exit Code is 100 and the Error output is:
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
In one scenario, a user had https:/
Reproducer:
Issue can be reproduced by leaving an apt-get process at the Yes/No prompt on a computer:
# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
libgssapi-krb5-2 libk5crypto3 libkrb5-3 libkrb5support0
4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 486 kB of archives.
After this operation, 1024 B of additional disk space will be used.
Do you want to continue? [Y/n]
information type: | Proprietary → Public |
affects: | landscape → landscape-client |
Changed in landscape-client: | |
status: | New → Confirmed |
Changed in landscape-client: | |
importance: | Undecided → Wishlist |