Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Feb 2012 21:06:55 +0200
From:      Mikolaj Golub <trociny@freebsd.org>
To:        Andrey Zonov <andrey@zonov.org>
Cc:        svn-src-head@FreeBSD.org, Guy Helmer <ghelmer@palisadesystems.com>, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Pawel Jakub Dawidek <pjd@FreeBSD.org>
Subject:   Re: svn commit: r230869 - head/usr.sbin/daemon
Message-ID:  <861upz6fcg.fsf@kopusha.home.net>
In-Reply-To: <4F365C10.5050607@zonov.org> (Andrey Zonov's message of "Sat, 11 Feb 2012 16:16:16 %2B0400")
References:  <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> <20120206082706.GA1324@garage.freebsd.pl> <86wr7zmy8f.fsf@kopusha.home.net> <20120206221742.GA1336@garage.freebsd.pl> <86liodu3me.fsf@in138.ua3> <20120208090600.GA1308@garage.freebsd.pl> <86sjihsln4.fsf@kopusha.home.net> <4F365C10.5050607@zonov.org>

next in thread | previous in thread | raw e-mail | index | archive | help

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?861upz6fcg.fsf>