aboutsummaryrefslogtreecommitdiffstats
path: root/config/nut
diff options
context:
space:
mode:
authordoktornotor <notordoktor@gmail.com>2015-08-11 16:07:50 +0200
committerdoktornotor <notordoktor@gmail.com>2015-08-11 16:07:50 +0200
commitc3debb741a214f7a4774e8b5d1c6cd076b6a95e0 (patch)
tree19b7d3b8f2642ee909758bd45c5517fab4dcb269 /config/nut
parentcc096698792f9d4967521ccd7254a5659a54c747 (diff)
downloadpfsense-packages-c3debb741a214f7a4774e8b5d1c6cd076b6a95e0.tar.gz
pfsense-packages-c3debb741a214f7a4774e8b5d1c6cd076b6a95e0.tar.bz2
pfsense-packages-c3debb741a214f7a4774e8b5d1c6cd076b6a95e0.zip
nut - fix bogus boot check (hopefully fixes Bug #4426)
Diffstat (limited to 'config/nut')
-rw-r--r--config/nut/nut.inc6
1 files changed, 3 insertions, 3 deletions
diff --git a/config/nut/nut.inc b/config/nut/nut.inc
index fbc75a30..e0ca9d30 100644
--- a/config/nut/nut.inc
+++ b/config/nut/nut.inc
@@ -512,13 +512,13 @@ EOD;
$return = sync_package_nut_snmp();
}
- if ($return && $_POST['monitor']) {
- /* only start if changing settings as we have a startup script for system boot */
+ if ((!platform_booting()) && (nut_config('monitor'))) {
+ /* only start if enabled and system is not booting */
/* this prevents service from starting / stopping / starting on boot */
log_error("[nut] INFO: Starting service");
start_service("nut");
- if ((int)exec('/bin/pgrep upsmon | /usr/bin/wc -l') == 0) {
+ if (!is_process_running('upsmon')) {
log_error("[nut] ERROR: Service failed to start: check configuration.");
}
} elseif (!$return && file_exists(NUT_RCFILE)) {