LinuxQuestions.org
Help answer threads with 0 replies.
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 09-02-2016, 09:02 AM   #16
FTIO
Member
 
Registered: Mar 2015
Location: Las Vegas, NV
Distribution: Slackware 15.0 x64, Slackware Live 15.0 x64
Posts: 618

Original Poster
Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361

@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).

Last edited by FTIO; 09-02-2016 at 09:06 AM.
 
1 members found this post helpful.
Old 09-02-2016, 10:07 AM   #17
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,751

Rep: Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929
That should get it working using the default parameters which might need some tuning for your UPS.
 
Old 09-02-2016, 10:29 AM   #18
FTIO
Member
 
Registered: Mar 2015
Location: Las Vegas, NV
Distribution: Slackware 15.0 x64, Slackware Live 15.0 x64
Posts: 618

Original Poster
Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
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.
 
Old 09-02-2016, 10:47 AM   #19
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,751

Rep: Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929
If rc.ups can not be started then there is nothing listening and so upsc fails. nut is network based daemon that uses port 3493.
 
Old 09-02-2016, 01:26 PM   #20
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by FTIO View Post
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.
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
 
Old 09-02-2016, 07:55 PM   #21
FTIO
Member
 
Registered: Mar 2015
Location: Las Vegas, NV
Distribution: Slackware 15.0 x64, Slackware Live 15.0 x64
Posts: 618

Original Poster
Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
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.
 
Old 09-02-2016, 11:13 PM   #22
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by FTIO View Post
@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).
You're Welcome-
 
Old 09-03-2016, 01:41 PM   #23
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by FTIO View Post
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.
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.
 
Old 09-03-2016, 06:34 PM   #24
FTIO
Member
 
Registered: Mar 2015
Location: Las Vegas, NV
Distribution: Slackware 15.0 x64, Slackware Live 15.0 x64
Posts: 618

Original Poster
Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
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.
 
Old 09-03-2016, 09:23 PM   #25
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
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).
 
Old 11-22-2016, 12:44 AM   #26
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

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


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
[SOLVED] Slackware 14.0 (x86_64): alsaconf nowhere to be seen. stf92 Slackware 3 12-29-2012 03:27 PM
Installing Slackware 13.1 x86_64 SavoTU Slackware 4 10-02-2010 10:37 AM
ipm timed out error on Red Hat 2.6.9-67.0.22.ELsmp #1 SMP x86_64 x86_64 x86_64 GNU/L bellnarm Linux - Newbie 0 07-07-2009 04:36 PM
Slackware 11.0 or FC6.x86_64? woodpecka_04 Linux - Distributions 9 06-08-2007 08:22 PM

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

All times are GMT -5. The time now is 07:21 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