On Jun 11, 2017, at 7:15 AM, Robbie van der Walle <rvanderwalle at gmail.com> wrote:> > I see only a reboot. Not a shutdown. But is this normal because shutdown -u -h +0 is used? >To be honest, I haven't experimented much with this, but I saw a normal shutdown/reboot when I just tried this from the command line (10.12): reboot ~ Mon Jun 12 08:36 shutdown ~ Mon Jun 12 08:35 clepple ttys007 Sun Jun 4 21:52 - shutdown (7+10:43) However, the "-u" flag did not seem to keep the Mac running for long after the shutdown (certainly seemed shorter than five minutes). Maybe I can test this on another machine with the full NUT stack later. Thanks for posting the osascript example - that looks useful!
> To be honest, I haven't experimented much with this, but I saw a normal shutdown/reboot when I just tried this from the command line (10.12): > > reboot ~ Mon Jun 12 08:36 > shutdown ~ Mon Jun 12 08:35 > clepple ttys007 Sun Jun 4 21:52 - shutdown (7+10:43)> However, the "-u" flag did not seem to keep the Mac running for long after the shutdown (certainly seemed shorter than five minutes).I have the same result showing a shutdown and reboot running manually. Also the shutdown was shorter than five minutes.> I also have to find a solution for starting up upsmon when the Mac startsI never finished the integration for this branch, but... https://github.com/networkupstools/nut/compare/osx_launchd <https://github.com/networkupstools/nut/compare/osx_launchd> You can save off the Raw file, and replace @SBINDIR@ with /sw/sbin or whatever: https://github.com/networkupstools/nut/blob/161efce6c6fc32f205817ca71f8963af253cec59/scripts/launchd/org.networkupstools.upsmon.plist.in <https://github.com/networkupstools/nut/blob/161efce6c6fc32f205817ca71f8963af253cec59/scripts/launchd/org.networkupstools.upsmon.plist.in> I have made a file com.networkupstools.upsmon.plist. in /Library/LaunchDaemons and /Library/LauchAgents -rw-r--r-- 1 root wheel 708 Jun 14 14:59 com.networkupstools.upsmon.plist But I cannot load it with the command: $ sudo launchctl load /Library/LaunchAgents/com.networkupstools.upsmon.plist /Library/LaunchAgents/com.networkupstools.upsmon.plist: Invalid property list com.networkupstools.upsmon.plist: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <!-- Network UPS Tools (NUT): http://www.networkupstools.org --> <dict> <key>Label</key> <string>org.networkupstools.upsmon</string> <key>ProgramArguments</key> <array> <string>/sw/sbin/upsmon</string> <string>-D</string> <!-- "-D" keeps upsmon from going into the background --> </array> <key>RunAtLoad</key> <true/> <key>KeepAlive</key> <dict> <key>SuccessfulExit</key> <false/> <!-- Do not respawn at shutdown time --> <dict/> </dict> </plist> Kind Regards, Rob> On 12 Jun 2017, at 14:42, Charles Lepple <clepple at gmail.com> wrote: > > On Jun 11, 2017, at 7:15 AM, Robbie van der Walle <rvanderwalle at gmail.com> wrote: >> >> I see only a reboot. Not a shutdown. But is this normal because shutdown -u -h +0 is used? >> > To be honest, I haven't experimented much with this, but I saw a normal shutdown/reboot when I just tried this from the command line (10.12): > > reboot ~ Mon Jun 12 08:36 > shutdown ~ Mon Jun 12 08:35 > clepple ttys007 Sun Jun 4 21:52 - shutdown (7+10:43) > > However, the "-u" flag did not seem to keep the Mac running for long after the shutdown (certainly seemed shorter than five minutes). > > Maybe I can test this on another machine with the full NUT stack later. > > Thanks for posting the osascript example - that looks useful! > _______________________________________________ > Nut-upsuser mailing list > Nut-upsuser at lists.alioth.debian.org > http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20170614/425e90ae/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3583 bytes Desc: not available URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20170614/425e90ae/attachment-0001.bin>
On Jun 14, 2017, at 9:12 AM, Robbie van der Walle <rvanderwalle at gmail.com> wrote:> > But I cannot load it with the command: > > $ sudo launchctl load /Library/LaunchAgents/com.networkupstools.upsmon.plist > > /Library/LaunchAgents/com.networkupstools.upsmon.plist: Invalid property list >I will try to look into this later, but three quick things: 1) does the base filename need to match the Label key? com.network... vs org.network... 2) maybe it doesn't like the comments (between "<!--" and "-->")? 3) should only need to go in /Library/LaunchDaemons (LaunchAgents is to make it run at login, rather than system startup.) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20170614/082c702f/attachment-0001.html>
On Jun 14, 2017, at 1:54 PM, Robbie van der Walle <rvanderwalle at gmail.com> wrote:> > <?xml version="1.0" encoding="UTF-8"?> > <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd <http://www.apple.com/DTDs/PropertyList-1.0.dtd>"> > <plist version="1.0"> > <dict> > <key>Label</key> > <string>org.networkupstools.upsmon</string> > <key>RunAtLoad</key> > <true/> > <key>ProgramArguments</key> > <array> > <string>/sw/sbin/upsmon</string> > <string>-D</string> <!-- "-D" keeps upsmon from going into the background --> > </array> > <key>KeepAlive</key> > <true/> > <key>SuccessfulExit</key> > <false/> <!-- Do not respawn at shutdown time --> > </dict> > </plist> > > > sudo launchctl load /Library/LaunchDaemons/org.networkupstools.upsmon.plist > > Doesn?t return an error. But when I check of upsmon is running I don?t see it running.This works for me on 10.12.5. (There is a warning that SuccessfulExit is an "unknown key" from launchd.) $ sudo launchctl list|fgrep -v com.app PID Status Label ... 8981 0 org.networkupstools.upsmon ... Does anything for upsmon show up in system.log in Console.app? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20170615/6908f27b/attachment.html>
> sudo launchctl list|fgrep -v com.appreturns for me(10.12.5): PID Status Label - 78 org.networkupstools.upsmon system log: Jun 15 16:27:07 c01 com.apple.xpc.launchd[1] (org.networkupstools.upsmon): Service only ran for 0 seconds. Pushing respawn out by 10 seconds. Jun 15 16:27:17 c01 com.apple.xpc.launchd[1] (org.networkupstools.upsmon[4259]): Service could not initialize: 16F73: xpcproxy + 11769 [1505][34964CF1-9965-3B4D-ADC7-6FBC6669C56D]: 0x2 Did you change anything in the plist or used mine ? Kind Regards, Rob> On 15 Jun 2017, at 15:01, Charles Lepple <clepple at gmail.com> wrote: > > On Jun 14, 2017, at 1:54 PM, Robbie van der Walle <rvanderwalle at gmail.com <mailto:rvanderwalle at gmail.com>> wrote: >> >> <?xml version="1.0" encoding="UTF-8"?> >> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd <http://www.apple.com/DTDs/PropertyList-1.0.dtd>"> >> <plist version="1.0"> >> <dict> >> <key>Label</key> >> <string>org.networkupstools.upsmon</string> >> <key>RunAtLoad</key> >> <true/> >> <key>ProgramArguments</key> >> <array> >> <string>/sw/sbin/upsmon</string> >> <string>-D</string> <!-- "-D" keeps upsmon from going into the background --> >> </array> >> <key>KeepAlive</key> >> <true/> >> <key>SuccessfulExit</key> >> <false/> <!-- Do not respawn at shutdown time --> >> </dict> >> </plist> >> >> >> sudo launchctl load /Library/LaunchDaemons/org.networkupstools.upsmon.plist >> >> Doesn?t return an error. But when I check of upsmon is running I don?t see it running. > > This works for me on 10.12.5. (There is a warning that SuccessfulExit is an "unknown key" from launchd.) > > $ sudo launchctl list|fgrep -v com.app > PID Status Label > ... > 8981 0 org.networkupstools.upsmon > ... > > Does anything for upsmon show up in system.log in Console.app? > _______________________________________________ > Nut-upsuser mailing list > Nut-upsuser at lists.alioth.debian.org > http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20170615/7235687e/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3583 bytes Desc: not available URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20170615/7235687e/attachment.bin>