If the argument provided to pidfile(3) contains a '/', then the value is
considered to be an absolute/relative path and the pid file is created
in the given location.
Otherwise, pidfile(3) behaves as before and treats the provided value as
a basename to construct a pid file in /var/run/<basename>.pid. This means
that to create a pid file named "foo.pid" in the current directory, one
must specify "./foo.pid".
isn't the process who created it.
- If a new basename is supplied remove the an old pidfile if it was created
by this process and create a new one as suggested by Jason Thorpe.
This fixes PR lib/13357 by Greg A. Woods.