Allow configuration of default user and group for new log files https://github.com/webmin/webmin/issues/1747

This commit is contained in:
Jamie Cameron
2022-09-23 23:37:44 -07:00
parent 7b1d70d620
commit 90c23f6a1e
2 changed files with 5 additions and 1 deletions

View File

@@ -22,3 +22,5 @@ start_cmd=Command to start syslog,3,Just run server
restart_cmd=Command to apply changes,3,Kill and re-start server
signal_cmd=Command to re-open log files,3,Send HUP signal
tail_cmd=Tail command and arguments,3,Default (tail -n LINES)
log_user=Owner for new log files,3,root
log_group=Group for new log files,3,Based on owner

View File

@@ -181,7 +181,9 @@ else {
open(FILE, ">>$in{'file'}") ||
&error(&text('save_efile', $in{'file'}, $!));
close(FILE);
&system_logged("chmod go-wx ".quotemeta($in{'file'}));
my $user = $config{'log_user'} || 'root';
my $group = $config{'log_group'};
&set_ownership_permissions($user, $group, 644, $in{'file'});
$log->{'file'} = $in{'file'};
$log->{'sync'} = $in{'sync'};
}