From 7b2c22a956546f7b1b0ba48e1477be4802f55dc7 Mon Sep 17 00:00:00 2001 From: Ermal Date: Tue, 5 Feb 2013 16:07:17 +0000 Subject: Unlink pid file before starting a new process --- etc/inc/captiveportal.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'etc') diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index 4f6fb3e..8b1381b 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -416,12 +416,15 @@ function captiveportal_init_webgui() { "", "", "", "lighty-CaptivePortal.pid", "8000", "/usr/local/captiveportal/", "cert-portal.pem", "ca-portal.pem", 1, true); + @unlink("{$g['varrun_path']}/lighty-CaptivePortal.pid"); /* attempt to start lighttpd */ $res = mwexec("/usr/local/sbin/lighttpd -f {$g['varetc_path']}/lighty-CaptivePortal.conf"); /* fire up https instance */ - if (isset($config['captiveportal']['httpslogin'])) + if (isset($config['captiveportal']['httpslogin'])) { + @unlink("{$g['varrun_path']}/lighty-CaptivePortal-SSL.pid"); $res = mwexec("/usr/local/sbin/lighttpd -f {$g['varetc_path']}/lighty-CaptivePortal-SSL.conf"); + } } /* reinit will disconnect all users, be careful! */ -- cgit v1.1