Package: release.debian.org Severity: normal User: release.debian....@packages.debian.org Usertags: pu
Hi, I have backported the fix for #626752[1], which currently makes the --use-pid feature useless in stable. The fix has already been deployed in sid (version 0.1.16). Please see attached debdiff. ~Niels [1] lockfile-progs: lockfile-create --use-pid uses wrong pid
diff -Nru lockfile-progs-0.1.15/debian/changelog lockfile-progs-0.1.15+squeeze1/debian/changelog --- lockfile-progs-0.1.15/debian/changelog 2010-06-13 09:21:29.000000000 +0200 +++ lockfile-progs-0.1.15+squeeze1/debian/changelog 2012-06-02 13:17:42.000000000 +0200 @@ -1,3 +1,20 @@ +lockfile-progs (0.1.15+squeeze1) stable; urgency=low + + [ Niels Thykier ] + * Non-maintainer upload. + * Backport fix for #626752 + + [ Rob Browning ] + * Use L_PID rather than L_PPID when appropriate. In cases where + lockfile_create() and lockfile_check() were being called with L_PID, + use L_PPID to capture the parent's PID. Capturing the PID of the + lockfile-create or lockfile-check process made no sense. Thanks to + Zrin Žiborski <zrin+launch...@ziborski.net> for the report, Larry + Diegel for the patch, and Sebastian Siewior <sebast...@breakpoint.cc> + for the suggestion to update the documentation. (Closes: #626752) + + -- Niels Thykier <ni...@thykier.net> Sat, 02 Jun 2012 13:07:35 +0200 + lockfile-progs (0.1.15) unstable; urgency=low * Add missing debhelper Build-Depends. diff -Nru lockfile-progs-0.1.15/lockfile-progs.1 lockfile-progs-0.1.15+squeeze1/lockfile-progs.1 --- lockfile-progs-0.1.15/lockfile-progs.1 2010-06-12 19:02:33.000000000 +0200 +++ lockfile-progs-0.1.15+squeeze1/lockfile-progs.1 2012-06-02 13:07:13.000000000 +0200 @@ -81,11 +81,12 @@ .PP .\" --use-pid \fB\-p\fR, \fB\-\-use\-pid\fR .RS 4 -Write the current process id (PID) to the lockfile whenever a lockfile +Write the parent process id (PPID) to the lockfile whenever a lockfile is created, and use that pid when checking a lock's validity. See the \fBlockfile_create\fR(3) manpage for more information. This option -applies to \fBlockfile\-create\fR, \fBlockfile\-remove\fR, -\fBlockfile-touch\fR, and \fBlockfile-check\fR. +applies to \fBlockfile\-create\fR and \fBlockfile-check\fR. NOTE: +this option will not work correctly between machines sharing a +filesystem. .RE .PP .\" --oneshot \fB\-o\fR, \fB\-\-oneshot\fR diff -Nru lockfile-progs-0.1.15/lockfile-progs.c lockfile-progs-0.1.15+squeeze1/lockfile-progs.c --- lockfile-progs-0.1.15/lockfile-progs.c 2010-06-09 07:27:30.000000000 +0200 +++ lockfile-progs-0.1.15+squeeze1/lockfile-progs.c 2012-06-02 13:07:13.000000000 +0200 @@ -328,7 +328,7 @@ static int cmd_lock(const char *lockfilename, int retry_count) { - int rc = lockfile_create(lockfilename, retry_count, (use_pid ? L_PID : 0)); + int rc = lockfile_create(lockfilename, retry_count, (use_pid ? L_PPID : 0)); const char *rc_str = get_status_code_string(rc); if(rc != L_SUCCESS) @@ -363,7 +363,7 @@ static int cmd_check(const char *lockfilename) { - int rc = lockfile_check(lockfilename, (use_pid ? L_PID : 0)); + int rc = lockfile_check(lockfilename, (use_pid ? L_PPID : 0)); return rc; } diff -Nru lockfile-progs-0.1.15/Makefile lockfile-progs-0.1.15+squeeze1/Makefile --- lockfile-progs-0.1.15/Makefile 2009-06-21 19:01:51.000000000 +0200 +++ lockfile-progs-0.1.15+squeeze1/Makefile 2012-06-02 13:07:13.000000000 +0200 @@ -46,7 +46,7 @@ bin/lockfile-create --use-pid --lock-name check/file.lock bin/lockfile-touch --oneshot --lock-name check/file.lock # PID shouldn't be the same, so this should fail. - ! bin/lockfile-check --use-pid --lock-name check/file.lock + bin/lockfile-check --use-pid --lock-name check/file.lock bin/lockfile-remove --lock-name check/file.lock ! test -e check/file.lock