diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-09-30 01:44:50 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-09-30 01:44:50 +0000 |
commit | 4685e46446f44300cddeff1438e78933729af6a8 (patch) | |
tree | 8a60623c7e74cc219285c941ea683e3bd52559d8 /etc/inc | |
parent | 1dec547bf945338e7ee9ffadd9f864ce5cc3a978 (diff) | |
download | pfsense-4685e46446f44300cddeff1438e78933729af6a8.zip pfsense-4685e46446f44300cddeff1438e78933729af6a8.tar.gz |
Correctly start services from /usr/local/etc/rc.d/ first before any other method
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/service-utils.inc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/etc/inc/service-utils.inc b/etc/inc/service-utils.inc index 1880bdc..ff8c03d 100644 --- a/etc/inc/service-utils.inc +++ b/etc/inc/service-utils.inc @@ -49,7 +49,7 @@ function write_rcfile($params) { $tokill = array_pop(explode('/', array_shift(explode(' ', $params['start'])))); } $towrite .= "rc_stop() {\n\t" . $tokill . "\n}\n\n"; - + /* begin rcfile logic */ $towrite .= "case $1 in\n\tstart)\n\t\trc_start\n\t\t;;\n\tstop)\n\t\trc_stop\n\t\t;;\n\trestart)\n\t\trc_stop\n\t\trc_start\n\t\t;;\nesac\n\n"; $fout = fopen($fileprefix . $params['file'], "w"); @@ -63,6 +63,11 @@ function start_service($name) { global $config; /* make sure service is stopped before starting */ stop_service($name); + sleep(1); + if(file_exists("/usr/local/etc/rc.d/{$name}.sh")) { + exec("/usr/local/etc/rc.d/{$name}.sh start"); + return; + } if($config['installedpackages']['service']) { foreach($config['installedpackages']['service'] as $service) { if(strtolower($service['name']) == strtolower($name)) { @@ -147,7 +152,7 @@ function is_dhcp_running($interface) { function restart_service_if_running($service) { global $config; - if(is_service_running($service)) + if(is_service_running($service)) restart_service($service); return; } |