View previous topic :: View next topic |
Author |
Message |
thecooptoo Veteran
Joined: 27 Apr 2003 Posts: 1353 Location: UK
|
Posted: Mon Dec 03, 2007 10:12 pm Post subject: fetchmail and crontab query |
|
|
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 |
|
|
frostschutz Advocate
Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Mon Dec 03, 2007 10:44 pm Post subject: |
|
|
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 |
|
|
thecooptoo Veteran
Joined: 27 Apr 2003 Posts: 1353 Location: UK
|
Posted: Tue Dec 04, 2007 6:21 pm Post subject: |
|
|
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 |
|
|
frostschutz Advocate
Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Tue Dec 04, 2007 8:23 pm Post subject: |
|
|
(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 |
|
|
thecooptoo Veteran
Joined: 27 Apr 2003 Posts: 1353 Location: UK
|
Posted: Thu Dec 06, 2007 12:15 pm Post subject: |
|
|
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 |
|
|
|