Reputation: 14353
PERL PROC Module running function never get exited - it keep running infinitely
#!/usr/bin/perl -w
use Proc::PID::File;
my %g_args = ( name => "temp", verify => 1, dir => "/home/username/");
print "Hello , world";
print Proc::PID::File->running(%g_args);
exit(0);
Even on CTRL + C its not being killed.
Its not even throwing any exception - where am I wrong.
I'm very beginner for PERL lang.
Upvotes: 0
Views: 167
Reputation: 2320
File locking on NFS mounted disks is problematic, even at the best of times. Proc::PID::File seems designed to operate on local filesystems (at least my perusal of the code doesn't indicate that it's taking the special care required to handle remote systems). Hanging on NFS problems is unfortunately typical of some NFS related problems. You will not be able to easily kill the process.
Is there some reason that you need to use the home directory? If you only need synchronization for jobs running on a single machine, /tmp
should suffice. If you need to synchronize across multiple machines, then you should consider modules which are known to be more NFS safe, or use a client server model and avoid filesystems entirely. CPAN is full of solutions.
Upvotes: 2