mirror of https://github.com/mikaku/Monitorix.git
upon receipt of a SIGHUP do nothing if the log file is not specified #268
This commit is contained in:
parent
80217b1420
commit
45de1df780
|
@ -75,12 +75,14 @@ sub HUP_handler {
|
||||||
logger("SIG$signal caught.");
|
logger("SIG$signal caught.");
|
||||||
|
|
||||||
# upon receiving SIGHUP a new logfile is opened
|
# upon receiving SIGHUP a new logfile is opened
|
||||||
|
if($config{log_file}) {
|
||||||
close(STDOUT);
|
close(STDOUT);
|
||||||
close(STDERR);
|
close(STDERR);
|
||||||
open(STDOUT, ">> $config{log_file}") || logger("Can't write to LOG: $!");
|
open(STDOUT, ">> $config{log_file}") || logger("Can't write to LOG: $!");
|
||||||
open(STDERR, ">> $config{log_file}") || logger("Can't write to LOG: $!");
|
open(STDERR, ">> $config{log_file}") || logger("Can't write to LOG: $!");
|
||||||
chmod(0600, $config{log_file});
|
chmod(0600, $config{log_file});
|
||||||
logger("$myself: opening a new log file.");
|
logger("$myself: opening a new log file.");
|
||||||
|
}
|
||||||
|
|
||||||
# restart HTTP built-in
|
# restart HTTP built-in
|
||||||
if(lc($config{httpd_builtin}->{enabled} || "") eq "y") {
|
if(lc($config{httpd_builtin}->{enabled} || "") eq "y") {
|
||||||
|
|
Loading…
Reference in New Issue