FS#55975 - Move /var/lib/pacman/db.lck to /run/pacman/db.lck

Attached to Project: Pacman
Opened by Hawky (p90) - Friday, 13 October 2017, 08:17 GMT
Last edited by Allan McRae (Allan) - Friday, 13 October 2017, 08:56 GMT
Task Type Feature Request
Category General
Status Closed
Assigned To No-one
Architecture All
Severity Very Low
Priority Normal
Reported Version 5.0.1
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

As /var/lib/pacman/db.lck is only useful to indicate that a pacman instance is running,
it should be deleted after a reboot.
Also, /run is much more in the spirit for this kind of file as it is for files which have meaning only for currently running programs.

Thanks in advance,
p90
This task depends upon

Closed by  Allan McRae (Allan)
Friday, 13 October 2017, 08:56 GMT
Reason for closing:  Not a bug
Additional comments about closing:  Interrupted pacman runs should leave a persistent file.
Comment by Christian Hesse (eworm) - Friday, 13 October 2017, 08:43 GMT
The intention is that a stale lock file indicates an aborted pacman run.
I do not think this will change.
Comment by Eli Schwartz (eschwartz) - Sunday, 15 October 2017, 02:03 GMT
Keeping that lock file after a reboot is incredibly useful, for instance to warn you when the computer crashed during an upgrade and all your upgraded packages are corrupted. In normal use, the lockfile should never be left behind, so if it is there then something *SERIOUSLY* wrong happened, and pacman should and does refuse to do anything whatsoever until after the user manually verifies the integrity of their filesystem.

Deleting that file after a reboot would delete the only warning users have, and therefore lead to many systems which were broken anyway but now would never get fixed.

tl;dr
The fact that it is not a temporary file is a core part of the entire pacman philosophy. It will never ever be changed.
Comment by Hawky (p90) - Saturday, 21 October 2017, 23:01 GMT
I get that this will not be reopened but I wanted to give some comments on the points made.

1. The lock file does not exist to to indicate an aborted pacman run. It exists to show that a pacman instance is running.
2. It is not useful no have the lock file after a reboot because all users are told to do in this case is to delete the lock file.
3. How is this a core part of the pacman philosophy? Why are people then told to just delete the lock file? This is literally what pacman tells you to do:

[foo@bar ~]$ pacman -Syu
:: Synchronizing package databases...
core is up to date
:: Starting full system upgrade...
resolving dependencies...
Terminated

[foo@bar ~]$ pacman -Syu
:: Synchronizing package databases...
error: failed to update core (unable to lock database)
error: could not lock database: File exists
if you're sure a package manager is not already
running, you can remove /var/lib/pacman/db.lck

So if there is any more to this file then to indicate a running pacman instance, you might want to tell the people writing pacman
because they apparently do not know about that.

Loading...