On Thu, Oct 13, 2011 at 04:11:40PM +0200, Dag-Erling Smørgrav wrote:
Pawel Jakub Dawidek p...@freebsd.org writes:
I'm still in opinion that EWOULDBLOCK and EAGAIN (which is the same
value on FreeBSD) should be converted to EEXIST on pidfile_open()
return.
The historical (and documented)
Pawel Jakub Dawidek p...@freebsd.org writes:
After proposed changes it would look like this, what do you think?
http://people.freebsd.org/~pjd/patches/pidfile.3.patch
Looks OK to me, but you should also remove the paragraph about EAGAIN in
the man page.
DES
--
Dag-Erling Smørgrav -
I looked at some of the programs that use pidfile(3) in base, and they
pretty much all get it wrong. Consider these two scenarios:
1) common case
process A process B
main()
pidfile_open() - success
perform_initialization()
daemon()
On Thu, Oct 13, 2011 at 12:54:38PM +0200, Dag-Erling Smørgrav wrote:
I looked at some of the programs that use pidfile(3) in base, and they
pretty much all get it wrong. Consider these two scenarios:
1) common case
process A process B
main()
Pawel Jakub Dawidek p...@freebsd.org writes:
Dag-Erling Smørgrav d...@des.no writes:
How do we fix this? My suggestion is to loop until pidfile_open()
succeeds or errno != EAGAIN. Does anyone have any objections to that
approach?
I think we already do that internally in pidfile_open().
2011/10/13 Dag-Erling Smørgrav d...@des.no:
Pawel Jakub Dawidek p...@freebsd.org writes:
Dag-Erling Smørgrav d...@des.no writes:
How do we fix this? My suggestion is to loop until pidfile_open()
succeeds or errno != EAGAIN. Does anyone have any objections to that
approach?
I think we
After discussing this with pjd@ on IRC, I arrived at the attached patch,
which increases the length of time pidfile_open() itself waits (I hadn't
noticed that it already looped) and sets *pidptr to -1 if it fails to read
a pid.
DES
--
Dag-Erling Smørgrav - d...@des.no
Index:
On Thu, Oct 13, 2011 at 02:54:16PM +0200, Dag-Erling Smørgrav wrote:
After discussing this with pjd@ on IRC, I arrived at the attached patch,
which increases the length of time pidfile_open() itself waits (I hadn't
noticed that it already looped) and sets *pidptr to -1 if it fails to read
a
Pawel Jakub Dawidek p...@freebsd.org writes:
I'm still in opinion that EWOULDBLOCK and EAGAIN (which is the same
value on FreeBSD) should be converted to EEXIST on pidfile_open()
return.
The historical (and documented) behavior is to return EAGAIN.
Also if we now have for loop, why not to
Why not import daemontools? It's public domain these days. Pidfiles are a
hacky mess. UNIX already has a way to track processes which avoids all these
issues, with very little overhead.
Jos
___
freebsd-current@freebsd.org mailing list
10 matches
Mail list logo