From 5258cd801edee2afe9b1bceacb4c7cfca3dc9357 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Fri, 11 Sep 2015 08:21:45 +0200 Subject: sshdcond - 2.1.x compatible boot check --- config/sshdcond/sshdcond.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/sshdcond/sshdcond.inc b/config/sshdcond/sshdcond.inc index c7c19291..9c3a8bb9 100644 --- a/config/sshdcond/sshdcond.inc +++ b/config/sshdcond/sshdcond.inc @@ -62,7 +62,11 @@ function sshdcond_custom_php_write_config() { global $g, $config, $pkg_interface; /* Detect boot process, do nothing during boot. */ - if (platform_booting()) { + if (function_exists("platform_booting")) { + if (platform_booting()) { + return; + } + } elseif ($g['booting']) { return; } -- cgit v1.2.3 From 83fcddda48f441d4a8172eb429b3f8f5100af8e4 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Fri, 11 Sep 2015 08:25:15 +0200 Subject: ipguard - 2.1.x compatible boot check --- config/ipguard/ipguard.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/ipguard/ipguard.inc b/config/ipguard/ipguard.inc index 53284c96..68e08e9f 100644 --- a/config/ipguard/ipguard.inc +++ b/config/ipguard/ipguard.inc @@ -41,7 +41,11 @@ function ipguard_custom_php_write_config() { global $g, $config; /* Detect boot process and do nothing */ - if (platform_booting()) { + if (function_exists("platform_booting")) { + if (platform_booting()) { + return; + } + } elseif ($g['booting']) { return; } -- cgit v1.2.3 From 57f1f5ab8e8c5b9e3446b1c1f773b52248e7f9a1 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Fri, 11 Sep 2015 08:28:45 +0200 Subject: lcdproc-dev - 2.1.x compatible boot check --- config/lcdproc-dev/lcdproc.inc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'config') diff --git a/config/lcdproc-dev/lcdproc.inc b/config/lcdproc-dev/lcdproc.inc index e9656afd..2282d4e3 100644 --- a/config/lcdproc-dev/lcdproc.inc +++ b/config/lcdproc-dev/lcdproc.inc @@ -139,12 +139,14 @@ function sync_package_lcdproc_screens() { } function sync_package_lcdproc() { - global $g; - global $config; - global $input_errors; + global $g, $config, $input_errors; # Detect boot process - if (platform_booting()) { + if (function_exists("platform_booting")) { + if (platform_booting()) { + return; + } + } elseif ($g['booting']) { return; } -- cgit v1.2.3 From 8db0d25c53d4d49e6740eed2d7bb24ddecc48849 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Fri, 11 Sep 2015 08:35:14 +0200 Subject: sarg - 2.1.x compatible boot check --- config/sarg/sarg.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/sarg/sarg.inc b/config/sarg/sarg.inc index 446b5f82..85410560 100644 --- a/config/sarg/sarg.inc +++ b/config/sarg/sarg.inc @@ -192,7 +192,11 @@ function sync_package_sarg() { global $config, $g, $sarg_proxy; // detect boot process - if (platform_booting()) { + if (function_exists("platform_booting")) { + if (platform_booting()) { + return; + } + } elseif ($g['booting']) { return; } -- cgit v1.2.3 From 46ddb5b2270dd1aaa2e56a76ebb363fe3de6b47c Mon Sep 17 00:00:00 2001 From: doktornotor Date: Fri, 11 Sep 2015 08:38:52 +0200 Subject: squid - 2.1.x compatible boot check --- config/squid/squid.inc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/squid/squid.inc b/config/squid/squid.inc index 27bff27b..5a0946bb 100644 --- a/config/squid/squid.inc +++ b/config/squid/squid.inc @@ -543,10 +543,15 @@ function squid_validate_auth($post, &$input_errors) { } function squid_install_cron($should_install) { - global $config; - if (platform_booting()) { + global $g, $config; + if (function_exists("platform_booting")) { + if (platform_booting()) { + return; + } + } elseif ($g['booting']) { return; } + parse_config(true); if (is_array($config['installedpackages']['squidcache'])) { -- cgit v1.2.3 From c4cbd93281bebf93e411ba1d21a94260804376e0 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Fri, 11 Sep 2015 08:57:38 +0200 Subject: nut - 2.1.x compatible boot check Another code simplification... --- config/nut/nut.inc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'config') diff --git a/config/nut/nut.inc b/config/nut/nut.inc index 71b06932..a864b965 100644 --- a/config/nut/nut.inc +++ b/config/nut/nut.inc @@ -492,8 +492,7 @@ EOD; } function sync_package_nut() { - global $config; - global $input_errors; + global $g, $config, $input_errors; stop_service("nut"); @@ -509,10 +508,12 @@ EOD; $return = sync_package_nut_snmp(); } - if ((!platform_booting()) && (nut_config('monitor'))) { - /* only start if enabled and system is not booting */ - /* this prevents service from starting / stopping / starting on boot */ - + /* only start if enabled and system is not booting */ + /* this prevents service from starting / stopping / starting on boot */ + if ((function_exists("platform_booting")) && (!platform_booting()) && (nut_config('monitor'))) { + log_error("[nut] INFO: Starting service"); + start_service("nut"); + } elseif ((!($g['booting'])) && (nut_config('monitor'))) { log_error("[nut] INFO: Starting service"); start_service("nut"); } elseif (!$return && file_exists(NUT_RCFILE)) { -- cgit v1.2.3