fetchmail-friends
[Top] [All Lists]

[fetchmail]Debian, RC files and daemon mode

2002-04-13 02:11:37
 Hi!

I've tried google to find solution and I didn't get any answer, 
so I'd like to ask you. I'm using Debian Potato and installed
fetchmail. 

I made file /etc/fetchmail.conf and /etc/init.d/fetchmail, which
are below. Then I made links in rc*.d to fetchmail script,
and inittab sets default runlevel to 2. 

The problem is that fetchmail doesn't start at boot and 
I don't know why. I think that everything is configured OK, 
because when I start it using command line fetchmail
works perfectly. 

Please Help. 

Leszek Dubiel 



FILE /ETC/FETCHMAIL.CONF:


poll mail2.kim.net.pl
        protocol POP3 localdomains dubielvitrum.pl
        username vitrum password __________ is * fetchall
        username vitrum1 password ___________ is * fetchall



FILE /ETC/INIT.D/FETCHMAIL

#!/bin/sh
#
# To start fetchmail as a system service, copy this file to
# /etc/init.d/fetchmail and run "update-rc.d fetchmail
# defaults 30".
#
# To remove the service, delete /etc/init.d/fetchmail and run
# "update-rc.d fetchmail remove".

set -e

DAEMON=/usr/bin/fetchmail
DAEMON=/usr/bin/fetchmail
ARGS="--daemon 15 --fetchmailrc /etc/fetchmail.conf"
DEBUGLOG=/var/log/fetchmail.log
NAME=fetchmail

echo -n "fetchmail script:"

test -x $DAEMON || exit 0

echo "daemon present."

case "$1" in
  start)
        echo -n "Starting mail retrieval agent: "
        if start-stop-daemon --start --exec $DAEMON -- $ARGS
            then echo "fetchmail successfully started."
            else echo "fetchmail fail to start, maybe already running."
        fi
        ;;
  stop)
        echo -n "Stopping mail retrieval agent: "
        start-stop-daemon --stop --quiet --exec $DAEMON
        echo "fetchmail stopped."
        ;;
  force-reload|restart)
        echo -n "Restarting mail retrieval agent: "
        start-stop-daemon --stop --quiet --exec $DAEMON
        if start-stop-daemon --start --exec $DAEMON -- $ARGS
            then echo "fetchmail."
            else echo "fetchmail fail to start, maybe already running."
        fi
        echo "fetchmail."
        ;;
  *)
        echo "Usage: /etc/init.d/fetchmail {start|stop|restart}"
        exit 1
        ;;
esac

exit 0