<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection">
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">Sorry. I've lost the thread here, what is the "it" you refer to?</blockquote>
<div dir="auto">I’m not an linux expert so you’ll have to bear with me, but I guess the it I was referring to whatever NUT is using since what we’re editing is a config file, not a script; it doesn’t have a shebang at the top.<br />
<br /></div>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">If you run the command</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;"><br /></blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">grep nut /etc/password</blockquote>
<div dir="auto">I got:  grep: /etc/password: No such file or directory<br />
<br /></div>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">can be seen on</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">a Debian box with the command</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;"><br /></blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">ls -alF /bin/sh</blockquote>
<div dir="auto">I got:  lrwxrwxrwx 1 root root 4 Apr 23 11:02 /bin/sh -> dash*<br />
<br />
<br />
Also I did "echo $SHELL" in a terminal window and got "/bin/bash”.  So what I found earlier is true; Bash is used in the Terminal app and Dash is used for scripts.<br />
<br />
So anyway, I guess that means that it is using Dash then, correct?  <br />
<br />
Ok, so I copied the getUPSstatus function in .profile as well.  So it has been added to both .bashrc and .profile and I have added...<br />
<br />
SHUTDOWNCMD "getUPSstatus ups@192.168.1.70 ; logger -t upsmon.conf \"UPS status is $UPSstatus\" ; /sbin/shutdown -h +0"<br />
<br />
…to my upsmon.conf.  So I think I should be go to go for the next time this happens; should get some more information as to what is going on.  <br />
<br />
Also, I was thinking about your suggestion, Manuel, to use Wireshark as well.  You mentioned,<br /></div>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">My first suspect is the Synology version of nut. More specifically, I suspect that nut triggers a shutdown immediately after the switch to "on battery" state and only cancels it after a restart.</blockquote>
<div dir="auto">That may seem to be the case, however, whenever I test by manually pulling the power, the servers stay up and all appears normal.  It has happened three times now where I am away and the power goes out for 3-5 seconds and the servers shutdown and will stay down, even if I try to power back on, until I restart the Synology NAS.<br />
<br />
Thanks for both your guys’ help with everything so far…. I really appreciate it.<br />
<br />
Todd</div>
</div>
<div name="messageSignatureSection"><br />
<p style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue"; color: rgb(34, 34, 34);">--</p>
<p style="margin: 0px; font-stretch: normal; line-height: normal; font-family: "Helvetica Neue"; color: rgb(51, 51, 51);"><span style="color: #222222"><b>Todd Benivegna</b></span> <span style="color: #222222">//</span> <a href="mailto:todd@benivegna.com">todd@benivegna.com</a></p>
</div>
<div name="messageReplySection">On Aug 4, 2020, 2:38 PM -0400, Roger Price <roger@rogerprice.org>, wrote:<br />
<blockquote type="cite" style="border-left-color: grey; border-left-width: thin; border-left-style: solid; margin: 5px 5px;padding-left: 10px;">On Tue, 4 Aug 2020, Todd Benivegna wrote:<br />
<br />
<blockquote type="cite">Right, but I don't know what NUT script is actually calling it.  I don't know how else I would check.<br /></blockquote>
<br />
Sorry. I've lost the thread here, what is the "it" you refer to?<br />
<br />
If you run the command<br />
<br />
grep nut /etc/password<br />
<br />
you will probably receive a reply similar to<br />
<br />
nut:x:121:126::/var/lib/nut:/bin/false<br />
<br />
The /bin/false implies that user nut uses the default shell which can be seen on<br />
a Debian box with the command<br />
<br />
ls -alF /bin/sh<br />
lrwxrwxrwx 1 root root 4 Jan 24 2017 /bin/sh -> dash*<br />
<br />
This says that Dash is the default for the command line and for scripts. As<br />
Manuel has said this can be changed with the first line of a script, e.g.<br />
<br />
#!/bin/bash<br />
<br />
says that this script uses Bash.<br />
<br />
Roger<br />
_______________________________________________<br />
Nut-upsuser mailing list<br />
Nut-upsuser@alioth-lists.debian.net<br />
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser</blockquote>
</div>
</body>
</html>