LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-04-2024, 12:25 PM   #16
teoberi
Member
 
Registered: Jan 2018
Location: Romania
Distribution: Slackware64-current (servers)/Windows 11/Ubuntu (workstations)
Posts: 611

Original Poster
Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355

Quote:
Originally Posted by FTIO View Post
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.
 
2 members found this post helpful.
Old 04-04-2024, 01:38 PM   #17
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 2,523

Rep: Reputation: 8489Reputation: 8489Reputation: 8489Reputation: 8489Reputation: 8489Reputation: 8489Reputation: 8489Reputation: 8489Reputation: 8489Reputation: 8489Reputation: 8489
Quote:
Originally Posted by teoberi View Post
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.
 
3 members found this post helpful.
Old 04-04-2024, 06:38 PM   #18
glorsplitz
Senior Member
 
Registered: Dec 2002
Distribution: slackware!
Posts: 1,310

Rep: Reputation: 368Reputation: 368Reputation: 368Reputation: 368
out of curiosity, I tried nut-2.8.2.tar.gz on one my arm device, it built but I didn't install or test.

I have apcupsd on another arm device monitoring the apc ups there.
 
Old 04-05-2024, 02:50 AM   #19
teoberi
Member
 
Registered: Jan 2018
Location: Romania
Distribution: Slackware64-current (servers)/Windows 11/Ubuntu (workstations)
Posts: 611

Original Poster
Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
Quote:
Originally Posted by volkerdi View Post
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.
 
Old 04-06-2024, 02:22 PM   #20
teoberi
Member
 
Registered: Jan 2018
Location: Romania
Distribution: Slackware64-current (servers)/Windows 11/Ubuntu (workstations)
Posts: 611

Original Poster
Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
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.

Last edited by teoberi; 04-06-2024 at 02:39 PM.
 
1 members found this post helpful.
Old 04-06-2024, 02:37 PM   #21
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 2,523

Rep: Reputation: 8489Reputation: 8489Reputation: 8489Reputation: 8489Reputation: 8489Reputation: 8489Reputation: 8489Reputation: 8489Reputation: 8489Reputation: 8489Reputation: 8489
Quote:
Originally Posted by teoberi View Post
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).
 
1 members found this post helpful.
Old 04-06-2024, 02:54 PM   #22
teoberi
Member
 
Registered: Jan 2018
Location: Romania
Distribution: Slackware64-current (servers)/Windows 11/Ubuntu (workstations)
Posts: 611

Original Poster
Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
Fair enough, for me NUT is finished.

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.
 
Old 04-07-2024, 10:44 AM   #23
FTIO
Member
 
Registered: Mar 2015
Location: Las Vegas, NV
Distribution: Slackware 15.0 x64, Slackware Live 15.0 x64
Posts: 618

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
Official Slackware packages? This is what will be in the next Slackware version then, right? So not in SlackBuilds for 15.0, correct?
 
Old 04-07-2024, 11:11 AM   #24
glorsplitz
Senior Member
 
Registered: Dec 2002
Distribution: slackware!
Posts: 1,310

Rep: Reputation: 368Reputation: 368Reputation: 368Reputation: 368
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

Code:
# NUT UPS inverter shutdown support:
.
.
.

added block of code at the end of rc.6?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Alternative to Network UPS Tools (NUT)? 1MachineElf Linux - Software 1 07-10-2021 05:16 AM
NUT (Network UPS Tools) - sepatare syslog file davdak Linux - Software 3 11-01-2019 12:08 AM
LXer: Network UPS Tools (NUT) For USB UPSs On CentOS 5.5 LXer Syndicated Linux News 0 04-08-2011 09:03 PM
Network UPS Tools (NUT) error, data stale eric_f Linux - Hardware 1 06-16-2008 10:47 PM
Ups & Nut Denis Basta Linux - Software 1 09-27-2005 07:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration