diff -u amavisd-new-2.6.5/debian/changelog amavisd-new-2.6.5/debian/changelog --- amavisd-new-2.6.5/debian/changelog +++ amavisd-new-2.6.5/debian/changelog @@ -1,3 +1,9 @@ +amavisd-new (1:2.6.5-0ubuntu4) oneiric; urgency=low + + * Remove --name check from initscript (LP: #930916) + + -- Vibhav Pant Fri, 02 Mar 2012 20:00:33 +0530 + amavisd-new (1:2.6.5-0ubuntu3) oneiric; urgency=low * debian/patches/00patch-opts: "-U" option to patch is obsolete, replaced diff -u amavisd-new-2.6.5/debian/amavisd-new.init amavisd-new-2.6.5/debian/amavisd-new.init --- amavisd-new-2.6.5/debian/amavisd-new.init +++ amavisd-new-2.6.5/debian/amavisd-new.init @@ -1,146 +1,68 @@ -#! /bin/sh +#!/bin/sh # -# amavisd /etc/init.d/ initscript for amavisd-new -# $Id: amavisd-new.init 800 2006-01-31 00:07:45Z hmh $ +# amavisd This script controls the amavisd-new daemon. +# (to be used with version amavisd-new-20020630 or later) # -# Copyright (c) 2003 by Brian May -# and Henrique M. Holschuh -# Distributed under the GPL version 2 -# -# -# How this thing works: -# ${START} must be only what is needed for start-stop-daemon, DO NOT -# ADD ANY PARAMETERS HERE! we might use it for --test, for example. -# ${STOP} works just like ${START}, --signal is used with it. -# -# ${PARAMS} are the parameters to give the daemon when really starting -# it. -### BEGIN INIT INFO -# Provides: amavisd-new -# Required-Start: $syslog $network $local_fs $remote_fs -# Required-Stop: $syslog $network $local_fs $remote_fs -# Should-Start: -# Should-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Starts amavisd-new mailfilter -# Description: Launches the amavisd-new mailfilter -### END INIT INFO - -PATH=/sbin:/bin:/usr/sbin:/usr/bin -DAEMON=/usr/sbin/amavisd-new -DAEMON2=/usr/bin/perl -NAME=amavisd -DAEMONNAME=amavisd-new -DESC=amavisd -PIDFILE=/var/run/amavis/${NAME}.pid - -. /lib/lsb/init-functions - -test -f ${DAEMON} || exit 0 - -set -e - -START="--start --quiet --pidfile $PIDFILE --name ${DAEMONNAME} --startas ${DAEMON}" -STOP="--stop --quiet --pidfile $PIDFILE --name ${DAEMONNAME}" -PARAMS= - -check_noncompatible_upgrade() { - for i in /etc/amavisd.conf /etc/amavis/amavisd.conf ; do - if [ -e "${i}.disabled" ] ; then - echo "Found incompatible config file flag!" >&2 - echo "Due to safety concerns, amavisd-new will not be started." >&2 - echo "Refer to /usr/share/doc/amavisd-new/README.Debian for instructions." >&2 - exit 1 - fi - done -} - -createdir() { -# $1 = user -# $2 = group -# $3 = permissions (octal) -# $4 = path to directory - [ -d "$4" ] || mkdir -p "$4" - chown -c -h "$1:$2" "$4" - chmod -c "$3" "$4" -} - -fixdirs() { - dir=$(dpkg-statoverride --list /var/run/amavis) || { - echo "You are missing a dpkg-statoverride on /var/run/amavis. Fix it, otherwise you risk silent breakage on upgrades." >&2 - exit 1 - } - [ -z "$dir" ] || createdir $dir - : -} - -cleanup() { - [ -d /var/lib/amavis ] && - find /var/lib/amavis -maxdepth 1 -name 'amavis-*' -type d \ - -exec rm -rf "{}" \; >/dev/null 2>&1 || true - [ -d /var/lib/amavis/tmp ] && - find /var/lib/amavis/tmp -maxdepth 1 -name 'amavis-*' -type d \ - -exec rm -rf "{}" \; >/dev/null 2>&1 || true - : -} +# chkconfig: 2345 79 31 +# description: amavisd is an interface between MTA and content checkers +# processname: amavisd +# pidfile: /var/amavis/amavisd.pid + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source networking configuration. +. /etc/sysconfig/network + +#prog="/opt/amavisd-new/sbin/amavisd" +prog="/usr/sbin/amavisd" +prog_base="$(basename ${prog})" + +prog_config_file="/etc/amavisd.conf" + +# Source configuration. +[ -e /etc/sysconfig/${prog_base} ] && . /etc/sysconfig/${prog_base} + +## Check that networking is up. +#[ ${NETWORKING} = "no" ] && exit 0 + +RETVAL=0 + +# See how we were called. case "$1" in start) - echo -n "Starting $DESC: " - fixdirs - check_noncompatible_upgrade - if start-stop-daemon ${START} -- ${PARAMS} start >/dev/null ; then - echo "amavisd-new." - else - if start-stop-daemon --test ${START} >/dev/null 2>&1; then - echo "(failed)." - exit 1 - else - echo "(already running)." - exit 0 - fi - fi + action $"Starting ${prog_base}:" ${prog} -c ${prog_config_file} + RETVAL=$? + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/${prog_base} + echo ;; stop) - echo -n "Stopping $DESC: " - if start-stop-daemon ${STOP} --retry 10 >/dev/null ; then - cleanup - echo "amavisd-new." + action $"Shutting down ${prog_base}:" ${prog} -c ${prog_config_file} stop + RETVAL=$? + if [ $RETVAL -eq 0 ] ; then + echo "${prog_base} stopped" + rm -f /var/lock/subsys/${prog_base} else - if start-stop-daemon --test ${START} >/dev/null 2>&1; then - echo "(not running)." - exit 0 - else - echo "(failed)." - exit 1 - fi + echo fi ;; -# reload) -# echo "Reloading $DESC configuration files." -# start-stop-daemon ${STOP} --signal 1 -# ;; - restart|force-reload) - $0 stop - exec $0 start + status) + status ${prog_base} + RETVAL=$? ;; - debug|debug-sa) - mode="$1" - echo "Trying to run amavisd-new in ${mode} mode..." - fixdirs - check_noncompatible_upgrade - exec ${DAEMON} ${PARAMS} "${mode}" + restart) + $0 stop + $0 start + RETVAL=$? ;; - status) - status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? + reload) + action $"Reloading ${prog_base}:" ${prog} -c ${prog_config_file} reload + RETVAL=$? ;; *) - N=/etc/init.d/amavis - #echo "Usage: $N {start|stop|restart|reload|force-reload|debug}" >&2 - echo "Usage: $N {start|stop|restart|force-reload|status|debug}" >&2 + echo "Usage: $0 {start|stop|status|restart|reload}" exit 1 - ;; esac -exit 0 +exit $RETVAL