[SOLVED] NUT (Network UPS Tools) v2.8.1 in Slackware
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.
Does "compatible with Slackware" mean that the Slackbuild and this version number will work well? The Slackbuild for nut is for version 2.7.4. I've been wanting to have my UPS turn the computer off in the correct way for decades, but haven't been able to get anything to work or I wasn't smart enough to figure out the cofig file or whatever. I've had apcupsd, but that was the only one I tried and as you can see I couldn't get it to work because I just don't get it, I suppose. Seeing apcupsd is so old and not being worked on, and nut looks really good, I'd sure like to give it a try and hope this time it can help me a little more than apcupsd did/could. I live out in the woods, literally, and brownouts, blackouts and flickers in the power happen quite often, so something like nut is quite important to me...even though I've not been able to get it to work any time I ever tried.
It means that the new NUT versions are also compiled in Slackware, see post #5 https://github.com/networkupstools/n...ereqs.txt#L517
I have no idea if SlackBuilds works for version 2.8.2 (maybe it needs to be updated) but what I can confirm for sure is that NUT compiled from sources has been working well in Slackware for over 10 years and stops my servers if the power goes out.
It means that the new NUT versions are also compiled in Slackware, see post #5 https://github.com/networkupstools/n...ereqs.txt#L517
I have no idea if SlackBuilds works for version 2.8.2 (maybe it needs to be updated) but what I can confirm for sure is that NUT compiled from sources has been working well in Slackware for over 10 years and stops my servers if the power goes out.
I'll probably have something for you to test in the next day or so.
I'll probably have something for you to test in the next day or so.
What could it be?
1. Problem with GRUB 2.12 explained here?
Quote:
I still have a problem with the official SlackBuild for GRUB.
If I apply hardening flags, I have to use HOST_CFLAGS="-fstack-protector-strong" because the script builds 32/64 bit efi target, then builds regular build and overwrites the above option by disabling it for efi.
...
The SlackBuild used by Didier solves the problem in a different way, although he disabled the respective section and removed $ENABLESTACKPROTECTOR from the compilation options.
2. Deprecation Warning for Quota (enable quota feature) from here?
3. 7-Zip for Linux (by Igor Pavlov) from here I don't think so, we still don't have 24.0x stable (I remind you that RAR support can be disabled, just like Debian does).
4. Hardening options for C and C++ in Slackware from here, I don't really think so, there is some work there.
Maybe NUT official package in Slackware as well as Debian, Fedora, openSUSE.
Yes, NUT has been added to the official Slackware packages.
The implementation was a little different from what I had, that is:
1. I had user: ups and group: nut as it appears in the official documentation here. It's not a problem, I solved it using the username and group from the official package;
2. the compilation options are wide (although some are implicit), as they are in the case of PHP, so I can't use them (the hardening flags are missing anyway). A plus is the compilation without support for Python2 (--without-python2 \);
3. OK, that genpower was given up and the blocks from rc.M and rc.6 were removed but now in rc.M the driver loading block will recommend if you manage your UPS using a serial port to add the "nut" user to the "dialout" group. In my installation notes I found that this is not done by default for security reasons (probably I found this somewhere many years ago), there is also a solution to create a file in /etc/udev/rules.d/ with the name "62-nut-serialups.rules" (same as the one in the official package lib/udev/rules.d/62-nut-usbups.rules) and which contains
Code:
KERNEL=="ttyS0", GROUP="nut"
where 'ttyS0' has to be replaced by the exact name of your serial port;
4. in rc.6 I like the block "# NUT UPS inverter shutdown support:" more than what I had, I have only one problem, what is actually wanted to restart udev or simply start? In the if block in the comment as well as in the echo command, restart is specified, but the command is start.
Quote:
# First we need to restart udev or we won't be able to contact the UPS:
echo "Restarting udev to be able to shut the UPS inverter off..."
/etc/rc.d/rc.udev start
A little higher (in the file) udev is still stopped with force-stop. Maybe I didn't understand the exact meaning.
That's it for now, I hope it's OK and the NUT package will be installed and tested by as many Slackware users as possible.
Yes, NUT has been added to the official Slackware packages.
The implementation was a little different from what I had, that is:
1. I had user: ups and group: nut as it appears in the official documentation here. It's not a problem, I solved it using the username and group from the official package;
Taken from the SBo assignments. To me, nut:nut seems better anyway (just like rc.ups wasn't the right choice).
Quote:
2. the compilation options are wide (although some are implicit), as they are in the case of PHP, so I can't use them (the hardening flags are missing anyway). A plus is the compilation without support for Python2 (--without-python2 \);
3. OK, that genpower was given up and the blocks from rc.M and rc.6 were removed but now in rc.M the driver loading block will recommend if you manage your UPS using a serial port to add the "nut" user to the "dialout" group. In my installation notes I found that this is not done by default for security reasons (probably I found this somewhere many years ago), there is also a solution to create a file in /etc/udev/rules.d/ with the name "62-nut-serialups.rules" (same as the one in the official package lib/udev/rules.d/62-nut-usbups.rules) and which contains
Code:
KERNEL=="ttyS0", GROUP="nut"
where 'ttyS0' has to be replaced by the exact name of your serial port;
Well OK, if someone gains access to the nut user then they could access serial ports. These days it's unlikely that serial ports are getting much use, and probably the one attached to the UPS will be the only one in use, and assigning the nut user access to just the one port through udev is not going to be any more secure.
Quote:
4. in rc.6 I like the block "# NUT UPS inverter shutdown support:" more than what I had, I have only one problem, what is actually wanted to restart udev or start? In the if block in the comment as well as in the echo command, restart is specified, but the command is start.
A little higher (in the file) udev is still stopped with force-stop.
That's it for now, I hope it's OK and the NUT package will be installed and tested by as many Slackware users as possible.
I guess I agree that the use of the term restart could be confusing. But what's a restart? A stop followed immediately by a start?
That's what we've got here.
I'll be on the lookout for more feedback (might as well put it here in the "SOLVED" thread).
In post #19, trying to make an innocent joke (I apologize if it could be interpreted differently), I added some problems regarding GRUB, Quota and possibly 7-Zip when we have a stable version.
I use and been using apcupsd. In /usr/doc/apcupsd-3.14.14/README.SLACKWARE it says
Code:
Finally, you'll need to edit your /etc/rc.d/rc.6 script for apcupsd
to perform the shutdown on power failures. Here's the short version:
Scroll down to the end of rc.6 - you should see a section that calls
/sbin/genpowerd. Comment out (or remove) this entire section:
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
without genpowerd is it necessary to do anything with
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.