PREIN
/bin/sh
# Because RPM doesn't know the difference between files and directories,
# we need to verify if there is no file with the same name as the directory
# to be created for the new logdir architecture.
# If the name is the same and it is a file, rename it to name.old
for f in kernel user mail daemons auth lpr news uucp cron ftp syslog; do
if [ -f "/var/log/$f" -a ! -L "/var/log/$f" ]; then
/bin/mv -f "/var/log/$f" "/var/log/$f.old" &&
/bin/mkdir "/var/log/$f" &&
/bin/mv "/var/log/$f.old" "/var/log/$f/"
fi
done ||:
# Same comment about compatibility links.
for f in alert boot.log maillog messages secure spooler; do
if [ -f "/var/log/$f" -a ! -L "/var/log/$f" ]; then
/bin/mv -f "/var/log/$f" "/var/log/$f.old"
fi
done ||:
POSTIN
/bin/sh
cd /var/log
# Create each log directory with logfiles.
for f in \
{kernel,user,mail,daemons,lpr,news,uucp,cron,ftp}/{info,warnings,errors} \
auth/{all,messages,secure} mail/all \
syslog/{messages,alert,spooler,boot,sudo}
do
if [ ! -f "$f" ]; then
:>>"$f"
/bin/chgrp adm "$f"
/bin/chmod 640 "$f"
fi
done ||: