summaryrefslogtreecommitdiffstats
path: root/etc/inc/service-utils.inc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2011-05-17 21:47:20 +0000
committerErmal <eri@pfsense.org>2011-05-17 21:47:20 +0000
commit098820e224964ac8e2a93e8e4cb5ebe866ad258d (patch)
tree24a44b6ea645398fbe65847c27ef188d81b6478e /etc/inc/service-utils.inc
parent67d78c87c95cb45e305bbb07596f99d5b4bc1a13 (diff)
downloadpfsense-098820e224964ac8e2a93e8e4cb5ebe866ad258d.zip
pfsense-098820e224964ac8e2a93e8e4cb5ebe866ad258d.tar.gz
Ticket #1534. Check if a rc file exists before trying to run it. Also return if we execute a stop command through rc file to be consistent with the start_service function.
Diffstat (limited to 'etc/inc/service-utils.inc')
-rw-r--r--etc/inc/service-utils.inc5
1 files changed, 4 insertions, 1 deletions
diff --git a/etc/inc/service-utils.inc b/etc/inc/service-utils.inc
index 895eb57..4c09899 100644
--- a/etc/inc/service-utils.inc
+++ b/etc/inc/service-utils.inc
@@ -122,7 +122,10 @@ function stop_service($name) {
if(!empty($service['prefix'])) {
$prefix =& $service['prefix'];
}
- mwexec_bg("{$prefix}{$service['rcfile']} stop");
+ if(file_exists("{$prefix}{$service['rcfile']}")) {
+ mwexec_bg("{$prefix}{$service['rcfile']} stop");
+ }
+ return;
}
if (!empty($service['stopcmd']))
eval($service['stopcmd']);
OpenPOWER on IntegriCloud