Jump to content

APCUPSD 3.14.10 Plugin for unRAID 5b11+


Recommended Posts

  • Replies 443
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...
  • 4 weeks later...

It appears that while you may have fixed that log refresh bug you removed the code fixing the fatal PID log rotation error.

 

The fatal PID log rotation error and the syslog refresh bug are not the same thing.

 

Starting with APCUPSD 3.14.8 to 3.14.10 every Sunday at 4:40am APCUPSD stops and restarts itself to rotate its own log (not the syslog). Unfortunately there is no delay between the stop and restart so sometimes if the pid takes too long to clear APCUPSD will not restart giving you an error similar to the following in your syslog:

 

Nov 20 04:40:01 Tower apcupsd[1701]: apcupsd exiting, signal 15

Nov 20 04:40:01 Tower apcupsd[2502]: Valid lock file for pid=1701, but not ours pid=2502

Nov 20 04:40:01 Tower apcupsd[2502]: apcupsd FATAL ERROR in apcupsd.c at line 285 Failed to acquire device lock file (Errors)

Nov 20 04:40:01 Tower apcupsd[2502]: Valid lock file for pid=1701, but not ours pid=2502

Nov 20 04:40:01 Tower apcupsd[2502]: apcupsd error shutdown completed (Errors)

Nov 20 04:40:01 Tower apcupsd[1701]: apcupsd shutdown succeeded

 

When this happens APCUPSD is no longer running. You have to manual start it again. You also could wait a week for the next rotation and it will start back up.

 

This is a bug in the APCUPSD code itself and it can't totally be fixed without changing that. It was decided by other unraid plugin coders not to fix the actual APCUPSD package as to not confuse users with a special package that may or may not be easy to locate, host go down etc. Instead  the following cron job was added to the plugin at line 583 as to delay the restart of APCUPSD

 

#Fatal pid log rotation error fix

sed -i -e "s/\$0 stop/\$0 stop\n      sleep 3/" /etc/rc.d/rc.apcupsd

 

This delays the restart long enough for the PID to clear. Also with the fix in the plugin any stock APCUPSD package could be used.

 

See the following URL for more info on the Fatal PID log rotation error.

http://lime-technology.com/forum/index.php?topic=16537.0

 

 

The issue you fixed with the syslog constantly being refreshed and being unable to scroll through is related to the plugin itself and is completly different. It's my understanding that this issue only occured when using Simple Features ( I don't know if it affects new gui). I don't have that issue with Unmenu or the stock GUI nor have I seen any reports of it in those. That's just FYI in case you may need to do some more tweaks to your fix.

 

 

Either way until that cron job is added back in there's a chance that APCUPSD will break every Sunday at 4:40am.

 

It would also probably be a good idea to change your changelog notes from:

 

2013-09-28 - Made some corrections to stop the fatal log rotation issue.

 

To something more like:

 

"Made some corrections to stop syslog refresh bug"

 

Due to the refresh bug not being fatal, nor is it technically rotating, and the fact that that wording makes it easy to confuse with the "fatal pid log rotation error" which is completely different.

 

I'll add my copy of the plugin before your changes to this post for reference. Also will copy this post to both threads referencing this plugin.

 

 

Edit: Originally put the time for the rotation as 1am instead of 4:40. Sleep dep :)

Apcupsd-3.14.10-i486-4_rlw.txt

Link to comment
  • 2 months later...

i have the APC-Smart 1500 and the only way i can get it to communicate with unraid is to edit the apcupsd.cfg file as below

 

#apcupsd configuration

SERVICE="enable"

UPSCABLE="smart"

CUSTOMUPSCABLE=""

UPSTYPE="apcsmart"

DEVICE="/dev/ttyUSB0"

BATTERYLEVEL="10"

MINUTES="10"

TIMEOUT="300"

KILLUPS="yes"

SHOWFULLSTATUS="yes"

 

the main difference is using the DEVICE ="/dev/ttyUSB0" otherwise it will not be connected.

 

EDIT: if i try to add the above using the GUI it does not work. Only editing the cfg seems to work

 

Thanks for posting this, solved my problem. In my case I use /dev/ttyS0 for the serial cable but otherwise that's how I got my APC Smarty UPS 1000 hooked up. Had to edit the cfg file directly, as you say... everything was just greyed out in the gui.

 

Cheers.

Link to comment

When I try to install the plugin I get the following error.

 

root@Tower:/boot/config/plugins# installplg Apcupsd-3.14.10-i486-4_rlw.plg

installing plugin: Apcupsd-3.14.10-i486-4_rlw

file /boot/packages/apcupsd-3.14.10-i486-4_rlw.tgz: already exists

  upgradepkg --install-new /boot/packages/apcupsd-3.14.10-i486-4_rlw.tgz ...

+==============================================================================

| Skipping package apcupsd-3.14.10-i486-4_rlw (already installed)

+==============================================================================

 

 

success

