Unlink pid file before starting a new process

This commit is contained in:
Ermal 2013-02-05 16:05:51 +00:00
parent a11bc49704
commit fe2eb9952f

View File

@ -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! */