diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 6575ec6fe4..217e133e62 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -1388,8 +1388,13 @@ sub pandora_start_log ($){ # Dump all errors to errorlog open (STDERR, ">> " . $pa_config->{'errorlog_file'}) or die " [ERROR] " . pandora_get_initial_product_name() . " can't write to Errorlog. Aborting : \n $! \n"; - my $mode = 0664; + + my $file_mode = (stat($pa_config->{'errorlog_file'}))[2] & 0777; + my $min_mode = 0664; + my $mode = $file_mode | $min_mode; + chmod $mode, $pa_config->{'errorlog_file'}; + print STDERR strftime ("%Y-%m-%d %H:%M:%S", localtime()) . ' - ' . $pa_config->{'servername'} . " Starting " . pandora_get_initial_product_name() . " Server. Error logging activated.\n"; }