SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Slackware 15.0 x64, Slackware Live 15.0 x64
Posts: 618
Original Poster
Rep:
@michaelk - So those four .conf files are the only ones I need to edit or use, correct?
@bassmadrigal - Well, unfortunately my utter confusion is a broad problem with this program - which .conf files should I use/edit, and how to edit them to work with my single-user, single computer system.
michaelk has sort of helped, I'm going to try out what he's suggested and turn the other .conf files off that I tried to edit to my needs and see if that works and is all I needed.
@Ztcoracat - Thanks, I'm pretty sure I already got those parts setup correctly. I'll find out for sure when I try michalek's suggestion(s).
Distribution: Slackware 15.0 x64, Slackware Live 15.0 x64
Posts: 618
Original Poster
Rep:
Can't seem to 'start' it. I've tried
Code:
/etc/rc.d/rc.ups start
upsc myups@localhost
The 'start' command tells me I don't have permission, even as root (I use su - to get to root).
The second tells me Error: Connection failure: Connection refused even though in /var/log/messages the usb stuff shows it see the Tripp Lite ups, though doing the 'grep' thing came back with nothing at all.
The 'start' command tells me I don't have permission, even as root (I use su - to get to root).
The second tells me Error: Connection failure: Connection refused even though in /var/log/messages the usb stuff shows it see the Tripp Lite ups, though doing the 'grep' thing came back with nothing at all.
Is rc.ups executable? It will show a permission denied error if it isn't, whether you're root or not. You can either make it executable and run it or use sh to run it.
Code:
chmod +x /etc/rc.d/rc.ups
/etc/rc.d/rc.ups start
--or--
sh /etc/rc.d/rc.ups start
Distribution: Slackware 15.0 x64, Slackware Live 15.0 x64
Posts: 618
Original Poster
Rep:
Well crud...now when I do;
Code:
me@FTF:~$ sh /etc/rc.d/rc.ups start
I get;
Code:
/etc/rc.d/rc.ups: line 30: upsdrvctl: command not found
Shouldn't this had been started anyway when I boot by having this
Code:
if [ -x /etc/rc.d/rc.ups ]; then
/etc/rc.d/rc.ups start
fi
in /etc/rc.d/rc.local?
What's this upsdrvctl thing?
If you guys are frustrated from trying to get me to understand this thing, you now understand my frustration at the difficulty of it not working for me as eaily as I'd hoped, heh.
@michaelk - So those four .conf files are the only ones I need to edit or use, correct?
@bassmadrigal - Well, unfortunately my utter confusion is a broad problem with this program - which .conf files should I use/edit, and how to edit them to work with my single-user, single computer system.
michaelk has sort of helped, I'm going to try out what he's suggested and turn the other .conf files off that I tried to edit to my needs and see if that works and is all I needed.
@Ztcoracat - Thanks, I'm pretty sure I already got those parts setup correctly. I'll find out for sure when I try michalek's suggestion(s).
/etc/rc.d/rc.ups: line 30: upsdrvctl: command not found
Shouldn't this had been started anyway when I boot by having this
Code:
if [ -x /etc/rc.d/rc.ups ]; then
/etc/rc.d/rc.ups start
fi
in /etc/rc.d/rc.local?
What's this upsdrvctl thing?
If you guys are frustrated from trying to get me to understand this thing, you now understand my frustration at the difficulty of it not working for me as eaily as I'd hoped, heh.
I just checked on my system (I installed it a few years ago to work with my UPS, but never got around to setting it up), and it is located under /usr/libexec/nut/upsdrvctl. Maybe it'd be worth changing the two lines in there to read the full location, or just do a symlink to it in /usr/local/bin/. If you want to just change the rc.ups, you can use the below patch I just did.
Code:
--- rc.ups 2014-10-14 13:33:48.000000000 -0400
+++ rc.ups.new 2016-09-03 14:39:44.323584267 -0400
@@ -27,7 +27,7 @@
fi
start_driver() {
- upsdrvctl -u $NUTUSER start || exit 1
+ /usr/libexec/nut/upsdrvctl -u $NUTUSER start || exit 1
}
start_upsd() {
@@ -44,7 +44,7 @@
upsd -c stop; fi
if pgrep upsmon 2>&1 >/dev/null; then
upsmon -c stop; fi
- upsdrvctl stop
+ /usr/libexec/nut/upsdrvctl stop
}
case "$1" in
It might be worth shooting an email to the maintainer to see how they handle it.
Distribution: Slackware 15.0 x64, Slackware Live 15.0 x64
Posts: 618
Original Poster
Rep:
Thanks bassmadrigal, I honestly appreciate the help. Mind if I ask now how I install(?) that patch (I so rarely have to do such a thing I can't ever remember how to do it and if I actually happen to remember to write it down I always end up forgetting I did it or have it or where I put it...pretty awful catch 22, lol)?.
I'll also go ahead and do that suggestion too and e-mail the maintainer and see if s/he can help me any also.
I can never remember how to properly patch (google might help, but I'm lazy), but basically, you just add the /usr/libexec/nut/ folder in front of both entries of upsdrvctl in your rc.ups file, so it's directly referencing the file (since it isn't located within your PATH variable).
You basically remove the lines that have the minus symbol and replace them with the lines with the plus symbol (don't include the actual plus symbol).
If you use SBo to build nut, not only will you have to add code in /etc/rc.d/rc.local_shutdown to turn off the nut daemons, but you will have to patch /etc/rc.d/rc.0 to perform the proper shutdown (there's already code in /etc/rc.d/rc.0 to do that if you were using genpowerd to monitor your UPS).
In my case, I changed this code...
Code:
if [ -x /sbin/genpowerd ]; then
# See if this is a powerfail situation:
if /bin/egrep -q "FAIL|SCRAM" /etc/upsstatus 2> /dev/null ; then
# Signal UPS to shut off the inverter:
/sbin/genpowerd -k
if [ ! $? = 0 ]; then
echo
echo "There was an error signaling the UPS."
echo "Perhaps you need to edit /etc/genpowerd.conf to configure"
echo "the serial line and UPS type."
# Wasting 15 seconds of precious power:
/bin/sleep 15
fi
fi
fi
# Now halt (poweroff with APM or ACPI enabled kernels) or reboot.
if [ "$shutdown_command" = "reboot" ]; then
echo "Rebooting."
/sbin/reboot
else
/sbin/poweroff
fi
...to be that code (added code in bold)...
Code:
if [ -x /sbin/genpowerd ]; then
# See if this is a powerfail situation:
if /bin/egrep -q "FAIL|SCRAM" /etc/upsstatus 2> /dev/null ; then
# Signal UPS to shut off the inverter:
/sbin/genpowerd -k
if [ ! $? = 0 ]; then
echo
echo "There was an error signaling the UPS."
echo "Perhaps you need to edit /etc/genpowerd.conf to configure"
echo "the serial line and UPS type."
# Wasting 15 seconds of precious power:
/bin/sleep 15
fi
fi
fi
if [ -e /etc/killpower ]; then
/etc/rc.d/rc.ups shutdown
sleep 120
echo "Well, that didn't work as expected"
fi
# Now halt (poweroff with APM or ACPI enabled kernels) or reboot.
if [ "$shutdown_command" = "reboot" ]; then
echo "Rebooting."
/sbin/reboot
else
/sbin/poweroff
fi
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.