Rotated /dev/null

Bug #617437 reported by Travis Hampton on 2010-08-13
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
logrotate (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: logrotate

This morning I started getting the following error:
  sh: cannot create /dev/null: Permission denied

I then ran ls -al /dev/null*
-rw-r--r-- 1 root root 49 2010-08-13 10:56 /dev/null
crw-rw-rw- 1 root root 1, 3 2010-08-09 15:49 /dev/null.1

Looked to me like /dev/null had been rotated. So I looked at logrotate's status file and "/dev/null" and "/etc/init.d/apache2" was in there with yesterday's date. I also noticed there was some other weird entries in the file. I looked in /etc/logrotate.d/ and found the apache2 file. I then discovered I hadn't purged apache's config files when I removed apache2. At this point I assumed the left over config file was the issue as it was the only config file that contained all the items that where being rotated.

cat /var/lib/logrotate/status | grep -v /var/log
logrotate state -- version 2
"fi" 2010-5-25
"/dev/null" 2010-8-12
"/etc/init.d/apache2" 2010-8-12
"}" 2010-5-25
"endscript" 2010-5-25
">" 2010-5-25
"reload" 2010-5-25

dpkg --list | grep apache2
rc apache2.2-common 2.2.14-5ubuntu8 Apache HTTP Server common files

/etc/logrotate.d/apache2:
/var/log/apache2/*.log {
  weekly
  missingok
  rotate 52
  compress
  delaycompress
  notifempty
  create 640 root adm
  sharedscripts
  postrotate
    if [ -f "`. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}`" ]; then
      /etc/init.d/apache2 reload > /dev/null
    fi
  endscript
}

*added additional info

dazza5000 (darran-kelinske) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Unfortunately, we cannot work on this bug because your description didn't include enough information. You may find it helpful to read "How to report bugs effectively" http://www.chiark.greenend.org.uk/~sgtatham/bugs.html. We'd be grateful if you would then provide a more complete description of the problem.

We have instructions on debugging some types of problems at http://wiki.ubuntu.com/DebuggingProcedures

At a minimum, we need:
1. the specific steps or actions you took that caused you to encounter the problem,
2. the behavior you expected, and
3. the behavior you actually encountered (in as much detail as possible).
Thanks!

Travis Hampton (hampton-travis) wrote :

This morning I started getting the following error:
  sh: cannot create /dev/null: Permission denied

I then ran ls -al /dev/null*
-rw-r--r-- 1 root root 49 2010-08-13 10:56 /dev/null
crw-rw-rw- 1 root root 1, 3 2010-08-09 15:49 /dev/null.1

Looked to me like /dev/null had been rotated. So I looked at logrotate's status file and "/dev/null" and "/etc/init.d/apache2" was in there with yesterday's date. I also noticed there was some other weird entries in the file. I looked in /etc/logrotate.d/ and found the apache2 file. I then discovered I hadn't purged apache's config files when I removed apache2. At this point I assumed the left over config file was the issue as it was the only config file that contained all the items that where being rotated.

description: updated
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers