svn commit: r230869 - head/usr.sbin/daemon

Jos Backus jos at catnook.com
Sun Feb 12 20:56:59 UTC 2012


On Sun, Feb 12, 2012 at 12:41 PM, Andrey Zonov <andrey at zonov.org> wrote:
> On 13.02.2012 0:02, Pawel Jakub Dawidek wrote:
>>
>> On Sun, Feb 12, 2012 at 09:06:55PM +0200, Mikolaj Golub wrote:
>>>
>>>  AZ>  Check return code from pidfile_write() function.  I saw many times
>>>  AZ>  when pid could not be written because of there is not enough free
>>>  AZ>  space (but file was created).  Unfortunately, I have no suggestions
>>>  AZ>  how to handle this properly.
>>>
>>> We could return with error in this case (for me this almost the same as
>>> if we
>>> don't create file at all). But if we check pidfile_write() status we
>>> should
>>> resign the pidfile_write() feature that allows to pass NULL pidfh and
>>> check if
>>> pidfile option is used. Something like in this patch:
>>>
>>> http://people.freebsd.org/~trociny/daemon/daemon.pidfile_write.1.patch
>>>
>>> Not sure I should commit this though.
>>
>>
>> Please don't. Even if you can't write the pidfile, you should run the
>> service. The same as for pidfile_open() failure as documented in
>> example. Feel free to warn about problem with writing to pidfile, but
>> don't treat it as critial error.
>
>
> The problem is the following you cannot stop such a service with standard
> rc.d script and empty pidfile.

Right. So why not add a Unix socket listener to daemon(8) so the rc.d
script can send commands over the socket instead of using the pidfile?
This is what supervise/svc let you do today.

I don't understand why this solution isn't obvious once you are
committed to running daemon(8) for each service anyway. And then you
don't need pidfiles because now you have a much better, standard
control interface (sending commands to daemon(8) and gathering
responses).

Jos

>>
>> We can also add such a warning to the example in the manual page.
>>
>
> --
> Andrey Zonov
>
> _______________________________________________
> svn-src-head at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/svn-src-head
> To unsubscribe, send any mail to "svn-src-head-unsubscribe at freebsd.org"



-- 
Jos Backus
jos at catnook.com


More information about the svn-src-head mailing list