<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Mar 26, 2015 at 9:16 AM, Emilien Kia <span dir="ltr"><<a href="mailto:kiae.dev@gmail.com" target="_blank">kiae.dev@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br><div dir="ltr"><div><div class="h5"><br></div></div><div class="gmail_extra">After looking a bit deeply, we have another little problem. When we intend to start upsd with the init script (at least under debian-based distrib - tested on Linux Mint 17.1) when we have the NSS problem, the init script exit with the "[OK]" state even if the "real" deamon process does not run correctly.<br><br></div><div class="gmail_extra">Perhaps we could add some tests to validate if the deamonization is OK. But it is a little bit out of my competencies (I am not a bash and linux-init-process expert).<span class=""><font color="#888888"><br></font></span></div><span class=""></span></div></blockquote></div><br></div><div class="gmail_extra">I'm running Ubuntu Server 14.04 in all the servers I maintain and also use NUT. The process is started with the following command in /etc/init.d/nut-server:<br><br></div><div class="gmail_extra">start-stop-daemon -S -p $upsd_pid -x $upsd \<br>  -- $UPSD_OPTIONS >/dev/null 2>&1 &&<br>  log_progress_msg "upsd" || log_progress_msg "(upsd failed)"<br><br></div><div class="gmail_extra">and obviously, a backslash is missing on the second line! (line 83 on the real script) So even if it fails, the next command (log_process_msg) will always start as if the previous command returned 0 (OK). This script always write "upsd" after starting instead of the right text, depending on the correct execution of $upsd!<br><br><br></div><div class="gmail_extra">In normal conditions, this construction shouldn't work. Try "ping localhost &&" for example and any shell would wait for more data before executing the line.<br><br></div><div class="gmail_extra">But these lines are in a function which is called inside a switch/case construct and by some nesting effect and redirection to /dev/null, it works with the missing backslash and nothing is printed out!<br></div><div class="gmail_extra"><br clear="all"><br>-- <br><div class="gmail_signature">Unix _IS_ user friendly, it's just selective about who its friends are.</div>
</div></div>