<div dir="ltr"><div><div><div>Some precisions:<br><br></div>we are not alone, some projects had similar problem: <a href="http://bugs.bitlbee.org/bitlbee/ticket/785">http://bugs.bitlbee.org/bitlbee/ticket/785</a><br></div>And the problem is really coming from NSS initialization. Discussion about the issue here : <a href="http://osdir.com/ml/mozilla.crypto/2002-08/msg00016.html">http://osdir.com/ml/mozilla.crypto/2002-08/msg00016.html</a><br><br></div><div>There is a workaround to use NSS with fork but it is more setting a flag to share some resources (primarily sockets) but must (re)initialize NSS library on all children.<br><br></div><div>AFAIK why we initialize NSS library before becoming user and forking is to be able to access and read certificates and keys which is readable only by root and should not be readable in userland. This behavior is this because it was the behavior used when using OpenSSL. Modifying this behavior implies to modify key/certificate storage and acces right policy.<br></div><div><div><br></div><div>Emilien<br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-03-20 15:12 GMT+01:00 Emilien Kia <span dir="ltr"><<a href="mailto:kiae.dev@gmail.com" target="_blank">kiae.dev@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Hello all,<br><br></div>With a really fast lookup, I think it is probably a problem of NSS initialization (key loading...) .<br></div>As the problem occurs only when upsd is forked and as nss is initialized (<a href="https://github.com/networkupstools/nut/blob/master/server/upsd.c#L1008)before" target="_blank">https://github.com/networkupstools/nut/blob/master/server/upsd.c#L1008)before</a> upsd deamonify (<a href="https://github.com/networkupstools/nut/blob/master/server/upsd.c#L1035" target="_blank">https://github.com/networkupstools/nut/blob/master/server/upsd.c#L1035</a>), I suspect NSS to not be fork-safe.<br></div><br></div>I will intend to look more deeply.<br><div><br></div><div>Best regards,<br><br></div><div>Emilien<br></div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2015-03-13 13:30 GMT+01:00 Charles Lepple <span dir="ltr"><<a href="mailto:clepple@gmail.com" target="_blank">clepple@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>On Mar 12, 2015, at 11:55 PM, Melkor Lord <<a href="mailto:melkor.lord@gmail.com" target="_blank">melkor.lord@gmail.com</a>> wrote:<br>
<br>
><br>
> On Mon, Mar 2, 2015 at 2:39 AM, Charles Lepple <<a href="mailto:clepple@gmail.com" target="_blank">clepple@gmail.com</a>> wrote:<br>
><br>
> > I thought start-stop-daemon was involved because it closes stdin/stdout file<br>
> > descriptors after exec()'ing the daemon. I tried "--no-close" option to no<br>
> > avail. After that, I validated the init script working fine with<br>
> > UPSD_OPTIONS="-D" in /etc/nut/nut.conf.<br>
><br>
> Not strictly the same as closing the file descriptors, but I tried the<br>
> following:<br>
><br>
>   /sbin/upsd -D >/dev/null 2>&1 < /dev/null<br>
><br>
> And it still worked. So I need to recompile with debugging symbols -<br>
> the Ubuntu packages did not have them.<br>
><br>
> Sorry to bug you again with this issue but is there any improvement on the matter?<br>
<br>
</div></div>No, not yet.<br>
<br>
Recompiling with debugging symbols did not reveal anything new. We have reached out to the engineer who wrote the NSS code for NUT.<br>
<span><font color="#888888"><br>
--<br>
Charles Lepple<br>
clepple@gmail<br>
</font></span><div><div><br>
<br>
<br>
<br>
_______________________________________________<br>
Nut-upsuser mailing list<br>
<a href="mailto:Nut-upsuser@lists.alioth.debian.org" target="_blank">Nut-upsuser@lists.alioth.debian.org</a><br>
<a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>