Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Help, I can't edit my crontab anymore!
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
arrummzen
n00b
n00b


Joined: 18 Apr 2006
Posts: 52

PostPosted: Sat Sep 29, 2007 4:48 am    Post subject: Help, I can't edit my crontab anymore! Reply with quote

I recently did an emerge -avDu world (after not doing one for about two months). I normally use 'crontab -e' to edit my crontab. As root it seems to work fine, but as non root I get the error:
Code:

cannot chdir(/var/spool/cron), bailing out.
/var/spool/cron: Permission denied


Has anyone else had this problem? What is the best way to fix it?

Thank you for your time,
Arrummzen
Back to top
View user's profile Send private message
Kosmas
Apprentice
Apprentice


Joined: 14 Sep 2006
Posts: 276
Location: Greece

PostPosted: Sat Sep 29, 2007 7:13 am    Post subject: Reply with quote

Hello there,

Don't worry about it, just see if /var/spool/cron exists and if not create it. Then change the permissions to cron:root and 755 for the directory.
Then check for a dir /var/spool/cron/crontabs and if it does not exist create it with permissions root:crontab and 1730 (yes 1730 not 730 )
Last check for directory /var/spool/lastrun with permissions root:root and 750

That should do the job.
Back to top
View user's profile Send private message
swimmer
Veteran
Veteran


Joined: 15 Jul 2002
Posts: 1330
Location: Netherlands

PostPosted: Sat Sep 29, 2007 8:37 am    Post subject: Reply with quote

Or you could update to the latest sys-process/cronbase which should do the same for you ...
Back to top
View user's profile Send private message
Mousee
Apprentice
Apprentice


Joined: 29 Mar 2004
Posts: 291
Location: Illinois, USA

PostPosted: Thu Oct 04, 2007 7:33 pm    Post subject: Reply with quote

swimmer wrote:
Or you could update to the latest sys-process/cronbase which should do the same for you ...

Which, FYI, doesn't work at all. Re-emerging cronbase or not doesn't apply the correct permissions. You have to do it manually or revert to an older, working version.

Many thanks to Kosmas for the nice "how-to"... took me about an hour to figure it out, heh.
Back to top
View user's profile Send private message
patches
n00b
n00b


Joined: 03 Aug 2007
Posts: 11
Location: IRC

PostPosted: Sun Oct 07, 2007 5:26 pm    Post subject: RE: Help, I can't edit my crontab anymore! Reply with quote

Some of my users on the server i run have had this problem and reported it as an error on a number of occasions. After looking in to it, i finally found that it was simply the question of adding the user to the cron group. It dose seem to work fine after that, thou they need to run crontab -e first sometimes. P.S. incase you're wondering the default for my server is to just have an empty cron.deny file in /etc/ to allow all users in the cron group to use the crontab. I've read the documents on the crontab but i dont plan on changing it any time soon. vixie-cron version 4.1-r10 USE="pam -debug (-selinux)"
Back to top
View user's profile Send private message
magari
n00b
n00b


Joined: 23 Aug 2007
Posts: 21

PostPosted: Fri Oct 17, 2008 2:01 pm    Post subject: Reply with quote

So...

This still isn't fixed.

I had to create /var/spool/lastrun to get it working. Is there even a bug submitted for this? Anyone know how I could check?
_________________
hackdmz.net
Back to top
View user's profile Send private message
notHerbert
Advocate
Advocate


Joined: 11 Mar 2008
Posts: 2228
Location: 45N 73W

PostPosted: Fri Oct 17, 2008 7:45 pm    Post subject: Reply with quote

Do you mean /var/spool/cron/lastrun? Did you add yourself to the crontab group after emerging cronbase?
Back to top
View user's profile Send private message
magari
n00b
n00b


Joined: 23 Aug 2007
Posts: 21

PostPosted: Wed Oct 22, 2008 12:33 pm    Post subject: Reply with quote

No /var/spool/cron/lastrun existed after emerging cronbase and vixie-cron

I did add myself to the cron group as well as the crontab group, logged out and logged back in... no go...

not until I added /var/spool/lastrun did it start working.

I have no idea why honestly... if it helps im running a gentoo-hardened profile.
_________________
hackdmz.net
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1557
Location: Adelaide/Australia

PostPosted: Mon Jan 17, 2011 11:57 pm    Post subject: Reply with quote

I found I simply had to
Code:
# chmod o+rx /var/spool/cron
and things started working.
_________________
...Lyall
Back to top
View user's profile Send private message
atmosx
n00b
n00b


Joined: 17 Jul 2009
Posts: 42

PostPosted: Sat Jan 14, 2012 3:13 am    Post subject: Reply with quote

I tried all the above solutions nothing worked, so I installed fcron and removed vixie-cron and now works.. fine and it's even a more flexible vixie-cron replacement.
Back to top
View user's profile Send private message
Princess Nell
l33t
l33t


Joined: 15 Apr 2005
Posts: 916

PostPosted: Sat Jan 14, 2012 2:35 pm    Post subject: Reply with quote

There's definitely a bug, at least here on am64.

Follow Kosmas' instructions, except that /var/spool/cron ownership is root:cron, not cron:root.

No need for anyone to be in the cron group.
Back to top
View user's profile Send private message
miroR
l33t
l33t


Joined: 05 Mar 2008
Posts: 826

PostPosted: Sun Aug 16, 2015 11:50 am    Post subject: Reply with quote

Princess Nell wrote:
There's definitely a bug, at least here on am64.

Follow Kosmas' instructions, except that /var/spool/cron ownership is root:cron, not cron:root.

No need for anyone to be in the cron group.

I have some issues with cron:

(current title, but I am uncertain what it is)
The new cronbase' issues with grsec RBAC policy
https://forums.gentoo.org/viewtopic-t-1026832.html
(again, I'm uncertain where my issues will end at, but they concern cron)

These issues appear to span in long years...

Any more on this? Such as is it still the case to fix those permissions in some of the fashions proposed in this topic?
Back to top
View user's profile Send private message
miroR
l33t
l33t


Joined: 05 Mar 2008
Posts: 826

PostPosted: Sun Aug 16, 2015 4:07 pm    Post subject: Reply with quote

This issue is, I think solved in all new cronbase packages...

But if anyone has issues deploying RBAC policy for their grsec-hardened kernel, you can look over:

crontab RBAC policy
http://forums.grsecurity.net/viewtopic.php?f=5&t=4253

Regards!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum