# HG changeset patch # User Matthias Förste foerste@schlittermann.de # Date 1336050887 -7200 # Node ID bba8b3344c26dbf17388ffaa5dc99a656b5c4661 # Parent 43a7c833a2bf54980f5d6f091f7a5057984fc12c fixed accicendal pidfile removal diff -r 43a7c833a2bf -r bba8b3344c26 debian/changelog --- a/debian/changelog Thu May 03 14:53:46 2012 +0200 +++ b/debian/changelog Thu May 03 15:14:47 2012 +0200 @@ -2,4 +2,4 @@ * Initial Release. - -- Matthias Förste Mon, 30 Apr 2012 12:11:44 +0200 + -- Matthias Förste Thu, 03 May 2012 15:10:30 +0200 diff -r 43a7c833a2bf -r bba8b3344c26 wgnd-watch.pl --- a/wgnd-watch.pl Thu May 03 14:53:46 2012 +0200 +++ b/wgnd-watch.pl Thu May 03 15:14:47 2012 +0200 @@ -34,6 +34,8 @@ use Linux::Inotify2; use Sys::Syslog; +my $master; + BEGIN { openlog($ME, 'ndelay,nowait,pid', 'LOG_USER'); @@ -101,6 +103,7 @@ or die "Can't open '>', '$opts{pidfile}': $!\n"; print P $$; close P; + $master = $$; } @@ -143,7 +146,7 @@ END { - unlink $opts{pidfile} if $opts{daemon}; + unlink $opts{pidfile} if $opts{daemon} and defined $master and $master eq $$; dolog "exit"; closelog;