0

I have the following configuration file in "/etc/rsyslog.d/10-my.conf"

# This file is managed by Puppet, changes may be overwritten
if $programname == 'hello' then -/var/log/test/test.log
& ~

On CentOS6.5 (rsyslog 5.8.10 ) this creates an empty file in /var/log/test/test.log Same configuration file on CentOS7(rsyslog 7.4.7) doesn't create an empty file.
Anyone can tell why is that? Did this behavior change in 7.4? Or is it something on my CentOS7 instance?
rsyslogd -f/etc/rsyslog.d/10-my.conf -N3
On CentOS6 and CentOS7 returns whole bunch of warnings but nothing serious.
CentOS7 SELinux is set to Permissive mode
CentOS 7 (/etc/rsyslog.conf)

# file is managed by puppet
#################
#### MODULES ####
#################

$ModLoad imuxsock # provides support for local system logging
$ModLoad imjournal # provides access to the systemd journal   

###########################
#### GLOBAL DIRECTIVES ####
###########################
$MaxMessageSize 2k

#
# Set the default permissions for all log files.
#
$FileOwner root
$FileGroup root
$FileCreateMode 0600
$DirOwner root
$DirGroup root
$DirCreateMode 0750
$PrivDropToUser root
$PrivDropToGroup root
$WorkDirectory /var/lib/rsyslog
$Umask 0000

# Turn off message reception via local log socket;
# local messages are retrieved through imjournal now.
$OmitLocalLogging on

$IncludeConfig /etc/rsyslog.d/*.conf

#
# Emergencies are sent to everybody logged in.
#
*.emerg :omusrmsg:*

1 Answer 1

0

As expected it turns out that default behaviour changed in 7.4 and it doesn't create an empty file anymore, however works fine(e.g create a test.log file) if you test it using the following command:

logger -t hello "Test"

Version 5.8 does create an empty file but still works fine if this file(/var/log/test/test.log) was deleted.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .