summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2011-03-22 20:19:16 +0000
committerErmal <eri@pfsense.org>2011-03-22 20:19:16 +0000
commitc1ac2424d2be67d363c100120616f24e15f96a05 (patch)
treedd55539879bb063812f86535b938320b1d2b252c /etc
parentc46ee61fbce7146030318d21f3a6247edf8223ec (diff)
downloadpfsense-c1ac2424d2be67d363c100120616f24e15f96a05.zip
pfsense-c1ac2424d2be67d363c100120616f24e15f96a05.tar.gz
Actually remove the pid file before starting a new miniupnpd since it seems to not like it. Log provided on:http://forum.pfsense.org/index.php/topic,33371.msg180084.html#msg180084
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/services.inc7
1 files changed, 5 insertions, 2 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index 1a03021..314a891 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -1304,10 +1304,13 @@ function configure_cron() {
function upnp_action ($action) {
switch($action) {
case "start":
- if(file_exists('/var/etc/miniupnpd.conf'))
- mwexec_bg('/usr/local/sbin/miniupnpd -f /var/etc/miniupnpd.conf');
+ if (file_exists('/var/etc/miniupnpd.conf')) {
+ @unlink("{$g['varrun_path']}/miniupnpd.pid");
+ mwexec_bg("/usr/local/sbin/miniupnpd -f /var/etc/miniupnpd.conf -P {$g['varrun_path']}/miniupnpd.pid");
+ }
break;
case "stop":
+ killbypid("{$g['varrun_path']}/miniupnpd.pid");
while((int)exec("/bin/pgrep -a miniupnpd | wc -l") > 0)
mwexec('killall miniupnpd 2>/dev/null', true);
mwexec('/sbin/pfctl -aminiupnpd -Fr 2>&1 >/dev/null');
OpenPOWER on IntegriCloud