Re: Lancer fetchmail au boot
"Jean-Luc Coulon (f5ibh)" <jean-luc.coulon@wanadoo.fr> writes:
> Le 28.09.2004 20:26:40, Stephane Fombonne a écrit :
>>Merci pour l'aide ; la technique est élégante, car je ne vois pas
>>l'intérêt
>>d'avoir un fetchmailrc, si on a le ~/.fetchmailrc qui va bien.
>
> Ne pas oublier que fetchmail peut très bien s'occuper de plus d'un
> utilisateur sur un système.
Tout à fait.
Pour une connexion internet de type "dial-up", je conseille la
solution suivante :
On désactive le lancement du démon à l'init
$ update-rc.d -f fetchmail remove
On crée un fichier de conf global par concaténation des confs de chaque
utilisateur et on lance le démon à l'établissement de la conexion internet
$ cat /etc/ppp/ip-up.d/fetchmail
#!/bin/sh
#
# Default fetchmail ip-up script (/etc/ppp/ip-up.d/fetchmail)
#
# Change "try-restart" below to "start" if you only want to run fetchmail when
# the PPP link is up.
#
cat /home/*/.fetchmailrc >/etc/fetchmailrc
chmod 700 /etc/fetchmailrc
if [ -x /etc/init.d/fetchmail -a ! -x /sbin/resolvconf ]; then
/etc/init.d/fetchmail start >/dev/null 2>&1
fi
On arrête le démon à la déconnexion
$ cat /etc/ppp/ip-down.d/fetchmail
#!/bin/sh
#
# Default fetchmail ip-down script (/etc/ppp/ip-down.d/fetchmail)
#
# Remove the "exit 0" line if you want only want to run fetchmail when the
# PPP link is up.
#
#exit 0
if [ -x /etc/init.d/fetchmail ]; then
/etc/init.d/fetchmail stop
fi
Léo.
Reply to: