Hi,
* Riccardo Stagni <[EMAIL PROTECTED]> [2006-07-30 22:42]:
> On Sun, Jul 30, 2006 at 07:25:34PM +0200, Nico Golde wrote:
> > First thanks for your very good report. I attached a (for me 
> > fixed) version of the init script. Can you test, if its ok 
> > for you?
> The script you sent me doesn't work (at least, for the awake part).
> I think's it's because you use start-stop-daemon just as you were starting
> fetchmail.
> 
> -- (from start-stop-daemon(8))
> With --start, start-stop-daemon checks for the existence of a specified
> process.  If such a process exists, start-stop-daemon does nothing, and
> exits with error status 1 (0 if --oknodo is specified).
> --

Arg you are right.

> I start the script with awaken, it calls start-stop-daemon, that observes
> (due the pidfile) that fetchmail is altrady running, and doesn't anything.
> You can't start another process (and fetchmail have no --awaken option),
> so there are two solutions:
> * kill-and-restart the process every time the awaken option of the script
>   is called
> * use the old solution (launch a non-daemon fetchmail, that will end after
>   mail check/download) using different options rispect the daemon start
>   (as I suggested in the past mail :P)
> 
> Surely there is a lot of different (better?) solutions, but I have no
> more ideas! :)

I thought about your solutions but here comes mine :)
From fetchmail(1):
Normally,  calling fetchmail with a daemon in the background sends a wake-up 
signal to the dae-
mon, forcing it to poll mailservers immediately.  (The wake-up signal is SIGHUP 
if fetchmail is
running  as  root, SIGUSR1 otherwise.)  The wake-up action also clears any 
'wedged' flags indi-
cating that connections have wedged due to failed authentication or multiple 
timeouts.

So my fix here is to get the pid from the pid-file and send SIGUP (kill -1) to 
the
process. Works pretty well and imho is the sanest solution here.
What do you think?
Regards Nico

-- 
Nico Golde - JAB: [EMAIL PROTECTED] | GPG: 0x73647CFF
http://www.ngolde.de | http://nion.modprobe.de/blog/
Forget about that mouse with 3/4/5 buttons -
gimme a keyboard with 103/104/105 keys!

Attachment: pgpd0GVS513pV.pgp
Description: PGP signature

Reply via email to