Package: lockfile-progs
Version: 0.1.11
Severity: normal
Tags: patch

Hi,

The lock files never go stale (according to the manpage they should do
so after 5 minutes). Steps to reproduce:

$ lockfile-create --retry 0 test
$ # wait more than 5 minutes
$ lockfile-create --retry 0 test
lockfile creation failed

I'm not sure whether the problem is in liblockfile or lockfile-progs;
I'll leave that to the maintainer. 

Also, I think that the lock files should contain the PID of the parent
process and not "0". The attached patch fixes that (but doesn't solve
the problem).

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.21-2-k7 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages lockfile-progs depends on:
ii  libc6                         2.6.1-1+b1 GNU C Library: Shared libraries
ii  liblockfile1                  1.06.2     NFS-safe locking library, includes

lockfile-progs recommends no packages.

-- no debconf information
Only in lockfile-progs-0.1.11.fixed/: bin
Only in lockfile-progs-0.1.11.fixed/debian: files
Only in lockfile-progs-0.1.11.fixed/debian: stamp-build
Only in lockfile-progs-0.1.11.fixed/debian: substvars
Only in lockfile-progs-0.1.11.fixed/debian: tmp
Only in lockfile-progs-0.1.11.fixed/: lockfile-create
diff -ru lockfile-progs-0.1.11/lockfile-progs.c 
lockfile-progs-0.1.11.fixed/lockfile-progs.c
--- lockfile-progs-0.1.11/lockfile-progs.c      2007-08-25 02:21:18.000000000 
+0200
+++ lockfile-progs-0.1.11.fixed/lockfile-progs.c        2007-09-13 
03:01:57.000000000 +0200
@@ -221,7 +221,7 @@
   if(strcmp(action, "unlock") == 0) {
     result = lockfile_remove(lockfilename);
   } else if(strcmp(action, "lock") == 0) {
-    if(lockfile_create(lockfilename, retry_count, 0) == L_SUCCESS) {
+    if(lockfile_create(lockfilename, retry_count, L_PPID) == L_SUCCESS) {
       result = 0;
     } else {
       msg(stderr, "lockfile creation failed\n");
Only in lockfile-progs-0.1.11.fixed/: lockfile-progs.o
Only in lockfile-progs-0.1.11.fixed/: man

Reply via email to