March 31, 201412 yr Aside: never compiled anything under Slackware before so half the time was spend trying to get Slackware to run as virtual machine from iso. The other half the time was me tracking down compilation error that was due to I did not install X-windows and missing libraries the first install. Thanks very much for that tip! I've spent a few hours today trying to build 3.14.12 for unRAID 5.0.5, and I just couldn't get all the dependencies to allow it to build correctly! After reading your post and re-installing Slackware 13.1 to a new VM (~30 mins), building the package took almost no time at all.
March 31, 201412 yr Aside: never compiled anything under Slackware before so half the time was spend trying to get Slackware to run as virtual machine from iso. The other half the time was me tracking down compilation error that was due to I did not install X-windows and missing libraries the first install. Thanks very much for that tip! I've spent a few hours today trying to build 3.14.12 for unRAID 5.0.5, and I just couldn't get all the dependencies to allow it to build correctly! After reading your post and re-installing Slackware 13.1 to a new VM (~30 mins), building the package took almost no time at all. Lol yeah I was about to give up when I decided to do one more try by installing everything
March 31, 201412 yr So while I'm here on this thread, I wondered if someone could give a quick summary of the status of this plugin. I've now build an i486 Slackware package and would be happy to update the existing unRAID 5.x plugin (I've already hacked in the change from the 3.14.10 plugin on my system), but thought it best to see if there have been any major updates to the plugin besides making it 64-bit. Surely it would make sense to have identical plugins (as far as is possible) between the 32-bit and 64-bit versions of unRAID. Should I start by editing the 3.14.10-i486-4_rlw.plg plugin file on the Wiki, or the one linked in the first post of this thread; which is more up to date?
April 1, 201412 yr I built the 64-bit version from source as well and I will be creating an "apcupsd" plugin hosted in a LimeTech github repo. I will be using this plugin as an example of how to integrate with unRaid 6's plugin manager. Should be up pretty soon - in the mean time, anyone want to make a nice 48x48 icon for it?
April 1, 201412 yr I've been looking at the code of this updated 64-bit plugin, and comparing it to the 32-bit unRAID 5.0.5 plugin that was previously updated in July 2013. There doesn't appear to be a huge amount of changes, and these are nicely documented by PeterB in the file itself. It should therefore be very easy to update the 32-bit plugin to match, and that is exactly what I've done. As some of you may be aware, I've been finding and fixing bugs in the APC UPS that I have, and in order to make the apcupsd plugin work with my system, I'd already modified it to remove the /sbin/poweroff line in /etc/rc.d/rc.6 so that my system was powered off by the UPS killing power, rather than the system itself. The idea behind this is so that the unRAID server will power back on itself once power is restored. Some motherboards have a setting to automatically power up after a loss in power, but mine only has the option for 'last state', so this modification was essential for me. Having said that, I was frustrated that when I manually shut down my server, I could never really tell if it had truly shut down, because my changes had affected everything, even normal shut downs left the server fans still spinning. I took a look at the standard /etc/rc.d/rc.6 shutdown & reboot code, which by default looks like this: # Now halt (poweroff with APM or ACPI enabled kernels) or reboot. if [ "$command" = "reboot" ]; then echo "Rebooting." /sbin/reboot else /sbin/poweroff fi And with the default installation of apcupsd, is modified to look like this (assuming the configuration is set to Kill UPS) # Now halt (poweroff with APM or ACPI enabled kernels) or reboot. if [ "$command" = "reboot" ]; then echo "Rebooting." /sbin/reboot else /etc/apcupsd/apccontrol killpower; /sbin/poweroff fi As I said, my initial modification was simply to remove the /sbin/poweroff command from the end of the line, but I noticed that in every power down situation, apccontrol killpower is being called; even for a regular shutdown! As a test, I called apccontrol killpower and noticed that it fails with an error, noticing that the /etc/apcupsd/powerfail file is not present. It's good that the apcupsd software has the intelligence to look for this, but we should not be calling the killpower command if this is not a power fail shutdown event. A better modification to the /etc/rc.d/rc.6 file, would be this: # Now halt (poweroff with APM or ACPI enabled kernels) or reboot. if [ "$command" = "reboot" ]; then echo "Rebooting." /sbin/reboot else if [ -f /etc/apcupsd/powerfail ]; then /etc/apcupsd/apccontrol killpower else /sbin/poweroff fi fi This file check is actually what is recommended in the apcupsd documentation. As a nice aside, it also means that my unRAID system will properly power off when I shut it down manually. And so, to modify the plugin script...
April 1, 201412 yr Looking in the plugin script, the sections that I changed are from the function applyconfig() section of apcupsdconf.php In the code below, I have commented out the original commands, with my replacements immediately following: function applyconfig() { echo("Applying Settings..."); global $SERVICE, $UPSCABLE, $CUSTOMUPSCABLE, $UPSTYPE, $DEVICE, $BATTERYLEVEL, $MINUTES, $TIMEOUT, $KILLUPS, $newline, $log; if ($UPSCABLE == "custom") exec_log("sed -i -e '/^UPSCABLE/c\\UPSCABLE '$CUSTOMUPSCABLE'' /etc/apcupsd/apcupsd.conf"); else exec_log("sed -i -e '/^UPSCABLE/c\\UPSCABLE '$UPSCABLE'' /etc/apcupsd/apcupsd.conf"); exec_log("sed -i -e '/^UPSTYPE/c\\UPSTYPE '$UPSTYPE'' /etc/apcupsd/apcupsd.conf"); exec_log("sed -i -e '/^DEVICE/c\\DEVICE '$DEVICE'' /etc/apcupsd/apcupsd.conf"); # Modifications to correctly check for the presence of the apcupsd powerfail file, and allow for the UPS to power off the system # exec_log("! grep -q apccontrol /etc/rc.d/rc.6 && sed -i -e 's/\\/sbin\\/poweroff/\\/etc\\/apcupsd\\/apccontrol killpower; \\/sbin\\/poweroff/' /etc/rc.d/rc.6"); exec_log("! grep -q apcupsd /etc/rc.d/rc.6 && sed -i -e 's/\\/sbin\\/poweroff/if \[ -f \\/etc\\/apcupsd\\/powerfail \]\; then\\n \\/etc\\/apcupsd\\/apccontrol killpower\\n else\\n \\/sbin\\/poweroff\\n fi/' /etc/rc.d/rc.6"); exec_log("sed -i -e '/^BATTERYLEVEL/c\\BATTERYLEVEL '$BATTERYLEVEL'' /etc/apcupsd/apcupsd.conf"); exec_log("sed -i -e '/^MINUTES/c\\MINUTES '$MINUTES'' /etc/apcupsd/apcupsd.conf"); exec_log("sed -i -e '/^TIMEOUT/c\\TIMEOUT '$TIMEOUT'' /etc/apcupsd/apcupsd.conf"); if ($KILLUPS == "yes") { # exec_log("! grep -q apccontrol /etc/rc.d/rc.6 && sed -i -e 's/\\/sbin\\/poweroff/\\/etc\\/apcupsd\\/apccontrol killpower; \\/sbin\\/poweroff/' /etc/rc.d/rc.6"); exec_log("! grep -q apccontrol /etc/rc.d/rc.6 && sed -i -e '0,\\/sbin\\/poweroff/s/\\/sbin\\/poweroff/\\/etc\\/apcupsd\\/apccontrol killpower/' /etc/rc.d/rc.6"); } else { # exec_log("grep -q apccontrol /etc/rc.d/rc.6 && sed -i -e 's/\\/etc\\/apcupsd\\/apccontrol killpower; \\/sbin\\/poweroff/\\/sbin\\/poweroff/' /etc/rc.d/rc.6"); exec_log("grep -q apccontrol /etc/rc.d/rc.6 && sed -i -e 's/\\/etc\\/apcupsd\\/apccontrol killpower/\\/sbin\\/poweroff/' /etc/rc.d/rc.6"); } echo("Completed$newline"); }
April 1, 201412 yr Attached is an updated 32-bit version of the Apcupsd plugin. As usual, remove the .txt from the filename to use. This version contains the following updates since the version currently posted on the Wiki: 2013-09-28 - Made some corrections to stop the syslog log refresh issue. 2014-03-31 - Neil Robinson - Updated to apcupsd version 3.14.12, Updated Powerdown to version 2.06 2014-04-01 - Neil Robinson - Modifications to check for the apcupsd powerfail file, and allow the UPS to power off the system Does anyone know the process for validating, and then moving updated plugins to the wiki? Apcupsd-3.14.12-i486-2_nro.plg.txt
April 1, 201412 yr Attached is an updated 32-bit version of the Apcupsd plugin. As usual, remove the .txt from the filename to use. This version contains the following updates since the version currently posted on the Wiki: 2013-09-28 - Made some corrections to stop the syslog log refresh issue. 2014-03-31 - Neil Robinson - Updated to apcupsd version 3.14.12, Updated Powerdown to version 2.06 2014-04-01 - Neil Robinson - Modifications to check for the apcupsd powerfail file, and allow the UPS to power off the system Does anyone know the process for validating, and then moving updated plugins to the wiki? This appears to be the same post as is in the "APCUPSD 3.14.10 Plugin for unRAID 5b11+" Thread. And the download appears to be the same?! Was this your intent?
April 1, 201412 yr You're absolutely right Frank. I thought it was likely that 5.0.5 users might not check this thread, since it's for v6, so I posted it there. I also thought that my fixes were equally relevant here, and users here might not check there. PeterB has been actively working on the 64-bit one, not to mention that I'm not even running v6 myself, so it wouldn't be appropriate for me to update his plugin. Neil.
April 1, 201412 yr Attached is an updated 32-bit version of the Apcupsd plugin. As usual, remove the .txt from the filename to use. This version contains the following updates since the version currently posted on the Wiki: 2013-09-28 - Made some corrections to stop the syslog log refresh issue. 2014-03-31 - Neil Robinson - Updated to apcupsd version 3.14.12, Updated Powerdown to version 2.06 2014-04-01 - Neil Robinson - Modifications to check for the apcupsd powerfail file, and allow the UPS to power off the system Does anyone know the process for validating, and then moving updated plugins to the wiki? Looks good Nezil. I'm waiting for Tom to post the 64 bit APCUPSD (with the right hooks into the unRaid 6's plugin manager) to the Limetech github then we will all be able to contribute on it.
April 4, 201412 yr I built the 64-bit version from source as well and I will be creating an "apcupsd" plugin hosted in a LimeTech github repo. I will be using this plugin as an example of how to integrate with unRaid 6's plugin manager. Should be up pretty soon - in the mean time, anyone want to make a nice 48x48 icon for it? Found one here http://icones.pro/en/battery-connected-png-image.html I cropped and resized it.
April 5, 201412 yr I built the 64-bit version from source as well and I will be creating an "apcupsd" plugin hosted in a LimeTech github repo. I will be using this plugin as an example of how to integrate with unRaid 6's plugin manager. Should be up pretty soon - in the mean time, anyone want to make a nice 48x48 icon for it? Just checking back, has this been released ?
April 8, 201412 yr If you want a standard plugin that works with unRAID 6 b4 in the meantime, you can download this plugin and package I modified. put the plg in: /boot/config/plugins put the pkg in: /boot/packages https://dl.dropboxusercontent.com/u/34561199/apcupsd-3.14.10-x86_64-1_rlw.plg https://dl.dropboxusercontent.com/u/34561199/apcupsd-3.14.10-x86_64-1_rlw.txz
April 8, 201412 yr If you want a standard plugin that works with unRAID 6 b4 in the meantime, you can download this plugin and package I modified. put the plg in: /boot/config/plugins put the pkg in: /boot/packages https://dl.dropboxusercontent.com/u/34561199/apcupsd-3.14.10-x86_64-1_rlw.plg https://dl.dropboxusercontent.com/u/34561199/apcupsd-3.14.10-x86_64-1_rlw.txz How is this different than the one PeterB has in the OP?
April 8, 201412 yr Author If you want a standard plugin that works with unRAID 6 b4 in the meantime, you can download this plugin and package I modified. put the plg in: /boot/config/plugins put the pkg in: /boot/packages https://dl.dropboxusercontent.com/u/34561199/apcupsd-3.14.10-x86_64-1_rlw.plg https://dl.dropboxusercontent.com/u/34561199/apcupsd-3.14.10-x86_64-1_rlw.txz How is this different than the one PeterB has in the OP? Just what I was wondering! My version seems to be working okay for me in b4, through more than ten power outages.
April 9, 201412 yr Oops. I suppose it would pay to read the OP. Nothing to see here. Move along people.
April 9, 201412 yr Newbie question, what is the best way to REMOVE this plugin ? Is there a command line option ? or another preferred method ? When LimeTech officially releases their version, I assume it's best I remove this before installing anything else ? Much appreciated. I managed to compile and updated version APCUPSD to version 3.14.12. This was done on a fresh install of 64 bit Slackware 14.1 (as a Xen VM) using default settings of apcupsd.SlackBuild (except I changed the version number) from SlackBuilds Repository and the source code from http://www.apcupsd.com. The compiled package file is located here (hosted by Dropbox). I also modified the PLG file (attached below the message). I tested it on my Unraid 6 beta4 server and it seems to install and work okay. Since I don't have a more permanent hosting solution if anyone has a better host feel free to host the file and modify the PLG file. (Dropbox limits to 10GB of bandwidth per day) Aside: never compiled anything under Slackware before so half the time was spend trying to get Slackware to run as virtual machine from iso. The other half the time was me tracking down compilation error that was due to I did not install X-windows and missing libraries the first install.
April 10, 201412 yr See: http://lime-technology.com/wiki/index.php/Install_plugins Basically delete the .PLG file and then reboot the server. This is standard procedure for removing any plugin. Newbie question, what is the best way to REMOVE this plugin ? Is there a command line option ? or another preferred method ? When LimeTech officially releases their version, I assume it's best I remove this before installing anything else ? Much appreciated.
April 15, 201412 yr I built the 64-bit version from source as well and I will be creating an "apcupsd" plugin hosted in a LimeTech github repo. I will be using this plugin as an example of how to integrate with unRaid 6's plugin manager. Should be up pretty soon - in the mean time, anyone want to make a nice 48x48 icon for it? Any idea when this might be released? I'm just now moving to v6b4, and would prefer to use the LIME plugin over a third party version. No offense to the OP, and, in fact, than you very much for doing this, but I suspect a LIME supported version will be more functional/supported/future-proof.
April 17, 201412 yr Has anyone else been able to install APC from the OP on unRAID6 beta4? It installs when I type "installplg" and I can see the icon in settings; however, it will not let me save any changes to UPS Cable or UPS Type. I will make the changes and click save but then it changes back to the original settings of "usb" instead of "start". I then attempted to manually make the changes to the .cfg file and that does save; however, ACP will not start. Anyone else have this issue?
April 17, 201412 yr Has anyone else been able to install APC from the OP on unRAID6 beta4? It installs when I type "installplg" and I can see the icon in settings; however, it will not let me save any changes to UPS Cable or UPS Type. I will make the changes and click save but then it changes back to the original settings of "usb" instead of "start". I then attempted to manually make the changes to the .cfg file and that does save; however, ACP will not start. Anyone else have this issue? There is a change in php in unRAID that is causing this problem.
April 17, 201412 yr There is a change in php in unRAID that is causing this problem. Is there a workaround that anyone have found to fix the issue?
April 17, 201412 yr The workaround I found (and I'm sure there are better options). Is to install the plugin. Then open up a telnet session to unraid and run /etc/rc.d/rc.apcupsd start, then do an apply in the GUI for the plugin, and this seems to solve the problem. If I don't do the apply in the GUI, the service seems to stop after a few seconds.
April 17, 201412 yr I updated the unMenu APC package to use the OP's x64 bit packages and it installs fine. If anyone wants to use APC through unMenu here are the links: http://lime-technology.com/forum/index.php?topic=27051.msg302951#msg302951
Archived
This topic is now archived and is closed to further replies.