file /boot/packages/powerdown-1.02-noarch-unRAID.tgz: downloading from http://unraid-powercontrol.googlecode.com/files/powerdown-1.02-noarch-unRAID.tgz ... bad download, deleting

root@Tower:/boot/config/plugins#

 

Kevin.

 

[Edit]

 

I can download it directly from my browser with no problem.

Link to comment
  • 2 weeks later...

I wonder if anyone can help me.

 

I have installed the plg, and I can see it under Network Settings.

 

My problem is that I "Enable APC UPS Daemon", I can see "Daemon: Running" but immediately...  "Daemon: Stopped". Also UPS is always "Offline". By the way, it is a APC 650.

 

I uninstalled the plugin, rebooted, installed it again.... but can't get trough.

 

 

Can someone please help me to solve this issue?

 

Thanks

Jaime

Link to comment

Any plans to update this package to run on the 64 bit version of unRAID? 

 

I hate to even test the 64 bit package until there is some way to shut the server down gracefully in the event of a long term* power failure.

 

 

*  I am talking about  30 seconds--- in my area, if any power interruption that goes beyond 30 seconds could last for days!!!

Link to comment

Any plans to update this package to run on the 64 bit version of unRAID? 

 

I hate to even test the 64 bit package until there is some way to shut the server down gracefully in the event of a long term* power failure.

 

 

*  I am talking about  30 seconds--- in my area, if any power interruption that goes beyond 30 seconds could last for days!!!

 

+1.  Even if the majority of people on v6 offload all of their plugins to VM's, this is the one plugin that will still need to be run in unRAID itself.

Link to comment

On the v6 beta thread the following was posted

That works fine where there are maintained Slackware packages.  As far as I'm aware, no packages are maintained for apcupsd, dovecot, mpop etc.  The binaries for these have to be rebuilt for the 64-bit environment.  I already have the sources for these, and I know that it is possible to cross-compile/link, but I'd rather wait to build on the target environment in order to minimise the risk of incompatibilities.  If I have time later, I may start having a go at these by booting a one disk unRAID 6 on other hardware.

 

Definitely will be an essential plugin for unRAID

Link to comment

I already have it up and running on v6, but not fully tested through a power failure yet.  However, I do get a full status report from the UPS, so I don't believe that there will be any significant problem.

 

There is just one little quirk, and I'm not sure of the cause - if the first load of the plugin is performed automatically at boot time, the download of the apcupsd package reports 'bad download, deleting'.

 

However, invoking manually, using the installplg command, is successful!

Link to comment

I already have it up and running on v6, but not fully tested through a power failure yet.  However, I do get a full status report from the UPS, so I don't believe that there will be any significant problem.

 

There is just one little quirk, and I'm not sure of the cause - if the first load of the plugin is performed automatically at boot time, the download of the apcupsd package reports 'bad download, deleting'.

 

However, invoking manually, using the installplg command, is successful!

 

You should definitely write up some "install for dummies" instructions !!  :)

 

I suspect the issue you've found requires a "wait" command that doesn't execute the install until UnRAID has finished loading (thus there's no internet access available yet).    I'm not a Linux guy ... but I know that's fairly easy to do ... hopefully someone will chime in with a simple "how to" for that.

 

Link to comment
I suspect the issue you've found requires a "wait" command that doesn't execute the install until UnRAID has finished loading (thus there's no internet access available yet).

 

That may be true, but it's never been a problem that I've been aware of on v5.  Perhaps some oddity introduced with V6?  Perhaps I should give Tom a 'heads-up' in the announcement thread?

Link to comment

I suspect the issue you've found requires a "wait" command that doesn't execute the install until UnRAID has finished loading (thus there's no internet access available yet).

 

That may be true, but it's never been a problem that I've been aware of on v5.  Perhaps some oddity introduced with V6?  Perhaps I should give Tom a 'heads-up' in the announcement thread?

 

As I recall, There was an issue with one of the late beta or early rcX for ver 5.0 with this problem of the NIC not being completely initialized before some of the packages attempted to access the Internet.  Tom addressed the issue in the next release.  What I can't remember exactly what he did...  Remember something about fast  multiple core CPUs...  (Terrible to get old and only be able to remember bits and snatches!)

Link to comment
As I recall, There was an issue with one of the late beta or early rcX for ver 5.0 with this problem of the NIC not being completely initialized before some of the packages attempted to access the Internet.  Tom addressed the issue in the next release.  What I can't remember exactly what he did...  Remember something about fast  multiple core CPUs...  (Terrible to get old and only be able to remember bits and snatches!)

 

Okay, I have no memory of that - and if the digits in your user name are any indication of your age, then I'm a little younger than you!

 

You are, almost certainly, correct.  It may also be because my test bed is my normal desktop machine with only two drives (not in the unRAID array).  The startup process is probably completing much faster because of this.  The machine I'm using is an i5-650, so two cores with hyperthreading.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...