Discussion:
[Apcupsd-users] apcupsd on Windows 10 NOT shutting down on TIMEOUT
Phil Reynolds
2016-11-01 17:10:13 UTC
Permalink
I have just tested my qemu-kvm machines' performance under power
failure conditions - no problems at all with BSDs, Debian testing or
even ReactOS, but I have one running Windows 10 64-bit, and it is not
shutting down on expiry of timeout.

I have set them all to shut down after 60 seconds of running on
battery. I have seen ONBATT and ONLINE popups from apcupsd, but the
system was still not shutting down even two minutes after the power
went down.

Unless it's simply failing in some way when calling psshutdown, I
cannot work out why it would be failing. How do I go about testing this
further/correcting it? (Is there some other command I could call to
shut down Windows 10?)
--
Phil Reynolds
mail: phil-***@tinsleyviaduct.com
Web: http://phil.tinsleyviaduct.com/
Phil Reynolds
2016-11-01 17:46:37 UTC
Permalink
On Tue, 1 Nov 2016 17:10:13 +0000
Post by Phil Reynolds
I have just tested my qemu-kvm machines' performance under power
failure conditions - no problems at all with BSDs, Debian testing or
even ReactOS, but I have one running Windows 10 64-bit, and it is not
shutting down on expiry of timeout.
I have set them all to shut down after 60 seconds of running on
battery. I have seen ONBATT and ONLINE popups from apcupsd, but the
system was still not shutting down even two minutes after the power
went down.
Unless it's simply failing in some way when calling psshutdown, I
cannot work out why it would be failing. How do I go about testing
this further/correcting it? (Is there some other command I could call
to shut down Windows 10?)
I think I know what's happening now, just not how to fix it. psshutdown
is an interactive service. I enabled these in the registry but it only
works when run as Administrator - no idea how to achieve that from
apccontrol.bat.
--
Phil Reynolds
mail: phil-***@tinsleyviaduct.com
Web: http://phil.tinsleyviaduct.com/
Phil Reynolds
2016-11-02 11:05:16 UTC
Permalink
On Tue, 1 Nov 2016 17:46:37 +0000
Post by Phil Reynolds
On Tue, 1 Nov 2016 17:10:13 +0000
Post by Phil Reynolds
I have just tested my qemu-kvm machines' performance under power
failure conditions - no problems at all with BSDs, Debian testing or
even ReactOS, but I have one running Windows 10 64-bit, and it is
not shutting down on expiry of timeout.
I have set them all to shut down after 60 seconds of running on
battery. I have seen ONBATT and ONLINE popups from apcupsd, but the
system was still not shutting down even two minutes after the power
went down.
Unless it's simply failing in some way when calling psshutdown, I
cannot work out why it would be failing. How do I go about testing
this further/correcting it? (Is there some other command I could
call to shut down Windows 10?)
I think I know what's happening now, just not how to fix it.
psshutdown is an interactive service. I enabled these in the registry
but it only works when run as Administrator - no idea how to achieve
that from apccontrol.bat.
Nor can I get the Windows "Shutdown.exe" to actually succeed in the same
circumstances... though that one does work when I run it.

Being a VM, I want it to power off rather than just halt.
--
Phil Reynolds
mail: phil-***@tinsleyviaduct.com
Web: http://phil.tinsleyviaduct.com/
Ted Mittelstaedt
2016-11-02 11:10:48 UTC
Permalink
psshutdown is not an interactive service. It has an interactive mode
maybe you are thinking of that?

https://technet.microsoft.com/en-us/sysinternals/bb897541

It's only real benefit over the regular shutdown command is that it
can take a userID and password on the command line so you can use it
to shut down remote windows boxes that have different userIDs
and passwords than what you are using to run the command.

If your shutdown is working when run as administrator but not as a
regular user then you need to adjust rights. You can use Local
Security Policy if this is a windows pro system:

http://www.sevenforums.com/tutorials/128920-shut-down-computer-allow-prevent-users-groups.html

If it is a Windows Home system than you need to run everything under an
administrative account. Frankly there's little point in running Windows
Home under a non-admin account.

If you must get it working on win home - you can TRY this powershell
solution:

First update to powershell 3 (needed for win 7, 10 probably has it):

https://www.microsoft.com/en-us/download/details.aspx?id=34595

Then download this:

https://gallery.technet.microsoft.com/scriptcenter/Grant-Revoke-Query-user-26e259b0

Use instructions are here:

http://superuser.com/questions/1107598/how-to-set-logon-user-rights-with-the-ntrights-exe-in-windows-1064-bit

And the privilege you want to grant is SeShutdownPrivilege.

Let us know if that works.

