[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#8707) slapd: Add systemd service notification support

Ryan Tandy wrote:
> On Tue, Sep 12, 2017 at 08:24:15PM +0000, hyc@symas.com wrote:
>> I don't have documentation for sd_notify() on my machine
> https://www.freedesktop.org/software/systemd/man/sd_notify.html
>> - what does it return if systemd isn't running at the moment? What does it 
>> return if the current program wasn't started by systemd (and thus, the 
>> notification is irrelevant)?
> 0 in both of these cases (assuming there is not an unrelated NOTIFY_SOCKET env 
> var). However, it also says:
>> In order to support both service managers that implement this scheme and 
>> those which do not, it is generally recommended to ignore the return value 
>> of this call."
> and the current patch doesn't follow that recommendation, since it does check 
> the return value. I don't feel strongly either way about that.

OK. You realize how egregiously gross this kind of API design is? "Oh, yeah, 
we return a value, but properly written programs should ignore it."

Everything about this makes me nauseous.

   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/