Search code examples
ubuntulogrotate

error: error creating state file /var/lib/logrotate/status: Permission denied


Trying to use logrotate and I get the following error when I run the log rotate script for a particular definition in logrotate.d

error: error creating state file /var/lib/logrotate/status: Permission denied

/var/lib/logrotate$ ls -lah
total 12K
drwxr-xr-x  2 root root 4.0K 2012-05-11 06:25 .
drwxr-xr-x 43 root root 4.0K 2012-05-18 08:07 ..
-rw-r--r--  1 root root  911 2012-05-25 06:25 status

I haven't touched that path, so I wonder why it would create an error by default...


Solution

  • Are you sure you run this command as root...? ;) If so please check if there is an AppArmour on the system - if yes check it's configuration or uninstall it (Ubuntu case).