On Jun 9, 2017, at 1:58 PM, Robbie van der Walle <rvanderwalle at gmail.com> wrote:> > What I wonder if the shutdown is done proper. Does the shutdown command use umount to prevent disk corruption?Yes, it prevents filesystem corruption, but I am not sure if it bothers to save the desktop state. You can check the "last" logs to see if it was cleanly shut down: $ last shutdown reboot reboot ~ Sun May 21 19:04 shutdown ~ Sun May 21 19:03 ... If you see a "reboot" without a corresponding "shutdown" before it, the system did not shut down properly.> 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 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> and also still open is the notification on the Mac.I used to have a script that would send UDP notifications to Growl, but that was before OS X notifications made Growl mostly obsolete. I can dig that up if it is of interest.
>> What I wonder if the shutdown is done proper. Does the shutdown command use umount to prevent disk corruption? > > Yes, it prevents filesystem corruption, but I am not sure if it bothers to save the desktop state. > > You can check the "last" logs to see if it was cleanly shut down: > > $ last shutdown reboot > reboot ~ Sun May 21 19:04 > shutdown ~ Sun May 21 19:03 > ... > > If you see a "reboot" without a corresponding "shutdown" before it, the system did not shut down properly.reboot ~ Sun Jun 11 12:40 ttys002 Sun Jun 11 12:21 - crash (00:18) ttys001 Sun Jun 11 12:21 - crash (00:18) ttys000 Sun Jun 11 12:21 - crash (00:18) I see only a reboot. Not a shutdown. But is this normal because shutdown -u -h +0 is used?>> I also have to find a solution for starting up upsmon when the Mac starts > > I never finished the integration for this branch, but... > > 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 will look in to it.> >> and also still open is the notification on the Mac. > > I used to have a script that would send UDP notifications to Growl, but that was before OS X notifications made Growl mostly obsolete. I can dig that up if it is of interest.No thanks, I can use osascript to notify. Kind Regards, Rob -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20170611/d21ed3d8/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/20170611/d21ed3d8/attachment.bin>
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!