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-> Auto Shutdown of Unraid Server?

Featured Replies

  • Author

I vaguely remember I had a similar problem. I repeated the steps several times to make sure I did everything correctly. I think I ended up restarting unMenu (or a reboot) and suddenly it recognised it.

 

Edit: Make sure the line starting it is correct (and on it's own line) in the "Go" script on your flash. See page 1 of my thread.

 

Yes, in your thread you mentioned that problem, and wasn't sure if it was an issue. But no-one responded to that, nor did you mention how you resolved it. Sounds like maybe a re-try fixed it, and you just never had cause to mentino it again.

 

in my case, I have gone through it 4 times now, so I"m not thinking a re-install is helping me much.  :-[

 

One thing I might mention: I did not use the same methodology as your instructions to get the fiels on my flash drive. I did not remove it and put in my Windwos PC. I just mapped to the drive and copied them over, which seemed to work fine. I wouldn't think that would be any part of my problem.

A couple of things I thought I would add.

 

1 - unMenu adds this line to the Go script.  Check it is there and if not, perhaps a manual addition.  I copied and pasted this directly from my flash on it's own line.  (Use Notepad2 so it puts correct newline characters at the ends of the lines)

 

cd /boot/packages && find . -name '*.auto_install' -type f -print | sort | xargs -n1 sh -c

 

2 - Make sure your "Packages" and "unMenu" folder is in the root of the drive - instead of under a folder called "Boot." Boot is the root of the flash, so isn't a folder at all.

 

I'm no expert, just offering some suggestions as a matter of elimination.

 

 

  • Author

Thanks for the thoughts, Flambot.

 

I checked and that line was not in the file. I added it. (I don't know if it makes any difference where in that file it is, ie if anyting else shoudl be before or after it.)

 

RE: Your suggestion about the location of the directories: I decided maybe I should pull the flash as your tutorial suggests (as opposed to mapping to it), and take a look. When I put it in my drive on the Windows PC, I find no BOOT directory, and the Unmenu and Packages folders are on the same level as the Config folder.

 

Still no go.

 

Thanks for the thoughts. I"ll keep checking back here.

 

[EDIT]

Well, I've figured out the basis of the problem by browsing the docs for APCUSD. But i'll need help from someone to fix.

 

It seems that I do not have the HID drivers loaded. When I enter this: cat /proc/bus/usb/devices, this is the comments I get for the UPS:

 

T:  Bus=05 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.01

S:  Manufacturer=American Power Conversion

S:  Product=Back-UPS ES 750 FW:841.I3 .D USB FW:I3

S:  SerialNumber=3B0842X22756

C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  2mA

I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=(none)

E:  Ad=81(I) Atr=03(Int.) MxPS=  6 Ivl=100ms

 

You will notice that on line I it s ays Driver - (none).

 

The instructions talk about editing files that I think don't exist on my drive. I'm hoping someone here will give me a hint about my next steps on this.

 

 

 

 

 

 

 

Thanks for the thoughts, Flambot.

 

I checked and that line was not in the file. I added it. (I don't know if it makes any difference where in that file it is, ie if anyting else shoudl be before or after it.)

 

RE: Your suggestion about the location of the directories: I decided maybe I should pull the flash as your tutorial suggests (as opposed to mapping to it), and take a look. When I put it in my drive on the Windows PC, I find no BOOT directory, and the Unmenu and Packages folders are on the same level as the Config folder.

 

Still no go.

 

Thanks for the thoughts. I"ll keep checking back here.

 

 

 

Your flash drive IS the boot directory... When unRAID loads it mounts the flashdrive to /boot.  that means if you had a file called foo on the root of your flashdrive, to access that file in unRAID, you would use the directory path /boot/foo.

 

if your unmenu and package folder are directly in the root of your flashdrive then /boot/unmenu and /boot/packages would be where to find them when the server is booted.

 

Cheers,

Matt

  • Author

OK. That makes sense. But I"m left not sure then if my Packages and Unmenu are in the right place or not, and not sure how to get them there.

 

For example, if I map the flash drive, or specifically put it in the USB port of my Windows PC, I do not see the same folders that I see if I use a terminal session and do a CD .. and then LS. When I do that I see;

 

root@Tower:/# ls

bin/  dev/  home/  lib/  proc/  sbin/  tmp/  var/

boot/  etc/  init@  mnt/  root/  sys/  usr/

root@Tower:/#

 

It sounds like I should also see Unmenu and Packages here. But, I have to CD to Boot in order to see them.

 

When I put the flash drive in my USB on the Windows PC, I see what is in the Boot folder.

 

Do I need to figure out the commands in linux to move those folders up one level, and could this also be why my drivers are not loading? ( I think I was editing my post to add info about the missing drivers while you were replying to me).

 

 

 

Thanks for the thoughts, Flambot.

 

I checked and that line was not in the file. I added it. (I don't know if it makes any difference where in that file it is, ie if anyting else shoudl be before or after it.)

 

RE: Your suggestion about the location of the directories: I decided maybe I should pull the flash as your tutorial suggests (as opposed to mapping to it), and take a look. When I put it in my drive on the Windows PC, I find no BOOT directory, and the Unmenu and Packages folders are on the same level as the Config folder.

 

Still no go.

 

Thanks for the thoughts. I"ll keep checking back here.

 

[EDIT]

Well, I've figured out the basis of the problem by browsing the docs for APCUSD. But i'll need help from someone to fix.

 

It seems that I do not have the HID drivers loaded. When I enter this: cat /proc/bus/usb/devices, this is the comments I get for the UPS:

 

T:  Bus=05 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.01

S:  Manufacturer=American Power Conversion

S:  Product=Back-UPS ES 750 FW:841.I3 .D USB FW:I3

S:  SerialNumber=3B0842X22756

C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  2mA

I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=(none)

E:  Ad=81(I) Atr=03(Int.) MxPS=   6 Ivl=100ms

 

You will notice that on line I it s ays Driver - (none).

 

The instructions talk about editing files that I think don't exist on my drive. I'm hoping someone here will give me a hint about my next steps on this.

 

 

 

 

 

 

 

What version of unRAID are you running?  The HID drivers were not included in early versions.  I think they were added in 4.3.2.

 

Second, one line in the apcupsd.conf file must be edited to have it not look at the serial port.  One of the commands in the unmenu package installation file for apcupsd does that for you.  Is the line on your server edited? or not? 

It should say

#DEVICE /dev/ttyS0

Before editing it, it did not have the leading "#" character commenting it out.

 

 

Regardless of how you do it, once you get the HID device recognized, you need to perform the following steps or their equivalent.  These are the lines I have in my apcupsd*.auto_install file

First, you must install the package you downloaded

installpkg apcupsd-3.14.3-i486-1kjz.tgz

 

Then, if you are not using a serial port connection, you must comment out the DEVICE line asking it to use the serial port.  It will instead, determine on its own which port the device is on...

sed -i -e "s/^DEVICE \/dev\/ttyS0/#DEVICE \/dev\/ttyS0/" /etc/apcupsd/apcupsd.conf

 

This line edits the control script to send mail when the UPS status changes rather than alerting all who are logged on via the "wall" command.  It is not necessary for the UPS to function, just a nice touch to alert you when status changes.  (Another clue is all the lights in your house are off, so it really is redundant in many cases)

sed -i -e "s/WALL=wall/WALL=\"mail -s 'unRAID_Server_UPS_Alert'\"/" /etc/apcupsd/apccontrol

This line starts the apcupsd program that monitors the UPS.  If it is not started, nothing is watching for a power failure.

/sbin/apcupsd

These next lines create a script that upon power failure will initiate a clean shutdown of the server.  If you do not do something similar, the server will shut dow, but not cleanly, and will perform a parity check upon power restore.

#Now, put into place the shutdown script replacement

echo "/sbin/powerdown" >/etc/apcupsd/doshutdown

echo "exit 99" >>/etc/apcupsd/doshutdown

chmod 755 /etc/apcupsd/doshutdown

Lastly, you need to add a command somewhere that will send the UPS a power-off command so it will shut itself off.  This is to allow the entire server to power up and reboot when its power supply sees power has been restored.

sed -i -e "s/\/sbin\/poweroff/\/etc\/apcupsd\/apccontrol killpower; \/sbin\/poweroff/" /etc/rc.d/rc.6

 

You also need to have the powerdown package installed for all this to work, but that does not matter until you get the UPS recognized.

 

 

Joe L.

  • Author

Thanks Joe for your detailed explanation.

 

I guess first thing I need to do is upgrad my Unraid. I am on 4.3.1. So, I'll download that and do a bunch of reading to determine the correct process for upgrading, and then come back to this thread and be sure I follow your instructions in your last post.

 

Maybe I shoudl ask: What version do you recommend I go to? 4.3.2, or one of the newer ones? I see 4.5, but it appears to be beta. I do prefer stability  ;)

 

Regards,

Roger

 

Thanks Joe for your detailed explanation.

 

I guess first thing I need to do is upgrad my Unraid. I am on 4.3.1. So, I'll download that and do a bunch of reading to determine the correct process for upgrading, and then come back to this thread and be sure I follow your instructions in your last post.

 

Maybe I shoudl ask: What version do you recommend I go to? 4.3.2, or one of the newer ones? I see 4.5, but it appears to be beta. I do prefer stability  ;)

 

Regards,

Roger

 

By all means, use the most current beta. (4.5beta6)  It is very stable.  I don't know of any outstanding issues unless you are using access-control lists. (And you can't, since your version does not use them at all.  Those issues deal with some permissions wen using MS-active directory)

 

There is no way you could have gotten the UPS to work on your older version of unRAID.  The HID device drivers were not in the kernel in your version. (You are about 12 or 13 releases back)

See here: http://lime-technology.com/wiki/index.php/Release_Notes#Change_Log

 

Joe L.

  • Author

... your unRAID server would shut down at 5 minutes, but until you power it up it will  not power itself back up when power is restored.

 

Joe L.

 

Well, I upgraded to the latest version of Unraid. I ran the scripts via the buttons in UnMenu. The UPS is working.

 

But per your comment above from an earlier post in this thread, it appears that the server should start back up when power is restored. I'm not sure how it would do that, given that it is off, how can it have the smarts to start back up? Unless some other things to do wake on lan is implemented, which I've seen no instructions for.

 

I find that my server does not start back up when power is restored.

 

But the important thing is that it does do a safe shutdown.

 

 

... your unRAID server would shut down at 5 minutes, but until you power it up it will  not power itself back up when power is restored.

 

Joe L.

 

Well, I upgraded to the latest version of Unraid. I ran the scripts via the buttons in UnMenu. The UPS is working.

 

But per your comment above from an earlier post in this thread, it appears that the server should start back up when power is restored. I'm not sure how it would do that, given that it is off, how can it have the smarts to start back up? Unless some other things to do wake on lan is implemented, which I've seen no instructions for.

 

I find that my server does not start back up when power is restored.

 

But the important thing is that it does do a safe shutdown.

 

 

To have your server restart you must set it as the option in your BIOS.   Most all BIOS have an option to restart when power is restored and not wait until the power button is pressed.

 

It is usually labeled as "AC Power Loss Restart" as seen here

bios-power.jpg

 

Glad your UPS is working.

 

Joe L.

  • Author

Great!

Thanks for your support. I can find that easy enough.

 

 

  • Author

I've been running my server w/o a video card. I just installed one, and set up the bios to boot upon power.

 

Interestingly, I just watched the boot messages, and see this one:

 

"Cannot install /boot/packages/p/bootowerdown-1.02-noarch-unraid.tgz: Package does not end in tgz"

 

First, I do not have a directory of p under packages. Next, the specified file in the error message ends in tgz, yet the error says it does not.

 

Any suggestions or comments?

 

 

I've been running my server w/o a video card. I just installed one, and set up the bios to boot upon power.

 

Interestingly, I just watched the boot messages, and see this one:

 

"Cannot install /boot/packages/p/bootowerdown-1.02-noarch-unraid.tgz: Package does not end in tgz"

 

First, I do not have a directory of p under packages. Next, the specified file in the error message ends in tgz, yet the error says it does not.

 

Any suggestions or comments?

 

 

You have a typo somewhere...

You'll get the exact same type of message message if you typed:

installpkg ewingr.tgz

 

Instead of installpkg saying that ewingr.tgz does not exist, it says it does not end in .tgz.  (/Yeah, I know, it is slightly misleading)

 

In your case, it appears as if you should have in your script

installpkg /boot/packages/powerdown-1.02-noarch-unraid.tgz

instead, you improperly edited the command somehow and it is currently improperly

installpkg /boot/packages/p/bootowerdown-1.02-noarch-unraid.tgz

 

Fix it, remove the extra /boot, and the error message will magically go away.

  • Author

I did not edit any scripts at all. I used the install scripts from the tool to auto install the setup.

 

That being said, I will investigate the files. Oh...which script do I need to look at and correct, or maybe I'd be better asking...what file in what folder?

 

Thanks.

 

 

I did not edit any scripts at all. I used the install scripts from the tool to auto install the setup.

 

That being said, I will investigate the files.

 

Thanks.

 

 

Interesting... Let us know what you find.

I did not edit any scripts at all. I used the install scripts from the tool to auto install the setup.

 

That being said, I will investigate the files. Oh...which script do I need to look at and correct, or maybe I'd be better asking...what file in what folder?

 

Thanks.

 

the apcupsd*.auto_install and the apcupsd*.config files in your package directory.

 

Cheers,

Matt

  • Author

Joe

 

Well,  I'm a bit embarassed...  :-[

 

While I did not edit any of the script files for the install of the APC stuff...I now remember I had edited the GO file on my first attempt to get this stuff going back before you indicated I need to upgrade my Unraid. So I upgraded my Unraid, ran the auto scripts from you utility, and it has been fine.

 

So, I did edit the go file. But, I don't know how I got the errors in that script. I had thougt I copied and pasted these 2 lines into the go script (copied from the instructions that flambot had put together):

 

CTRLALTDEL=YES LOGSAVE=30 installpkg /boot/packages/powerdown-1.02-noarch-unRAID.tgz

sysctl -w kernel.poweroff_cmd="/sbin/powerdown"

 

But that first line did have the wrong text.  I goofed it up somehow.

 

I have fixed it and all is well.

 

(I know you were thinking "That idiot did modify a file"...and that is correct . Well, maybe you didn't think 'idiot'.  ;D )

 

 

 

Hey... I make plenty of cut-and-paste errors... and other errors too...  I did not think any less of you...

 

You do not need to install the powerdown package in two places... You can leave the lines in the "go" script, or not.

 

If you have the lines to install powerdown in the "go" script, you won't need to do it in the unMENU package manager. (I think they both do the same thing)

  • Author

The reason commented in the method I wsa following stated that it was to be put in the Go Script (those 2 lines) in order for it to be loaded any time the server starts again.

 

Given that thought, might I as well pull it out of the go script?

 

 

The reason commented in the method I wsa following stated that it was to be put in the Go Script (those 2 lines) in order for it to be loaded any time the server starts again.

 

Given that thought, might I as well pull it out of the go script?

 

 

If you have a line in the "go" script that runs all the packages installed by unMENU, and you elected to install it on reboot there, then the explicit lines in the "go" script are not needed.

 

The thread describing putting those lines in the "go" script pre-dated the existence of unMENU.   If you think of it, the line you had there was not working, since it had an invalid path, yet your powerdown was working since it was installed as part of an unMENU package .conf file.

 

As with nearly everything under Linux, there are thousands of ways to do any task...  many are equally good, some easier for newcommers.  (That's why I created the package-manager plug-in for unMENU... to make it easy for folks not real familiar with Linux scripting)

 

In any case, I'm happy you are up and running.  I know I am just starting the usual springtime late-afternoon lightning storm weather pattern here in North Carolina for this season... I know I have momentary power blips... all I need to do is look at my syslog:

 

These three occurred here yesterday.  Each as a result of a momentary power interruption of a second or less.  I'm really glad I have a UPS:

Jun  3 11:52:15 Tower apcupsd[21799]: Power failure.

Jun  3 11:52:16 Tower apcupsd[21799]: Power is back. UPS running on mains.

Jun  3 17:33:52 Tower apcupsd[21799]: Power failure.

Jun  3 17:33:52 Tower apcupsd[21799]: Power is back. UPS running on mains.

Jun  3 18:12:42 Tower apcupsd[21799]: Power failure.

Jun  3 18:12:43 Tower apcupsd[21799]: Power is back. UPS running on mains.

 

Joe L.

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.