Skip Menu |

This queue is for tickets about the Proc-Pidfile CPAN distribution.

Report information
The Basics
Id: 67589
Status: resolved
Priority: 0/
Queue: Proc-Pidfile

People
Owner: NEILB [...] cpan.org
Requestors: john [...] eventful.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.03



Subject: fails when disk is read only
Date: Tue, 19 Apr 2011 10:24:21 -0700
To: bug-Proc-Pidfile [...] rt.cpan.org
From: John Tantalo <john [...] eventful.com>
I ran into a problem where multiple processes were running simultaneously which were all using the same pidfile. I observed that the pidfile existed but it was empty. This contradicted my expectation that the pidfile should contain the pid of one of the running processes. I discovered that the disk which contained /tmp was read only. I concluded that Proc::Pidfile failed because the pidfile did not contain a pid. The expectation of Proc::Pidfile is that it should never allow two processes with the same pidfile to run simultaneously. Therefore, I expect that Proc::Pidfile should immediately exit if the disk is read only, ie., if the pid file cannot be written. I believe the issue is in this block: Show quoted text
> $self->_verbose( "no pidfile $pidfile\n" ); > open( PID, ">$pidfile" ) or die "Can't write to $pidfile\n"; > flock( PID, LOCK_EX ); > print PID "$$\n"; > flock( PID, LOCK_UN ); > close( PID ); > $self->_verbose( "pidfile $pidfile created\n" );
You should check the return value of print() and close() to verify that the file was written as expected. My system details: perl v5.8.8 Proc::Pidfile v1.004 i386 GNU/Linux
I don't have a read-only disk, but I've made it check all the I/O operations related to the pid file. Thanks for the report - fixed in 1.03 Neil