Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

UPS support yet?

Featured Replies

I know this has been on the wish list for a couple years now.  Having just gone through three power outages in the last three weeks, where I was not home, and the outage lasted longer than my UPS I'm very much aware of a weakness here.

 

Ideas of when we could see apcupsd in the release?

 

In the meantime is there a Linux guru that could help us get this installed on our own?

 

thanks,

David

  • Replies 239
  • Views 82.7k
  • Created
  • Last Reply

Apcupsd or NUT?

 

Nut supports more then one piece of hardware and can chain to another "server" who is the master of the UPS.

 

APCUPSD can also do the chaining.

 

FWIW, I can compile apcupsd on slacky (my slackware dev vmware enviroment)

(if you are willing to mess with your own scripts/configs etc, etc.

 

I started compiling NUT and I'm in the process of setting my network up with that.

 

One downside of the current unraid environment is the http application is very specific to unraid management and that alone.

I haven't seen a hook to allow us to host pages or other CGI's.

 

I sure wish it used apache or lighthttp and had CGI's or a control daemon to maintain the array instead.

 

(TANGENT). Sowwy...

 

 

 

 

  • Author

I'm not set on any particular implementation.  I looked at apcupsd because I have APC UPSs :)

 

I did plug in my UPS via the USB and noticed the UnRaid did not detect it.  I figure that is the first thing to get working.  I'll play around with that a little bit to see where I get.

 

I did find a slackware package for apcupsd.

 

thanks,

 

Do you have other machines with a full linux USB implementation?

If so you can slave an apcupsd from a master on another machine.

 

I happen to have a serial based APC UPS, I'm sure that will work, it's the USB foundation that may be a sticking point on unRaid.

 

  • Author

I looked a little more and found in the syslog this getting reported when I unplugged and replugged my UPS.

 

Feb 26 18:11:58 Tower kernel: [94602.790508] usb 2-1: new low speed USB device using uhci_hcd and address 3

Feb 26 18:12:02 Tower kernel: [94606.955687] usb 2-1: configuration #1 chosen from 1 choice

Feb 26 18:12:03 Tower kernel: [94608.028797] HID device not claimed by input orhiddev

 

So it looks like the system noticed a USB device getting plugged in, but HID did not take it.  At least the system saw it.

 

I did install apcupsd on my windows box that has one of these devices and it works great.  Even got the client/sever stuff working.  Now to just get my UnRaid working.

 

 

  • 2 months later...

Any word yet on this implementation?

no

 

 

Fixed

Edited by stephenm00

  • 1 month later...

FYI,

 

I have apcupsd working on my unRAID setup, but I had to recompile the kernel.  Specifically, I had to add support for HID RAW and HID DEV devices. 

 

When I get home, I'll dig through the actual menus to find where those options are.

Yes, Please post, we seem to have a laundry list of items to be added back into the kernel.

Ok, here's what I added:

 

Device Drivers ->HID Devices ->/dev/hidraw raw HID device support

Device Drivers ->HID Devices ->/dev/hiddev raw HID device support

 

root@Tower:~# cat /proc/bus/usb/devices
...
T:  Bus=06 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=1.5 MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=051d ProdID=0002 Rev= 1.06
S:  Manufacturer=APC
S:  Product=Back-UPS ES 550 FW:840.B2.D USB FW:B2
S:  SerialNumber=3B0707X03554
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  2mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid
E:  Ad=81(I) Atr=03(Int.) MxPS=   6 Ivl=10ms
...

 

Once you've got those drivers installed, everything should just work.

 

Ok, here's what I added:

 

Device Drivers ->HID Devices ->/dev/hidraw raw HID device support

Device Drivers ->HID Devices ->/dev/hiddev raw HID device support

 

root@Tower:~# cat /proc/bus/usb/devices
...
T:  Bus=06 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=1.5 MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=051d ProdID=0002 Rev= 1.06
S:  Manufacturer=APC
S:  Product=Back-UPS ES 550 FW:840.B2.D USB FW:B2
S:  SerialNumber=3B0707X03554
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  2mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid
E:  Ad=81(I) Atr=03(Int.) MxPS=   6 Ivl=10ms
...

 

Once you've got those drivers installed, everything should just work.

 

 

Nicely done.  I think it might also need the Serial port enabled if you have an older UPS (as I do) that uses a serial cable rather than a USB cable to connect to the server.

 

Joe L.

I think it might also need the Serial port enabled if you have an older UPS (as I do) that uses a serial cable rather than a USB cable to connect to the server.

 

Yes serial support too ( I have an older one also)

 

 

Once you've got those drivers installed, everything should just work.

 

 

So will it gracefully shut down the array and power off if it gets a no power notification from the UPS?

 

Once you've got those drivers installed, everything should just work.

 

 

So will it gracefully shut down the array and power off if it gets a no power notification from the UPS?

Basically...

It should not shut down the software on a simple power hit on the line.  It should get a notification from the UPS when only a few minutes of operating time remain, and at that point, shut down the server as gracefully as it can.  (of course, on an inexpensive UPS, it might only have a few minutes reserve)

 

That way, you do not kill the batteries on the UPS, or crash when they cannot supply power for an extended time.  My older APC UPS's have a serial connection, my newer one, on the unRAID server, a USB connection)

 

Tom has said we already have serial port support enabled in the kernel, so you might be able to add the slackware package for UPS management.

 

Joe L.

Not exactly.  Most UPS systems will give a signal when 1) on battery, 2) power restored, and 3) low battery.  Some, with multitapped xformers that can step-up wall voltage, will also report brownout/powerboost status.  Some will report bad/defective conditions too. 

 

