[fetchmail]Fetchmail + crontab trouble
Laurence Moore
lmoore@starwon.com.au
Mon, 15 Nov 2004 13:05:00 +0800 (WST)
On Mon, 15 Nov 2004, Christoph Pilka wrote:
>=20
> So for logging fetchmail's activity i changed it to:
> */5 * * * * ctp strace fetchmail -f /home/ctp/.fetchmailrc
>=20
> and get system mails for root, which include (these are the last lines =
of the strace):
>=20
> ...
> rt_sigaction(SIGPIPE, {0x8054e3b, [], SA_RESTART}, {SIG_DFL}, 8) =3D 0
> rt_sigaction(SIGQUIT, {0x8054e3b, [], SA_RESTART}, {SIG_DFL}, 8) =3D 0
> open("//.fetchmail.pid", O_WRONLY|O_CREAT|O_EXCL|O_SYNC, 0666) =3D -1 E=
ACCES (Permission denied)
> write(2, "fetchmail: lock creation failed."..., 33fetchmail: lock creat=
ion failed.
> ) =3D 33
> exit_group(8) =3D ?
>=20
> so i=B4m confused about the line 'open("//.fetchmail.pid", O_WRONLY ...=
'. normally there should be a 'open("/home/ctp/.fetchmail.pid", O_WRONLY =
...' as i see stracing fetchmail running from a shell directely.
> Anyone has an idea what=B4s going wrong? The permissions for /home/ctp =
are set correctely:
> $ ls -lad /home/ctp
> drwxr-xr-x 65 ctp users 4096 Nov 15 05:53 /home/ctp
> and there is no a lockfile from a previous session (as i read it should=
be a problem for fetchmail if there one would exist)
> i=B4m really confused with this behaviour of fetchmail and i hope not t=
o be alone with this trouble ;-)
>=20
As root su - ctp then pwd. If you are in / then check /etc/passwd or
wherever the user account is configured. If the home directory in there
points to /home/ctp then you have a problem with cron not setting the HOM=
E
variable.
Cheers,
Larry.