summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/service-utils.inc
diff options
context:
space:
mode:
authordoktornotor <notordoktor@gmail.com>2015-11-21 21:46:27 +0100
committerdoktornotor <notordoktor@gmail.com>2015-11-21 21:46:27 +0100
commit6855f25d8f83338559a174bb56cb85075c1d7bc6 (patch)
treecc60a8068ff461cf476f3185199d0696a6866b07 /src/etc/inc/service-utils.inc
parentea792608e8aab65bdb8635783a394c17de5ddd17 (diff)
downloadpfsense-6855f25d8f83338559a174bb56cb85075c1d7bc6.zip
pfsense-6855f25d8f83338559a174bb56cb85075c1d7bc6.tar.gz
restart_service() - do not attempt to stop service that is not running
Attempting to stop service that's not running just produces useless log noise. BTW - dunno what was the idea behind restart_service_if_running() but it appears to be completely unused both in pfSense and in packages, suspect mainly because it doesn't make any sense as implemented.
Diffstat (limited to 'src/etc/inc/service-utils.inc')
-rw-r--r--src/etc/inc/service-utils.inc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/etc/inc/service-utils.inc b/src/etc/inc/service-utils.inc
index b40aa39..2e6e49c 100644
--- a/src/etc/inc/service-utils.inc
+++ b/src/etc/inc/service-utils.inc
@@ -155,7 +155,9 @@ function restart_service($name) {
return;
}
- stop_service($name);
+ if (is_service_running($name)) {
+ stop_service($name);
+ }
start_service($name);
if (is_array($config['installedpackages']) && is_array($config['installedpackages']['service'])) {
OpenPOWER on IntegriCloud