More importantly, most, once they cut over to battery, will stay on battery for a second or more, and not switch back until they detect that line voltage is stable.  This can initiate a server shutdown as a result of a small "blip" in the power, if your system is set to initiate a shutdown immediately on notification of power outage, and that shutdown can not be aborted.

It also depends on the software installed.

 

With a version of APCUPSD I used at one time, it sets a signal somewhere (not sure where)..

Which calls /sbin/genpowerfail from inittab.  (lines below).

 

I have seen the warnings where the machine gets the power fail message and then switches back to power good because the brownout went away.

 

root@Atlas:~# less /etc/inittab 
#
# What to do when power fails.
pf::powerfail:/sbin/genpowerfail start

# If power is back, cancel the running shutdown.
pg::powerokwait:/sbin/genpowerfail stop

 

Once you've got those drivers installed, everything should just work.

 

 

So will it gracefully shut down the array and power off if it gets a no power notification from the UPS?

 

Well, not exactly.  You still have to have the UPS control software installed.  I chose to install apcupsd because there was a Slackware package already available.

 

I had to muck with the configuration a little bit to get it just the way that I wanted.  If you have basic linux experience, this shouldn't be too hard to do.  For my UPS (APC BackUPS 550) there are quite a few notification events that you can configure.  I set mine up to send me an e-mail when I go on/off battery (I also have my router/switch on battery backup).  I set up apcupsd to shut down my unRAID box when there's either 25% battery charge or 3 minutes of estimated power remaining.

 

 

I have to add to this.. I'm not sure the shutdown will 100% graceful.

Chances are you will have to do a parity check upon start up.

What ever software is installed, it still does not know how to shutdown unRAID gracefully.

 

I think what really needs to happen is a modification to emhttp so that if it receives a -TERM signal it begins the graceful shutdown of unRAID or the shutdown command needs to be enhanced to do the unRAID shutdown gracefully.

 

I.E. unless there are hooks within apcupsd to do this..

Where did you find the package for apcupsd?  Was it in source or did it have a slackbuild?

I have to add to this.. I'm not sure the shutdown will 100% graceful.

Chances are you will have to do a parity check upon start up.

What ever software is installed, it still does not know how to shutdown unRAID gracefully.

 

I think what really needs to happen is a modification to emhttp so that if it receives a -TERM signal it begins the graceful shutdown of unRAID or the shutdown command needs to be enhanced to do the unRAID shutdown gracefully.

 

I.E. unless there are hooks within apcupsd to do this..

 

There are hooks in apcupsd to do this.  You can configure it to run custom scripts on events.  I created a doshutdown script that just calls the powerdown script so everything will shut down cleanly.  I also modified /etc/rc.d/rc.0 to call /etc/apcupsd/apccontrol killpower in the event of a power failure.  This will cleanly power off the UPS.  I think there was a some code in the original rc.0 that was using genpowerd ... I replaced it with the following:

 

if [ -f /etc/apcupsd/powerfail ]; then                                     # ***apcupsd***
        echo                                                               # ***apcupsd***
        echo "APCUPSD will now power off the UPS"                          # ***apcupsd***
        echo                                                               # ***apcupsd***
        /etc/apcupsd/apccontrol killpower                                  # ***apcupsd***
        echo                                                               # ***apcupsd***
        echo "Please ensure that the UPS has powered off before rebooting" # ***apcupsd***
        echo "Otherwise, the UPS may cut the power during the reboot!!!"   # ***apcupsd***
        echo                                                               # ***apcupsd***
fi

 

I also setup my BIOS (I'm using an Abit AB9 Pro) to reboot once power is restored: http://www.apcupsd.org/manual/After_Installation.html#SECTION000122000000000000000.

 

I've tested all of this functionality on my setup and it all works like a charm.  :)

 

Where did you find the package for apcupsd?  Was it in source or did it have a slackbuild?

 

I'm using this package:

http://www.linuxpackages.net/pkg_details.php?id=12025

 

 

Ok, here's what I added:

 

Device Drivers ->HID Devices ->/dev/hidraw raw HID device support

Device Drivers ->HID Devices ->/dev/hiddev raw HID device support

 

In my new v4.3.2 syslog are the following 2 lines:

usbcore: registered new interface driver hiddev
usbcore: registered new interface driver usbhid 

 

The usbhid line already occurred in the v4.3.1 syslog, the hiddev line is new.  Perhaps additional support has been added for those wishing to add UPS packages?

The usbhid line already occurred in the v4.3.1 syslog, the hiddev line is new.  Perhaps additional support has been added for those wishing to add UPS packages?

It does look encouraging....  serial support, parallel support, and now this too.

 

Joe L.

  • Author

looks like I need to upgrade to 4.3.2 and give this a shot.

 

What version of slackware should I download the package for?

 

thanks,

dave

Slackware 12.0

  • Author

Would you mind showing how you install the package?  I assume it needs to be gunziped and un-tarred from the flash drive via the go script.  Then the daeomn ran.

 

thanks,

dave

 

 

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.