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.
Posted: 2021-06-30 07:01 PM . Last Modified: 2024-03-07 02:13 AM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-30 07:01 PM . Last Modified: 2024-03-07 02:13 AM
Hello,
I am trying to run a database shutdown script before the UPS goes on battery. The other events are working (system shutdown) but of course i want to be able to bring down the database with a script before the system does a shutdown.
The issue is, the shutdown script has commands in it like, 'sqlplus'. If the script is run as "oracle" user, it works fine. However if i log into root and type 'sqlplus' i get sqlplus: not found.
My question is, will the powerchute service run the script for On Battery event as root? if so, how do i make root able to run this shutdown script?
Thanks,
Charles
Message was edited by: charlescva
Message was edited by: charlescva
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-30 07:01 PM . Last Modified: 2024-03-07 02:13 AM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-30 07:01 PM . Last Modified: 2024-03-07 02:13 AM
think i figured it out... instead of running the script, the command
su - username -c "/path/to/script.sh"
works well from root prompt... so i will assume that powerchute will run as root and will do the same thing. Now if I can just figure out how to monitor the powerchute console session when i unplug the systems to see if its actually executing the scripts.
Message was edited by: charlescva
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-30 07:01 PM . Last Modified: 2024-03-07 02:13 AM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-30 07:01 PM . Last Modified: 2024-03-07 02:13 AM
think i figured it out... instead of running the script, the command
su - username -c "/path/to/script.sh"
works well from root prompt... so i will assume that powerchute will run as root and will do the same thing. Now if I can just figure out how to monitor the powerchute console session when i unplug the systems to see if its actually executing the scripts.
Message was edited by: charlescva
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.