Error Creating State File /var/lib/logrotate.status
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up error: error creating state file /var/lib/logrotate/status: Permission denied up vote 6 down vote favorite 2 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... ubuntu logrotate share|improve this question asked May 25 '12 at 21:19 Victor S 2,60422747 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote accepted Are you sure you run this command as root...? ;) I f so please check if there is an AppArmour on the system - if yes check it's configuration or uninstall it (Ubuntu case). share|improve this answer answered May 25 '12 at 21:40 cezar 532310 Not sure, in the end I chmoded status to 666 and it worked. You might very well be right so I will accept the answer :) –Victor S May 28 '12 at 20:13 add a comment| up vote 20 down vote DO NOT chmod the default status file to 666. If you chmod it, every user on the system is able to use logrotate as attack vector. Just define a (private) state file for your user (Assuming that you are trying to run it as regular user) with option [-s|--s
[x] Format For Printing -XML -Clone This Bug -Last Comment First Last Prev Next This bug is not in your last search results. Bug1127415 - error renaming temp state file /var/lib/logrotate.status.tmp Summary: error renaming temp state file /var/lib/logrotate.status.tmp Status: CLOSED CURRENTRELEASE Aliases: None Product: Fedora Classification: Fedora Component: logrotate (Show other bugs) Sub Component: --- http://stackoverflow.com/questions/10761495/error-error-creating-state-file-var-lib-logrotate-status-permission-denied Version: 23 Hardware: Unspecified Unspecified Priority unspecified Severity unspecified TargetMilestone: --- TargetRelease: --- Assigned To: Jan Kaluža QA Contact: Fedora Extras Quality Assurance Docs Contact: URL: Whiteboard: Keywords: Depends On: 1228531 Blocks: 1272236 Show dependency tree /graph Reported: 2014-08-06 16:25 EDT by John Florian Modified: 2016-08-03 https://bugzilla.redhat.com/show_bug.cgi?id=1127415 08:40 EDT (History) CC List: 4 users (show) aschorr jjj092353 jkaluza kdudka See Also: Fixed In Version: logrotate-3.9.1-2.fc23 Doc Type: Bug Fix Doc Text: Story Points: --- Clone Of: Environment: Last Closed: 2015-06-29 17:57:23 EDT Type: Bug Regression: --- Mount Type: --- Documentation: --- CRM: Verified Versions: Category: --- oVirt Team: --- RHEL 7.3 requirements from Atomic Host: Cloudforms Team: --- Attachments (Terms of Use) Add an attachment (proposed patch, testcase, etc.) Groups: None (edit) Description John Florian 2014-08-06 16:25:13 EDT Description of problem: logrotate fails with the above message when attempting to run from within a live image (e.g., one created with livecd-creator). Version-Release number of selected component (if applicable): logrotate-3.8.7-1.fc20.i686 How reproducible: always Steps to Reproduce: 1. Create a Live spin that includes logrotate. 2. Boot. 3. /usr/sbin/logrotate /etc/logrotate.conf Actual results: # /usr/sbin/logrotate /etc/logrotate.conf; echo $? err
communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any http://askubuntu.com/questions/710734/logrotate-fails-to-rotate-logs-error-setting-owner questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Ask Ubuntu Questions Tags Users Badges Unanswered Ask Question _ Ask Ubuntu is a question and answer site for Ubuntu users error creating and developers. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top logrotate fails to rotate logs: error setting owner up vote 0 down vote favorite Recently I've noticed that logrotate does error creating state not rotate my logs. user1@host:~$ /usr/sbin/logrotate /home/user1/logrotate.conf -v gives me an error: error: error setting owner of /home/logs/mylog.log.1 to uid 10111 and gid 10111: Operation not permitted error: error creating output file /var/lib/logrotate/status.tmp: Permission denied That gid confuses me, as user1 is only a member of a group with different gid: user1@host:~$ id uid=10111(user1) gid=1001(mygroup) groups=1001(mygroup) However, there's another group called user1, but, as I mentioned, actual user user1 is not its member: user1@host:~$ cat /etc/group | grep user1 user1:x:10111 It's something simple here, but I can't see it. UPDATE: here's what logrotate.conf looks like: /home/logs/*.log { rotate 7 daily copytruncate compress notifempty } user1@host:~$ ls -al /home/logs/ -rw-r--r-- 1 user1 mygroup 190826983 Dec 18 06:05 mylog.log permissions users groups logrotate share|improve this question edited Dec 18 '15 at 6:22 asked Dec 18 '15 at 4:13 hdf 13 does running sudo logrotate -v /home/user1/logrotate.conf work for you? –the_velour_fog Dec 18 '15 at 4:50 can you pleas