Ted
Post by Phil Reynolds
On Tue, 1 Nov 2016 17:10:13 +0000
Post by Phil Reynolds
I have just tested my qemu-kvm machines' performance under power
failure conditions - no problems at all with BSDs, Debian testing or
even ReactOS, but I have one running Windows 10 64-bit, and it is not
shutting down on expiry of timeout.
I have set them all to shut down after 60 seconds of running on
battery. I have seen ONBATT and ONLINE popups from apcupsd, but the
system was still not shutting down even two minutes after the power
went down.
Unless it's simply failing in some way when calling psshutdown, I
cannot work out why it would be failing. How do I go about testing
this further/correcting it? (Is there some other command I could call
to shut down Windows 10?)
I think I know what's happening now, just not how to fix it. psshutdown
is an interactive service. I enabled these in the registry but it only
works when run as Administrator - no idea how to achieve that from
apccontrol.bat.
Phil Reynolds
2016-11-02 12:05:36 UTC
Permalink
On Wed, 2 Nov 2016 04:10:48 -0700
Post by Ted Mittelstaedt
psshutdown is not an interactive service. It has an interactive mode
maybe you are thinking of that?
https://technet.microsoft.com/en-us/sysinternals/bb897541
I'm not thinking of any interactive modes. I am judging by what I've
heard elsewhere when people can't run psshutdown as themselves.
Post by Ted Mittelstaedt
If your shutdown is working when run as administrator but not as a
regular user then you need to adjust rights. You can use Local
psshutdown fails as regular user.
shutdown works as regular user.
There is no obvious effect when trying to call it via apccontrol.bat,
whichever is specified.

It is a Pro system.
Post by Ted Mittelstaedt
http://www.sevenforums.com/tutorials/128920-shut-down-computer-allow-prevent-users-groups.html
This has made psshutdown work as a regular user.

There is no change to the situation with apcupsd - I can't even prove
it's trying to call psshutdown. The same "nothing" occurs with
\apcupsd\bin\shutdown and \WINDOWS\System32\shutdown.
--
Phil Reynolds
mail: phil-***@tinsleyviaduct.com
Web: http://phil.tinsleyviaduct.com/
Phil Reynolds
2016-11-02 15:37:19 UTC
Permalink
On Wed, 2 Nov 2016 12:05:36 +0000
Post by Phil Reynolds
There is no change to the situation with apcupsd - I can't even prove
it's trying to call psshutdown. The same "nothing" occurs with
\apcupsd\bin\shutdown and \WINDOWS\System32\shutdown.
I added a "write to file" in the doshutdown section (a simple dir >
\apcupsd\run.txt) - and nothing was written! It seems that
apccontrol.bat is not being called - does TIMEOUT work on Win10? It
does work on ReactOS, so this seems to be some kind of Windows quirk.
--
Phil Reynolds
mail: phil-***@tinsleyviaduct.com
Web: http://phil.tinsleyviaduct.com/
Ted Mittelstaedt
2016-11-03 13:29:50 UTC
Permalink
Post by Phil Reynolds
On Wed, 2 Nov 2016 12:05:36 +0000
Post by Phil Reynolds
There is no change to the situation with apcupsd - I can't even prove
it's trying to call psshutdown. The same "nothing" occurs with
\apcupsd\bin\shutdown and \WINDOWS\System32\shutdown.
I added a "write to file" in the doshutdown section (a simple dir >
\apcupsd\run.txt) - and nothing was written! It seems that
apccontrol.bat is not being called - does TIMEOUT work on Win10? It
does work on ReactOS, so this seems to be some kind of Windows quirk.
Can we get a clarification here, Phil?

Can you get your machine to shut down AT ALL? Will it shut down but
just not shut down from timeout? Or is it simply not shutting down
no matter what trigger you set in apcupsd.conf?

Ted
Phil Reynolds
2016-11-03 14:42:56 UTC
Permalink
On Thu, 3 Nov 2016 06:29:50 -0700
Post by Ted Mittelstaedt
Post by Phil Reynolds
I added a "write to file" in the doshutdown section (a simple dir >
\apcupsd\run.txt) - and nothing was written! It seems that
apccontrol.bat is not being called - does TIMEOUT work on Win10? It
does work on ReactOS, so this seems to be some kind of Windows quirk.
Can we get a clarification here, Phil?
Can you get your machine to shut down AT ALL? Will it shut down but
just not shut down from timeout? Or is it simply not shutting down
no matter what trigger you set in apcupsd.conf?
It can be shut down by me by all normal methods.

It appears that the shutdown is never being called for by apcupsd. (now
tried with BATTERYLEVEL as well as TIMEOUT). (though it does work on a
ReactOS machine using the same version of apcupsd)
--
Phil Reynolds
mail: phil-***@tinsleyviaduct.com
Web: http://phil.tinsleyviaduct.com/
Phil Reynolds
2017-01-18 12:12:35 UTC
Permalink
On Thu, 3 Nov 2016 14:42:56 +0000
Post by Phil Reynolds
On Thu, 3 Nov 2016 06:29:50 -0700
Post by Ted Mittelstaedt
Can we get a clarification here, Phil?
Can you get your machine to shut down AT ALL? Will it shut down but
just not shut down from timeout? Or is it simply not shutting down
no matter what trigger you set in apcupsd.conf?
It can be shut down by me by all normal methods.
It appears that the shutdown is never being called for by apcupsd.
(now tried with BATTERYLEVEL as well as TIMEOUT). (though it does
work on a ReactOS machine using the same version of apcupsd)
I note there was no further word on this outstanding problem.

Unless something deep in Windows has changed since I last tested, this
still isn't working. I will do a test again next time I am using the
Windows VM, but what is the next step if it still fails to shut down as
intended?
--
Phil Reynolds
mail: phil-***@tinsleyviaduct.com
Web: http://phil.tinsleyviaduct.com/
Loading...