summaryrefslogtreecommitdiffstats
path: root/etc/inc/service-utils.inc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2013-01-03 10:25:53 +0000
committerErmal <eri@pfsense.org>2013-01-03 10:25:53 +0000
commit170986412e98a4ba430f5c2a742d5c68421116ee (patch)
tree790902ce02212eb2d06e2d9eb8942290144729fb /etc/inc/service-utils.inc
parente3c4516b2cc0aa031885dbbe05e8b52b4311cc2d (diff)
downloadpfsense-170986412e98a4ba430f5c2a742d5c68421116ee.zip
pfsense-170986412e98a4ba430f5c2a742d5c68421116ee.tar.gz
Make is_pid_running function return more conisten results by using isvalidpid
Diffstat (limited to 'etc/inc/service-utils.inc')
-rw-r--r--etc/inc/service-utils.inc5
1 files changed, 2 insertions, 3 deletions
diff --git a/etc/inc/service-utils.inc b/etc/inc/service-utils.inc
index 0b0ddd9..f62952c 100644
--- a/etc/inc/service-utils.inc
+++ b/etc/inc/service-utils.inc
@@ -173,9 +173,8 @@ function restart_service($name) {
function is_pid_running($pidfile) {
if (!file_exists($pidfile))
return false;
- $running = shell_exec("/bin/pgrep -F {$pidfile} 2>/dev/null");
- return (!empty($running));
+ return (isvalidpid($pidfile));
}
function is_dhcp_running($interface) {
@@ -472,4 +471,4 @@ function get_service_control_links($service, $addname = false) {
}
return $output;
}
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud