September 28, 201312 yr This plugin is for unRAID V5.x and will not run on V6.x After spending some time working on this plugin I have discovered and finally fixed the log rotation problem. When the plugin was first installed on bootup, the page refresh logic for the APC UPS plugin somehow got applied to the log file page causing the log file to constantly refresh. I added some logic to keep this from happening if the plugin is running the initial installation. This has been a challenge to find. I've added my notes to the plugin if you are interested in how I got it fixed. Download the attached .txt file and remove the .txt file extension and then install the plugin. The attached text file is the plugin. It has to be named a .txt file because we cannot attach a .plg file. EDIT: Attached is a modified plugin for the APC UPS. I Renamed it "APC UPS" on the settings page. The "daemon" in the name is not necessary. I also added some logic to prevent messages from showing up on the attached console that are unnecessary. EDIT: Seems that there are two logging issues. One is where the apcupsd log rotation causes a problem at 4:40 AM on Sundays, and the other is a constant refresh of the syslog in the unRAID webgui. Both these issues should be fixed in the attached plugin. I have updated this plugin for powerdown 2.06. Apcupsd-3.14.10-i486-4_rlw-dl.plg.txt
September 29, 201312 yr why does it have the same version number as the previous one? I see the download option for the text file, but where is the plugin??
September 29, 201312 yr Author The text file is the plugin. We can't attach a .plg file, so it was renamed to a .txt. Download the .txt file, save it and then rename it to a plug. Then install it. I'll post a link to the unRAID plugin download for this in the first post. The state of plugins is in flux right now. Once it all settles down, we can get more formal about versions.
October 4, 201312 yr Thanks for this. So is the wiki page the same as the version posted here? Seems like it is dated back in July? The version is the same because it is the version of apcupsd itself, not the version of the plugin.
October 4, 201312 yr Author Thanks for this. So is the wiki page the same as the version posted here? Seems like it is dated back in July? Yes. I replaced the file on the wiki page, but I think it kept the original file date. It is the same as the one listed on this page. Once the plugin system settles down, I'll submit this version to Tom. Right now plugins are in a state of flux and a bit confusing.
October 6, 201312 yr just so I can confirm, what error was it? What would the entry in the syslog look like?
October 6, 201312 yr Author just so I can confirm, what error was it? What would the entry in the syslog look like? I wasn't really an error. It was just that when you wanted to look at the syslog, it would continually refresh and you couldn't scroll down the page to look at the log.
October 6, 201312 yr Oh, I hated that, but didn't realize it was this plugin causing it. ah...the little things... Thanks!
October 13, 201312 yr Received the following error early this morning and apcupsd shut itself down. Unclear to me why. Unraid kept running just fine but the apcupsd daemon was no longer running. I had no trouble manually restarting it though. Oct 13 04:40:01 tower apcupsd[20382]: apcupsd exiting, signal 15 Oct 13 04:40:02 tower apcupsd[31539]: Valid lock file for pid=20382, but not ours pid=31539 Oct 13 04:40:02 tower apcupsd[31539]: apcupsd FATAL ERROR in apcupsd.c at line 285 Failed to acquire device lock file Oct 13 04:40:02 tower apcupsd[31539]: Valid lock file for pid=20382, but not ours pid=31539 Oct 13 04:40:02 tower apcupsd[31539]: apcupsd error shutdown completed Oct 13 04:40:02 tower apcupsd[20382]: apcupsd shutdown succeeded UPS is a Cyberpower CP1000PFCLCD if it matters. Uptime is 10 days with no other issues. Any ideas on how to prevent this in the future?
October 21, 201312 yr 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:40am. Sleep dep Apcupsd-3.14.10-i486-4_rlw.txt
October 21, 201312 yr Author It seems that there are two logging issues that caused some confusion. I have modified the plugin and re-posted it to the first post. The two issues are: - syslog in unRAID webgui would do a constant refresh after a re-boot. This occurs in the stock webgui and SF. - fatal log rotation when apcupsd would rotate its log on Sundays at 4:40 AM. Hopefully this will take care of the problem(s).
October 21, 201312 yr Cheers I originally put the time for the rotation as 1am. Not sure why I put 1am but it happens at 4:40am.
December 6, 201312 yr I am using the "apcupsd-3.14.10-i486-1_rlw" version because it was the latest one listed from unMenu (until yesterday I didn't realize all we had to do to install plugins in unRaid 5 was add plugins into the correct plugin folders...). That being said is the 4_rlw version the latest version of the APC plugin we should be using?
December 7, 201312 yr Author I am using the "apcupsd-3.14.10-i486-1_rlw" version because it was the latest one listed from unMenu (until yesterday I didn't realize all we had to do to install plugins in unRaid 5 was add plugins into the correct plugin folders...). That being said is the 4_rlw version the latest version of the APC plugin we should be using? If unMenu is downloading it from the LimeTech plugins then yes. If not download the version on the first post of this topic to fix the two logging issues discussed in this post. You can confirm the version by looking at the file name in the plugins directory on your flash.
January 2, 201412 yr I installed the latest version of apcupsd on my UnRAID v5.0.4 after some tinkering I got it to start and show data. After a day it all stopped. The daemon starts and then stops again. In addition, now it said UPS "unknown" which before it was able to detect it. Not sure what happened to it but I really need to get this UPS connected to it and monitoring it. Any ideas would help. Now my section for DEVICE: is /dev/usb/hiddev1 which it found the when I did some searching. I am using a APC Back-Ups XS 1300 connected with the USB data cable. I have it set for USB, USB, /dev/usb/hiddev1, 10, 10, 300, Yes, and Yes for the settings. (ISSUE SOLVED) Ok for some reason the hiddev1 which the UPS was on went to hiddev0 after I rebooted the system. So now it is back up and running fine.
January 3, 201412 yr I have it set for USB, USB, /dev/usb/hiddev1, 10, 10, 300, Yes, and Yes for the settings. The APCUPSD manual's A Simple USB Configuration topic recommends leaving the "Device" field blank and setting the "Timeout" field to 0 (zero) for your setup. That should take care of the device changing between reboots and enables the "Battery Level" and "Minutes" settings to determine when to shutdown. Kevin
February 17, 201412 yr Thanks for the updated plugin. Was easy to get working on Dynamix, and now I can finally sleep securely!
February 28, 201412 yr Noticed this in my syslog: Feb 27 11:29:23 TheMonolith apcupsd[15444]: UPS Self Test switch to battery. Feb 27 11:29:33 TheMonolith apcupsd[15444]: UPS Self Test completed: Not supported Is this normal?
March 1, 201412 yr Just wondering what APC UPS everyone is using? Newegg reviews aren't super helpful and if I am going to spend $100+ I don't want to be disappointed. Any recommendations?
Archived
This topic is now archived and is closed to further replies.