From fe2eb9952ffad4949f00c4c27487906cf02793a5 Mon Sep 17 00:00:00 2001 From: Ermal Date: Tue, 5 Feb 2013 16:05:51 +0000 Subject: [PATCH] Unlink pid file before starting a new process --- etc/inc/captiveportal.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index 6f9461caa1..abdc3de4a3 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -424,12 +424,15 @@ function captiveportal_init_webgui_zone($cpcfg) { "", "", "", "lighty-{$cpzone}-CaptivePortal.pid", $listenporthttp, "/usr/local/captiveportal", "", "", $cpzone); + @unlink("{$g['varrun']}/lighty-{$cpzone}-CaptivePortal.pid"); /* attempt to start lighttpd */ $res = mwexec("/usr/local/sbin/lighttpd -f {$g['varetc_path']}/lighty-{$cpzone}-CaptivePortal.conf"); /* fire up https instance */ - if (isset($cpcfg['httpslogin'])) + if (isset($cpcfg['httpslogin'])) { + @unlink("{$g['varrun']}/lighty-{$cpzone}-CaptivePortal-SSL.pid"); $res = mwexec("/usr/local/sbin/lighttpd -f {$g['varetc_path']}/lighty-{$cpzone}-CaptivePortal-SSL.conf"); + } } /* reinit will disconnect all users, be careful! */