On Thu, Mar 26, 2015 at 9:16 AM, Emilien Kia <[email protected]> wrote:
> > > 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. > > 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). > 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: start-stop-daemon -S -p $upsd_pid -x $upsd \ -- $UPSD_OPTIONS >/dev/null 2>&1 && log_progress_msg "upsd" || log_progress_msg "(upsd failed)" 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! 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. 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! -- Unix _IS_ user friendly, it's just selective about who its friends are.
_______________________________________________ Nut-upsuser mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

