aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authork-paulius <k.dash.paulius@gmail.com>2015-03-29 17:14:37 -0500
committerk-paulius <k.dash.paulius@gmail.com>2015-07-12 15:08:40 -0500
commitf3bb65f461fa169c53dd874171f32f6e88be2223 (patch)
treeaeac398e644ed88388ba4f2e10310b48aa207c28
parentae468a83cffa233f56042886a2d57de384916357 (diff)
downloadpfsense-packages-f3bb65f461fa169c53dd874171f32f6e88be2223.tar.gz
pfsense-packages-f3bb65f461fa169c53dd874171f32f6e88be2223.tar.bz2
pfsense-packages-f3bb65f461fa169c53dd874171f32f6e88be2223.zip
Be more graceful about process termination
-rw-r--r--config/freeradius2/freeradius.inc10
1 files changed, 9 insertions, 1 deletions
diff --git a/config/freeradius2/freeradius.inc b/config/freeradius2/freeradius.inc
index 1aed5010..8472ea5e 100644
--- a/config/freeradius2/freeradius.inc
+++ b/config/freeradius2/freeradius.inc
@@ -76,7 +76,15 @@ if ($pfs_version == "2.2") {
}
function freeradius_deinstall_command() {
- exec("killall -9 radiusd");
+ $pidFile = "/var/run/radiusd.pid";
+ $i = 0;
+
+ while (isvalidpid($pidFile) && $i < 3) {
+ $sig = ($i == 2 ? SIGKILL : SIGTERM);
+ sigkillbypid($pidFile, $sig);
+ sleep(1);
+ $i++;
+ }
return;
}