~ubuntu-branches/ubuntu/oneiric/fetchmail/oneiric

« back to all changes in this revision

Viewing changes to debian/init

  • Committer: Bazaar Package Importer
  • Author(s): Artur Rona
  • Date: 2010-07-25 03:17:28 UTC
  • mfrom: (0.1.11 sid)
  • Revision ID: james.westby@ubuntu.com-20100725031728-mm78sfgx9d656h9r
Tags: 6.3.17-4ubuntu1
* Merge from Debian unstable, remaining changes: (LP: #609634)
  - debian/init, debian/fetchmail.postinst: don't stop fetchmail in
    runlevels [06], the default 'killall' handler should be sufficient
    because fetchmail writes are properly completed before telling the
    server it's ok to delete.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
# Provides:          fetchmail
8
8
# Required-Start:    $network $local_fs $remote_fs $syslog
9
9
# Required-Stop:     $remote_fs
 
10
# Should-Start:      $mail-transport-agent exim4 $named
 
11
# Should-Stop:       $mail-transport-agent exim4
10
12
# Default-Start:     2 3 4 5
11
13
# Default-Stop:      1
12
14
# Short-Description: init-Script for system wide fetchmail daemon
40
42
 
41
43
OPTIONS="$OPTIONS -f $CONFFILE --pidfile $PIDFILE"
42
44
 
43
 
if [ ! "x$START_DAEMON" = "xyes" ]; then
 
45
if [ ! "x$START_DAEMON" = "xyes" -a ! "$1" = "status" ]; then
44
46
        echo "Edit /etc/default/fetchmail to start/stop fetchmail"
45
47
        exit 0
46
48
fi
48
50
if [ ! -e $CONFFILE ]; then
49
51
    log_failure_msg "$CONFFILE not found."
50
52
    log_failure_msg "can not start fetchmail daemon... consider disabling the script"
51
 
    exit 0
 
53
    exit 6
52
54
fi
53
55
 
54
56
 
95
97
fi
96
98
 
97
99
# support for ephemeral /var/run
98
 
if [ "${PIDFILE%/*}" = "/var/run/fetchmail" ] && [ ! -d ${PIDFILE%/*} ]; then
 
100
if [ "${PIDFILE%/*}" = "/var/run/fetchmail" ] && [ ! -d ${PIDFILE%/*} ] && [ "$1" != "status" ]; then
99
101
        mkdir /var/run/fetchmail
100
102
        chown -h $USER:nogroup /var/run/fetchmail
101
103
        chmod 700 /var/run/fetchmail
119
121
#fi
120
122
 
121
123
# Makes sure certain files/directories have the proper owner
122
 
if [ "`stat -c '%U %a' $CONFFILE 2>/dev/null`" != "$USER 600" ]; then
 
124
if [ -f $CONFFILE -a "`stat -c '%U %a' $CONFFILE 2>/dev/null`" != "$USER 600" ]; then
123
125
        chown -h $USER $CONFFILE
124
126
        chmod -f 0600 $CONFFILE
125
127
fi
145
147
                        exit 1
146
148
                fi
147
149
                ;;
 
150
        status)
 
151
                status_of_proc $DAEMON fetchmail -p $PIDFILE
 
152
                ;;
148
153
        stop)
149
154
                if ! test -e $PIDFILE ; then
150
155
                        log_failure_msg "Pidfile not found! Is fetchmail running?"