svn commit: r230869 - head/usr.sbin/daemon
Mikolaj Golub
trociny at freebsd.org
Sun Feb 12 19:07:03 UTC 2012
On Sat, 11 Feb 2012 16:16:16 +0400 Andrey Zonov wrote:
AZ> On 11.02.2012 14:35, Mikolaj Golub wrote:
>>
>> Thank you. Here are the patches I would like to commit if there are no
>> objections or other suggestions:
>>
>> http://people.freebsd.org/~trociny/daemon/daemon.spawn.1.patch
>> http://people.freebsd.org/~trociny/daemon/daemon.SIGTERM.1.patch
>> http://people.freebsd.org/~trociny/daemon/daemon.restart.1.patch
The restart patch has been updated: the variable initialization was lost when
separting the patches.
http://people.freebsd.org/~trociny/daemon/daemon.restart.2.patch
>>
AZ> There are two more suggestions, if you don't mind.
AZ> Use madvise(MADV_PROTECT). It would be useful because of the
AZ> daemon(8) should not leak or eats much memory.
I also thought about this and it looks like a good idea for me too.
http://people.freebsd.org/~trociny/daemon/daemon.madvise.1.patch
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.
--
Mikolaj Golub
More information about the svn-src-head
mailing list