APC UPS Data Center & Enterprise Solutions Forum
Schneider, APC support forum to share knowledge about installation and configuration for Data Center and Business Power UPSs, Accessories, Software, Services.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-29 05:54 AM . Last Modified: 2024-03-13 12:20 AM
Hello. I've read several posts, some old, with the same problem, but couldn't find a solution that works for me.
I'm using PowerChute Business Edition 9.2 on a windows 7 pc and I had it configured to shutdown some linux servers using a command file in "shutdown sequence". It had been working fine but yesterday I noticed it didn't run the commands as expected.
I'm using a execute.bat file with the following contents:
----------------------------
echo "shutdown started at %date%, %time%" >>C:\LOGS\shutdown_log.txt
@start putty -load my.server1.ip -m c:\commands.txt
@start putty -load my.server2.ip -m c:\commands.txt
...
echo "shutdown finished at %date%, %time%" >>C:\LOGS\shutdown_log.txt
--------------------------
The commands file looks like this:
commands.txt
sudo /sbin/shutdown -h +1 2> stderr.txt
----------------------------------------------------------
If I execute it manually, it will work. If the power fails or I execute it at the "configure shutdown sequence" TEST button, It only executes the echo shutdown started/finished at %date%, %time%" >>C:\shutdown_log.txt.
Can someone please help me out?
Thanks and regards.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-29 05:54 AM . Last Modified: 2024-03-13 12:19 AM
The solution described in
works for me. Still, I'll try to adapt to my previous solution so that I don't have to insert passwords in the apc command file.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-29 05:54 AM . Last Modified: 2024-03-13 12:20 AM
Meanwhile, I changed the permissions of the PAC PBE Agent service so it would run with "Administrator" instead of "Local System", but it is the same thing.
So, running execute.bat works fine, but the "TEST" button or when the power fails, won't.
Please, any ideas?
Thanks and regards.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-29 05:54 AM . Last Modified: 2024-03-13 12:20 AM
Hi,
When PowerChute executes a command file it is run in session zero since PowerChute is a service per Microsoft security. This link explains session 0 in Windows https://www.2brightsparks.com/resources/articles/understanding-windows-sessions.pdf
It is possible the Putty is launching to the session zero desktop and requires permissions to do so.
Another thought, you wrote in your initial post that the command file was working when launched by PowerChute and now does not. What changed? Since you can see that PowerChute is launching the command file by creating the text file I would look to see if a change made to the system or the remote systems that would causing the failure.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-29 05:54 AM . Last Modified: 2024-03-13 12:19 AM
Thanks for the reply!
My "Terminator" machine, as I call it, was upgraded a year ago from XP to windows 7. Luckily, we haven't experienced power loss of more than 1 or 2 minutes. Maybe that's the reason I haven't noticed this problem yet.
I'll take a look at the link you sent. Thanks.
Regards
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-29 05:54 AM . Last Modified: 2024-03-13 12:19 AM
That information you provided about "Session 0" was very useful. I'm now trying to replace my "execute.bat" putty instructions with plink.
I'll report if this will solves my problem.
Thanks.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-29 05:54 AM . Last Modified: 2024-03-13 12:19 AM
Not working either... 😞
Works from the execute.bat though....
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-29 05:54 AM . Last Modified: 2024-03-13 12:19 AM
Hello again.
Still working on this. Any idea on how to make this work?
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-29 05:54 AM . Last Modified: 2024-03-13 12:19 AM
The solution described in
works for me. Still, I'll try to adapt to my previous solution so that I don't have to insert passwords in the apc command file.
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.