Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
fetchmail and crontab query
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
thecooptoo
Veteran
Veteran


Joined: 27 Apr 2003
Posts: 1353
Location: UK

PostPosted: Mon Dec 03, 2007 10:12 pm    Post subject: fetchmail and crontab query Reply with quote

Ive set up a user 'fetchmail' on my server and got it to poll my ISP POP3 server and put the mail in my home directory on the server, from where I can get it using Dovecot.

But i want to add a cronjob on the server as the user 'fetchmail'

Code:
fetchmail@grenada ~/Maildir $ crontab -e
cannot chdir(/var/spool/cron), bailing out.
/var/spool/cron: Permission denied

and its like this
Code:
grenada spool # ls -la /var/spool/ |grep cron
drwxr-x---  4 root           16 4096 Sep 15 17:43 cron
grenada spool #

so whats the best thing to do ?

i cant find anyone else having this error -
have i done something wrong ?
shouyld I make a crontab group and add root and fetchmail to it and then chown /var/spool/cron to root:crontab ?
_________________
join the optout - http://nhsconfidentiality.org
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Mon Dec 03, 2007 10:44 pm    Post subject: Reply with quote

There should be a cron group already and you have to be a member of this group to edit your own crontab.

Code:
 $ ls -la /var/spool | grep cron
drwxr-x---  4 root cron   70 2007-10-01 16:56 cron
Back to top
View user's profile Send private message
thecooptoo
Veteran
Veteran


Joined: 27 Apr 2003
Posts: 1353
Location: UK

PostPosted: Tue Dec 04, 2007 6:21 pm    Post subject: Reply with quote

heres my /etc/group file

Code:
grenada ~ # cat /etc/group
root::0:root
bin::1:root,bin,daemon
daemon::2:root,bin,daemon
sys::3:root,bin,adm
adm::4:root,adm,daemon
tty::5:
disk::6:root,adm
lp::7:lp
mem::8:
kmem::9:
wheel::10:root,cds3
floppy::11:root
mail::12:mail
news::13:news
uucp::14:uucp
man::15:man
console::17:
audio::18:
cdrom::19:
dialout::20:root
tape::26:root
video::27:root
cdrw::80:
usb::85:
users::100:games
nofiles:x:200:
smmsp:x:209:smmsp
portage::250:portage
utmp:x:406:
nogroup::65533:
nobody::65534:
ldap:x:439:
sshd:x:22:
rpc:x:111:
apache:x:81:
mysql:x:60:
ntp:x:123:
squid:x:31:
dovecot:x:97:
teamspeak2:x:101:
postgres:x:70:
lpadmin:x:106:
asterisk:x:440:
ftp:x:21:
murmur:x:441:
messagebus:x:442:
tcpdump:x:443:
grenada ~ #

_________________
join the optout - http://nhsconfidentiality.org
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Tue Dec 04, 2007 8:23 pm    Post subject: Reply with quote

(re)emerging cron(base) should create a group for you and set the permission of the files correctly. not sure about already existing directories, you could rename the old one before merging.

for example if you're using vixie-cron, a simple 'emerge -1 sys-process/cronbase sys-process/vixie-cron' could help.
Back to top
View user's profile Send private message
thecooptoo
Veteran
Veteran


Joined: 27 Apr 2003
Posts: 1353
Location: UK

PostPosted: Thu Dec 06, 2007 12:15 pm    Post subject: Reply with quote

So ive re-emerged as you suggested and added my user to the cron and crontab group
Code:
grenada ~ # cat /etc/group |grep cron
cron:x:16:fetchmail
crontab:x:444:fetchmail
grenada ~ #


Code:
fetchmail@grenada /var/log $ crontab -l
crontabs/fetchmail: Permission denied

Code:

grenada crontabs # pwd
/var/spool/cron/crontabs
grenada crontabs # ls -la
total 16
drwx-wx--T 2 root  messagebus 4096 Dec  6 11:50 .
drwxr-x--- 4 root  cron       4096 Sep 15 17:43 ..
-rw-r--r-- 1 root  root          0 Dec  5 22:21 .keep_sys-process_vixie-cron-0
-rw------- 1 fetchmail crontab     251 Dec  6 11:50 fetchmail
-rw------- 1 root  messagebus  245 Sep 20 07:44 root
grenada crontabs #


when I cat /var/spool/cron/crontabs/fetchmail as user fetchmail it says 'permission denied'

is the fix to just chmod the directory/file directly

dont know why ,as user fetchmail, I cant access the fetchmail crontab
_________________
join the optout - http://nhsconfidentiality.org
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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