aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2014-04-28 08:05:18 +0000
committerErmal <eri@pfsense.org>2014-04-28 08:05:18 +0000
commite116c7c7697858fa319f4fae1e8fa4e0912e80f1 (patch)
tree73d03721b48ee52dfb91f687ec5c33312516b591
parent7003a36d5d444b7454ea72fc8d61bc98cddee541 (diff)
parenta3d74723c2bc677f2b6c2f715f8b4cd9a213e791 (diff)
downloadpfsense-packages-e116c7c7697858fa319f4fae1e8fa4e0912e80f1.tar.gz
pfsense-packages-e116c7c7697858fa319f4fae1e8fa4e0912e80f1.tar.bz2
pfsense-packages-e116c7c7697858fa319f4fae1e8fa4e0912e80f1.zip
Merge pull request #647 from dbaio/master
-rw-r--r--config/apcupsd/apcupsd.conf.php2
-rw-r--r--config/apcupsd/apcupsd.inc7
-rw-r--r--config/apcupsd/apcupsd.xml9
-rw-r--r--pkg_config.10.xml2
-rw-r--r--pkg_config.8.xml2
-rw-r--r--pkg_config.8.xml.amd642
6 files changed, 19 insertions, 5 deletions
diff --git a/config/apcupsd/apcupsd.conf.php b/config/apcupsd/apcupsd.conf.php
index 7a0340cd..7b6096bc 100644
--- a/config/apcupsd/apcupsd.conf.php
+++ b/config/apcupsd/apcupsd.conf.php
@@ -122,7 +122,7 @@ POLLTIME {$polltime}
# LOCKFILE <path to lockfile>
# Path for device lock file. Not used on Win32.
-LOCKFILE /var/spool/lock
+LOCKFILE {$lockfile}
# SCRIPTDIR <path to script directory>
# Directory in which apccontrol and event scripts are located.
diff --git a/config/apcupsd/apcupsd.inc b/config/apcupsd/apcupsd.inc
index a2b8d2ff..3340738a 100644
--- a/config/apcupsd/apcupsd.inc
+++ b/config/apcupsd/apcupsd.inc
@@ -153,6 +153,7 @@ function sync_package_apcupsd(){
$nisport=($apcupsd_config['nisport'] != ''? $apcupsd_config['nisport'] : "3551");
$upsclass=$apcupsd_config['upsclass'];
$upsmode=$apcupsd_config['upsmode'];
+ $lockfile=($apcupsd_config['lockfile'] != ''? $apcupsd_config['lockfile'] : "/var/tmp");
include("/usr/local/pkg/apcupsd.conf.php");
file_put_contents(APCUPSD_BASE . "/etc/apcupsd/apcupsd.conf", $apcupsdconf, LOCK_EX);
@@ -163,6 +164,12 @@ function sync_package_apcupsd(){
$apcupsd_rcfile="/usr/local/etc/rc.d/apcupsd.sh";
if (is_array($apcupsd_config) && $apcupsd_config['apcupsdenabled']=="on"){
$apcupsd_start = "echo \"Starting APC UPS Daemon...\"\n";
+ $apcupsd_start .= " if [ ! -d {$lockfile} ]; then \n";
+ $apcupsd_start .= " /bin/mkdir -p {$lockfile} \n";
+ $apcupsd_start .= " fi \n";
+ $apcupsd_start .= " if [ -f {$lockfile}/LCK.. ]; then \n";
+ $apcupsd_start .= " /bin/rm -f {$lockfile}/LCK.. \n";
+ $apcupsd_start .= " fi \n";
if ($apcupsd_config['killonpowerfail']=="on"){
$apcupsd_start .= " " . APCUPSD_BASE . "/sbin/apcupsd --kill-on-powerfail";
}else{
diff --git a/config/apcupsd/apcupsd.xml b/config/apcupsd/apcupsd.xml
index e69344fc..3ed95a7a 100644
--- a/config/apcupsd/apcupsd.xml
+++ b/config/apcupsd/apcupsd.xml
@@ -40,7 +40,7 @@
<name>Apcupsd</name>
<title>Services: Apcupsd (General)</title>
<category>Monitoring</category>
- <version>0.2</version>
+ <version>0.3</version>
<include_file>/usr/local/pkg/apcupsd.inc</include_file>
<addedit_string>Apcupsd has been created/modified.</addedit_string>
<delete_string>Apcupsd has been deleted.</delete_string>
@@ -198,6 +198,13 @@ UPSTYPE DEVICE Description <br>
<type>checkbox</type>
</field>
<field>
+ <fielddescr>Lock File</fielddescr>
+ <fieldname>lockfile</fieldname>
+ <description>Path for device lock file. Default is /var/tmp</description>
+ <type>input</type>
+ <size>60</size>
+ </field>
+ <field>
<name>Configuration parameters used during power failures</name>
<type>listtopic</type>
</field>
diff --git a/pkg_config.10.xml b/pkg_config.10.xml
index ec5362ff..2fa245e8 100644
--- a/pkg_config.10.xml
+++ b/pkg_config.10.xml
@@ -1534,7 +1534,7 @@
<descr>Set of programs for controlling APC UPS.</descr>
<category>Services</category>
<config_file>https://packages.pfsense.org/packages/config/apcupsd/apcupsd.xml</config_file>
- <version>apcupsd-3.14.10_1 pkg v0.2</version>
+ <version>apcupsd-3.14.10_1 pkg v0.3</version>
<status>BETA</status>
<required_version>2.2</required_version>
<configurationfile>apcupsd.xml</configurationfile>
diff --git a/pkg_config.8.xml b/pkg_config.8.xml
index 13a8c560..fa44d673 100644
--- a/pkg_config.8.xml
+++ b/pkg_config.8.xml
@@ -1981,7 +1981,7 @@
<descr>Set of programs for controlling APC UPS.</descr>
<category>Services</category>
<config_file>https://packages.pfsense.org/packages/config/apcupsd/apcupsd.xml</config_file>
- <version>apcupsd-3.14.10_1 pkg v0.2</version>
+ <version>apcupsd-3.14.10_1 pkg v0.3</version>
<status>BETA</status>
<required_version>2.0</required_version>
<configurationfile>apcupsd.xml</configurationfile>
diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64
index d1c7776f..f283c712 100644
--- a/pkg_config.8.xml.amd64
+++ b/pkg_config.8.xml.amd64
@@ -1968,7 +1968,7 @@
<descr>Set of programs for controlling APC UPS.</descr>
<category>Services</category>
<config_file>https://packages.pfsense.org/packages/config/apcupsd/apcupsd.xml</config_file>
- <version>apcupsd-3.14.10_1 pkg v0.2</version>
+ <version>apcupsd-3.14.10_1 pkg v0.3</version>
<status>BETA</status>
<required_version>2.0</required_version>
<configurationfile>apcupsd.xml</configurationfile>