issue with fetchmail

Red Squirrel

No Lifer
May 24, 2003
71,340
14,093
126
www.anyf.ca
I'm trying to run fetchmail as a different user through a cron job but I get this error:

//.fetchmail.pid: Permission denied
fetchmail: lock creation failed.

If I execute it manually with that user, it works.

Did some research and it seems this is a bug, but this was VERY old information so it may not be valid. Has anyone seen this before?


edit: seems ok if I do it as root
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
edit: seems ok if I do it as root

Of course it does, root can write to /.

By default fetchmail writes it's pid to ~/fetchmail.pid and I bet cron cleaned the environment so HOME is empty or points to /. Just use the pidfile option to specify a full path for fetchmail to use.