Here's a script for removing a stale PID file. It is my first real world perl script. This also happens to be my first blog this year, following the renaming of this blog from locait.blogspot.com. I had to create this script when apacheds refused to start due to a stale PID file.
#!/usr/bin/perl
# perl script to remove state pid file
# adapted from example at http://search.cpan.org/~cwest/File-Pid-1.01/lib/File/Pid.pm
# it expects the pid file as the sole argument
use File::Pid;
if ($#ARGV < 0) {
die "Expects the path to the pid file but received $#ARGV args";
}
my $pidfile = File::Pid->new({
file => "$ARGV[0]",
});
if (! $pidfile->running ) {
$pidfile->remove;
}
Many thanks for the helpful information.
I placed the secrets file in ~/.davfs2/secrets and added an entry to /etc/fstab and it worked well.
Being on a 64bit system, I needed to install the 32 bit version of libneon27 for davfs2 to work.