[CentOS] logrotate, syslog, and chsh
jpotter-centos at codepuppy.com
Sun Mar 11 13:17:38 UTC 2007
I'm noticing that logrotate's default configuration for rotating /var/
log/secure and /var/log/messages partially fails if root's shell is
set to /bin/tcsh (via chsh). (Running on CentOS 4.4;
What seems to be happening is that the logrotate.d/syslog postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null
Under bash, this redirects stderr to /dev/null. Under tcsh, this
produces the error:
cat: 2: No such file or directory
What happens in this scenario is that the log gets rotated, but
syslogd does not receive the SIGHUP, so nothing gets logged, at all.
(i.e. secure and messages are 0 bytes until syslog is kicked).
I'm just going to set the default shell for root back to bash, but I
wanted to ask the list if there is any general "rule of thumb" that
root's shell should be bash?
More information about the CentOS