The following piece of the /etc/rc.d/rc.sysinit script does not work
satisfactory when the directories in question are empty:
# Clean up /var
# I'd use find, but /usr may not be mounted.
for afile in /var/lock/* /var/run/*; do
if [ -d $afile ]; then
rm -f $afile/*
rm -f $afile
The if-condition should instead be written
if [ -d "$afile" ]; then
The warning that is displayed is perfectly harmless but still annoying
since the user can't really know that it is this harmless...! ;-)
Will be fixed in initscripts-4.85 when it's released.