Package: opendkim
Version: 2.6.0-1
Severity: normal
Tags: patch

Please apply the below patch to make the init.d script correctly label the
RUNDIR for SE Linux.

--- opendkim.orig       2012-07-02 14:41:50.000000000 +1000
+++ opendkim    2012-07-02 14:36:52.000000000 +1000
@@ -48,6 +48,7 @@
        # Create the run directory if it doesn't exist
        if [ ! -d "$RUNDIR" ]; then
                install -o "$USER" -g "$GROUP" -m 755 -d "$RUNDIR" || return 2
+               [ -x /sbin/restorecon ] && /sbin/restorecon "$RUNDIR"
        fi
        # Clean up stale sockets
        if [ -f "$PIDFILE" ]; then

-- Configuration Files:
/etc/init.d/opendkim changed:
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/opendkim
NAME=opendkim
DESC="OpenDKIM"
RUNDIR=/var/run/$NAME
USER=opendkim
GROUP=opendkim
SOCKET=local:$RUNDIR/$NAME.sock
PIDFILE=$RUNDIR/$NAME.pid
stoptimeout=5
test -x $DAEMON || exit 0
.. /lib/lsb/init-functions
if [ -f /etc/default/opendkim ] ; then
        . /etc/default/opendkim
fi
if [ -f /etc/opendkim.conf ]; then
        CONFIG_SOCKET=`awk '$1 == "Socket" { print $2 }' /etc/opendkim.conf`
fi
if [ -n "$SOCKET" -a -z "$CONFIG_SOCKET" ]; then
        DAEMON_OPTS="-p $SOCKET $DAEMON_OPTS"
fi
DAEMON_OPTS="-x /etc/opendkim.conf -u $USER -P $PIDFILE $DAEMON_OPTS"
start() {
        # Create the run directory if it doesn't exist
        if [ ! -d "$RUNDIR" ]; then
                install -o "$USER" -g "$GROUP" -m 755 -d "$RUNDIR" || return 2
                [ -x /sbin/restorecon ] && /sbin/restorecon "$RUNDIR"
        fi
        # Clean up stale sockets
        if [ -f "$PIDFILE" ]; then
                pid=`cat $PIDFILE`
                if ! ps -C "$DAEMON" -s "$pid" >/dev/null; then
                        rm "$PIDFILE"
                        TMPSOCKET=""
                        if [ -n "$SOCKET" ]; then
                                TMPSOCKET="$SOCKET"
                        elif [ -n "$CONFIG_SOCKET" ]; then
                                TMPSOCKET="$CONFIG_SOCKET"
                        fi
                        if [ -n "$TMPSOCKET" ]; then
                                # UNIX sockets may be specified with or without 
the
                                # local: prefix; handle both
                                t=`echo $SOCKET | cut -d: -f1`
                                s=`echo $SOCKET | cut -d: -f2`
                                if [ -e "$s" -a -S "$s" ]; then
                                        if [ "$t" = "$s" -o "$t" = "local" ]; 
then
                                                rm "$s"
                                        fi
                                fi
                        fi
                fi
        fi
        start-stop-daemon --start --quiet --pidfile "$PIDFILE" --exec "$DAEMON" 
--test -- $DAEMON_OPTS || return 1
        start-stop-daemon --start --quiet --pidfile "$PIDFILE" --exec "$DAEMON" 
-- $DAEMON_OPTS || return 2
        # Detect exit status 78 (configuration error)
        ret=$?
        if [ $ret -eq 78 ]; then
                echo "See /usr/share/doc/opendkim/README.Debian for help"
                echo "Starting for DKIM verification only"
                DAEMON_OPTS="-b v $DAEMON_OPTS"
                start-stop-daemon --start --quiet --pidfile "$PIDFILE" --exec 
"$DAEMON" -- $DAEMON_OPTS
                exit 0
        elif [ $ret -ne 0 ]; then
                exit $ret
        fi
}
stop() {
        start-stop-daemon --stop --retry "$stoptimeout" --exec "$DAEMON"
        [ "$?" = 2 ] && return 2
}
reload() {
        start-stop-daemon --stop --signal USR1 --exec "$DAEMON"
}
status() {
    local pidfile daemon name status
    pidfile=
    OPTIND=1
    while getopts p: opt ; do
        case "$opt" in
            p)  pidfile="$OPTARG";;
        esac
    done
    shift $(($OPTIND - 1))
    if [ -n "$pidfile" ]; then
        pidfile="-p $pidfile"
    fi
    daemon="$1"
    name="$2"
    status="0"
    pidofproc $pidfile $daemon >/dev/null || status="$?"
    if [ "$status" = 0 ]; then
        log_success_msg "$name is running"
        return 0
    else
        log_failure_msg "$name is not running"
        return $status
    fi
}
case "$1" in
  start)
        echo -n "Starting $DESC: "
        start
        echo "$NAME."
        ;;
  stop)
        echo -n "Stopping $DESC: "
        stop
        echo "$NAME."
        ;;
  restart)
        echo -n "Restarting $DESC: "
        stop
        start
        echo "$NAME."
        ;;
  reload|force-reload)
        echo -n "Restarting $DESC: "
        reload
        echo "$NAME."
        ;;
  status)
        status $DAEMON $NAME
        ;;
  *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start|stop|restart|reload|force-reload|status}" >&2
        exit 1
        ;;
esac
exit 0


-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to