diff options
author | kib <kib@FreeBSD.org> | 2007-10-12 10:38:05 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2007-10-12 10:38:05 +0000 |
commit | 6a0967dff6cbd8b9dfcc745c9c459c8c78529f99 (patch) | |
tree | d893a286d761307a588d2b5c946c7fe53cff1c76 /lib/libutil/pidfile.3 | |
parent | 85b25716404c150d0f292db0bda855948181eb55 (diff) | |
download | FreeBSD-src-6a0967dff6cbd8b9dfcc745c9c459c8c78529f99.zip FreeBSD-src-6a0967dff6cbd8b9dfcc745c9c459c8c78529f99.tar.gz |
When pidfile is already locked and has zero length, do not return
success and zero pid from pidfile_read(). Return EAGAIN instead. Sleep
up to three times for 5 ms while waiting for pidfile to be written.
mount(8) does the kill(mountpid, SIGHUP). If mountd pidfile is truncated,
that would result in the SIGHUP delivered to the mount' process group
instead of the mountd.
Found and analyzed by: Peter Holm
Tested by: Peter Holm, kris
Reviewed by: pjd
MFC after: 1 week
Diffstat (limited to 'lib/libutil/pidfile.3')
-rw-r--r-- | lib/libutil/pidfile.3 | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libutil/pidfile.3 b/lib/libutil/pidfile.3 index 64f77b0..3eaa7cf 100644 --- a/lib/libutil/pidfile.3 +++ b/lib/libutil/pidfile.3 @@ -168,6 +168,10 @@ Specified pidfile's name is too long. .It Bq Er EINVAL Some process already holds the lock on the given pidfile, but PID read from there is invalid. +.It Bq Er EAGAIN +Some process already holds the lock on the given pidfile, but the file +is truncated. Most likely, the existing daemon is writing new PID into +the file. .El .Pp The |