LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-13-2006, 02:55 PM   #1
ChrisScott
Member
 
Registered: Nov 2006
Location: St Albans, England
Distribution: Fedora c3/5, Suse pro 10/openSuse 10.2, RHES, Zenwalk.....
Posts: 97

Rep: Reputation: 15
fetchmail daemon


Hi all,

I might be going about this all the wrong way. I added 'fetchmail -d 600' to the bottom of my /etc/profile file with the goal of having my mail automatically checked every ten minutes. This works fine. However, obviously if there is a second login on the same machine fetchmail moans (can't have daemon running twice). Is there a better way to get the fetchmail daemon to run on its own?

Maybe I could write a code to check if fetchmail -d is running and if not start it. I can't think how I'd go about this.

Any help would be much appreciated.

Chris
 
Old 12-13-2006, 03:18 PM   #2
kotnik
Member
 
Registered: Nov 2004
Location: Novi Sad, Serbia
Distribution: Debian, Slackware, Gentoo, openSuSE
Posts: 254

Rep: Reputation: 31
Try adding this to your system startup script (rc.local, or something, depends on your distro):

fetchmail -f /path/to/your/.fetchmailrc
 
Old 12-24-2006, 10:16 AM   #3
ChrisScott
Member
 
Registered: Nov 2006
Location: St Albans, England
Distribution: Fedora c3/5, Suse pro 10/openSuse 10.2, RHES, Zenwalk.....
Posts: 97

Original Poster
Rep: Reputation: 15
Sorry it's taken me ages to reply!

That didn't seem to do anything. I did manage to write a script though and I'm quite satisfied with that.

Thanks for the help.

C
 
Old 12-24-2006, 10:21 AM   #4
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Another thing you can do is have a cron job to run fetchmail every 10 minutes. This is mine for running it every 5 minutes:

*/5 * * * * /usr/bin/fetchmail >/dev/null 2>&1

This line just goes in your user's crontab. I had tried kotnik's suggestion myself, but this didn't work as it meant running fetchmail as root and I got an error/warning message saying not to do that.
 
Old 12-24-2006, 07:39 PM   #5
kotnik
Member
 
Registered: Nov 2004
Location: Novi Sad, Serbia
Distribution: Debian, Slackware, Gentoo, openSuSE
Posts: 254

Rep: Reputation: 31
What about:

su username -c fetchmail

(Didn't try it, just a guess)
 
Old 12-25-2006, 12:29 AM   #6
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Surely you couldn't do that in a startup script, as you'd need to enter your user's password?
 
Old 12-25-2006, 11:29 PM   #7
kotnik
Member
 
Registered: Nov 2004
Location: Novi Sad, Serbia
Distribution: Debian, Slackware, Gentoo, openSuSE
Posts: 254

Rep: Reputation: 31
No, you don't need user's password, if you su-ing from root (as startup scripts are executed as root).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
fetchmail and pop3 daemon? scuffell Linux - Networking 1 08-29-2004 04:30 PM
Getting Fetchmail to poll multiple user accounts in daemon mode davidbalt Linux - Newbie 0 02-23-2004 05:21 PM
Fetchmail - daemon mode - manfrake 9.2 VincentB Linux - Newbie 1 02-11-2004 01:13 PM
how to use fetchmail ???? iamthewind Linux - Software 1 10-29-2003 09:14 AM
Running fetchmail daemon automatically iihay Linux - General 3 09-02-2001 05:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration