Bug#1031111: orphan-sysvinit-scripts: please add a script for Avahi daemon

Lorenzo Puliti plorenzo at disroot.org
Sat Feb 11 22:42:35 GMT 2023


Package: orphan-sysvinit-scripts
Version: 0.12
Severity: wishlist
Tags: patch
X-Debbugs-Cc: plorenzo at disroot.org

Hi,

Michael just dropped [1] another init script (actually two), this time is avahi.
I think it would be nice to add the scripts to this package for bookworm,
if possible. I'm attaching the last version of the init script from avahi 0.8-7;

mapping is:

avahi-daemon.service avahi-daemon
avahi-dnsconfd.service avahi-dnsconfd

License is GNU Lesser General Public License, version 2 or any later version
Not sure if the scripts are from upstream or Debian:
 
Utopia Maintenance Team <pkg-utopia-maintainers at lists.alioth.debian.org>
or
Upstream Avahi developers

Best Regards,
Lorenzo

[1] https://tracker.debian.org/news/1417862/accepted-avahi-08-8-source-into-unstable/
   and also
    https://salsa.debian.org/utopia-team/avahi/-/commit/41a296309334853ed3164544bd39d872a8fc70a4


-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
merged-usr: no
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0van (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_CPU_OUT_OF_SPEC, TAINT_FIRMWARE_WORKAROUND, TAINT_OOT_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en
Shell: /bin/sh linked to /bin/dash
Init: runit (via /run/runit.stopit)

Versions of packages orphan-sysvinit-scripts depends on:
ii  ucf  3.0043+nmu1

orphan-sysvinit-scripts recommends no packages.

orphan-sysvinit-scripts suggests no packages.
-------------- next part --------------
#!/bin/sh
### BEGIN INIT INFO
# Provides:          avahi avahi-daemon
# Required-Start:    $remote_fs dbus
# Required-Stop:     $remote_fs dbus
# Should-Start:	     $syslog
# Should-Stop:       $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Avahi mDNS/DNS-SD Daemon
# Description:       Zeroconf daemon for configuring your network 
#                    automatically
### END INIT INFO

PATH=/sbin:/bin:/usr/sbin:/usr/bin
DESC="Avahi mDNS/DNS-SD Daemon"
NAME="avahi-daemon"
DAEMON="/usr/sbin/$NAME"
SCRIPTNAME=/etc/init.d/$NAME

# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0

. /lib/lsb/init-functions

# Include avahi-daemon defaults if available.
test -f /etc/default/avahi-daemon && . /etc/default/avahi-daemon

DISABLE_TAG="/var/run/avahi-daemon/disabled-for-unicast-local"

#
#       Function that starts the daemon/service.
#
d_start() {
    $DAEMON -c && return 0

    if [ -e $DISABLE_TAG -a "$AVAHI_DAEMON_DETECT_LOCAL" != "0" ]; then
        # Disabled because of the existance of an unicast .local domain
        log_warning_msg "avahi-daemon disabled because there is a unicast .local domain"
        exit 0;
    fi;

    $DAEMON -D
}

#
#       Function that stops the daemon/service.
#
d_stop() {
    if $DAEMON -c ; then
       $DAEMON -k
    fi
}

#
#       Function that reload the config file for the daemon/service.
#
d_reload() {
    $DAEMON -c && $DAEMON -r
}

#
#       Function that check the status of the daemon/service.
#
d_status() {
    $DAEMON -c && { echo "$DESC is running"; exit 0; } || { echo "$DESC is not running"; exit 3; }
}

case "$1" in
    start)
        log_daemon_msg "Starting $DESC" "$NAME"
        d_start
        log_end_msg $?
        ;;
    stop)
        log_daemon_msg "Stopping $DESC" "$NAME"
        d_stop
        log_end_msg $?
        ;;
    reload|force-reload)
        log_daemon_msg "Reloading services for $DESC" "$NAME"
        d_reload
        log_end_msg $?
        ;;
    restart)
        log_daemon_msg "Restarting $DESC" "$NAME"
        d_stop
        if [ "$?" -eq 0 ]; then
                d_start
                log_end_msg $?
        else
                log_end_msg 1
        fi
        ;;
    status)
        d_status
        ;;
    *)
        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|reload|status}" >&2
        exit 3
        ;;
esac

exit 0
-------------- next part --------------
#!/bin/sh
### BEGIN INIT INFO
# Provides:          avahi-dnsconfd
# Required-Start:    $remote_fs avahi-daemon
# Required-Stop:     $remote_fs avahi-daemon
# Should-Start:	     $syslog
# Should-Stop:       $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Avahi Unicast DNS Configuration Daemon
# Description:       A DNS configuration daemon using mDNS in a
#                    DHCP-like fashion
### END INIT INFO

PATH=/sbin:/bin:/usr/sbin:/usr/bin
DESC="Avahi Unicast DNS Configuration Daemon"
NAME="avahi-dnsconfd"
DAEMON="/usr/sbin/$NAME"
SCRIPTNAME=/etc/init.d/$NAME

# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0

. /lib/lsb/init-functions

#
#       Function that starts the daemon/service.
#
d_start() {
    $DAEMON -c && return 0

    if [ -s /etc/localtime ]; then
        if [ ! -d /etc/avahi/etc ]; then
            mkdir -p /etc/avahi/etc >/dev/null 2>&1
        fi
        cp -fp /etc/localtime /etc/avahi/etc >/dev/null 2>&1
    fi;

    $DAEMON -D
}

#
#       Function that stops the daemon/service.
#
d_stop() {
    if $DAEMON -c ; then
       $DAEMON -k
    fi
}

#
#       Function that reload the config file for the daemon/service.
#
d_refresh() {
    $DAEMON -c && $DAEMON -r
}

#
#       Function that check the status of the daemon/service.
#
d_status() {
    $DAEMON -c && { echo "$DESC is running"; exit 0; } || { echo "$DESC is not running"; exit 3; }
}

case "$1" in
    start)
        log_daemon_msg "Starting $DESC" "$NAME"
        d_start
        log_end_msg $?
        ;;
    stop)
        log_daemon_msg "Stopping $DESC" "$NAME"
        d_stop
        log_end_msg $?
        ;;
    refresh)
        log_daemon_msg "Refreshing $DESC" "$NAME"
        d_refresh
        log_end_msg $?
        ;;
    restart|force-reload)
        log_daemon_msg "Restarting $DESC" "$NAME"
        d_stop
        if [ "$?" -eq 0 ]; then
                d_start
                log_end_msg $?
        else
                log_end_msg 1
        fi
        ;;
    status)
        d_status
        ;;
    *)
        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|refresh|status}" >&2
        exit 3
        ;;
esac

exit 0


More information about the Debian-init-diversity mailing list