Hello,
I have a problem with files created with omfile module.
I have this config:
# Fichero por defecto para guardar el log
template(name="default_output_file" type="string"
string="/logs/local/%$!hostname%/%$year%/%$month%/%$day%/%$!filename%")
ruleset(name="save_to_file"
) {
action(type="omfile"
name="save_to_file"
dirCreateMode="0755"
fileCreateMode="0640"
dynaFile="default_output_file"
template="defaultOutputFormat"
)
}
# Solo para probar
$RuleSet remote_udp
if $hostname == 'canis40' then {
set $!hostname = 'ldapacc.um.es' ;
set $!filename = 'ldap.log' ;
}
call save_to_file
$RuleSet RSYSLOG_DefaultRuleset
With this config logs from this host should be written to
/logs/local/ldapacc.um.es/2019/12/04/ldap.log and they are written to
this file.
The problem is that the file is created with perms 0711:
amateo_adm@pitufo30:/etc/rsyslog.d$ ls -l /logs/local/
total 1
drwx--x--x 3 syslog adm 3 dic 4 13:59 ldapacc.um.es
and file with perms 0600.
If I stop the rsyslog service and run it with "sudo rsyslogd -nd" then
files are correctly created.
But I have found that when rsyslog is run from service, it has umask
0066 and when I run it manually it has 0022. This is the only difference
I have found, although I guess that if a mode is specified in the config
file, then umask shouldn't be used.
I have rsyslog 8.1911.0 (installed from adiscon repositories) in a
ubuntu 18.04. This same config in a ubuntu 14.04 with rsyslog 8.25 is
creating files correctly.
Any help?
--
Angel L. Mateo Martínez
Sección de Telemática
Área de Tecnologías de la Información
y las Comunicaciones Aplicadas (ATICA)
http://www.um.es/atica
Tfo: 868889150
Fax: 868888337
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE
THAT.