On Mon, Sep 06, 2021 at 01:17:52PM +0200, Matus UHLAR - fantomas via Dnsmasq-discuss wrote: > On 05.09.21 22:45, Chris Green wrote: > > I did say what versions I was running. The version which causes the > > problem is 2.80, the version that fixes it is 2.84. > > I don't think dnsmasq comes with init script for RPI. > And I'm not sure anyone with RPI is reading this list (did someone reply so > far?) > It's part of the dnsmasq distribution on both Pi and Ubuntu and I should think just about everywhere else:-
chris@dns$ dpkg -L dnsmasq /. /etc /etc/default /etc/default/dnsmasq /etc/dnsmasq.conf /etc/dnsmasq.d /etc/dnsmasq.d/README /etc/init.d /etc/init.d/dnsmasq /etc/insserv.conf.d /etc/insserv.conf.d/dnsmasq /etc/resolvconf /etc/resolvconf/update.d /etc/resolvconf/update.d/dnsmasq /lib /lib/systemd /lib/systemd/system /lib/systemd/system/dnsmasq.service /usr /usr/lib /usr/lib/resolvconf /usr/lib/resolvconf/dpkg-event.d /usr/lib/resolvconf/dpkg-event.d/dnsmasq /usr/lib/tmpfiles.d /usr/lib/tmpfiles.d/dnsmasq.conf /usr/share /usr/share/dnsmasq /usr/share/dnsmasq/installed-marker /usr/share/doc /usr/share/doc/dnsmasq I've posted the diff as an attachment, I don't really think it's very edifying! :-) -- Chris Green
17a18 > INSTANCE="${2}" 22,23c23,24 < if [ -r /etc/default/$NAME ]; then < . /etc/default/$NAME --- > if [ -r /etc/default/${NAME}${INSTANCE:+.${INSTANCE}} ]; then > . /etc/default/${NAME}${INSTANCE:+.${INSTANCE}} 26c27 < # Get the system locale, so that messages are in the correct language, and the --- > # Get the system locale, so that messages are in the correct language, and the 29,30c30,31 < . /etc/default/locale < export LANG --- > . /etc/default/locale > export LANG 34c35 < # package 'dnsmasq' is removed but not purged, even if the dnsmasq-base --- > # package 'dnsmasq' is removed but not purged, even if the dnsmasq-base 37,38c38,39 < < test -x $DAEMON || exit 0 --- > > test -x ${DAEMON} || exit 0 42c43 < . /lib/lsb/init-functions --- > . /lib/lsb/init-functions 44,64c45,65 < log_warning_msg () { < echo "${@}." < } < < log_success_msg () { < echo "${@}." < } < < log_daemon_msg () { < echo -n "${1}: $2" < } < < log_end_msg () { < if [ $1 -eq 0 ]; then < echo "." < elif [ $1 -eq 255 ]; then < /bin/echo -e " (warning)." < else < /bin/echo -e " failed!" < fi < } --- > log_warning_msg () { > echo "${@}." > } > > log_success_msg () { > echo "${@}." > } > > log_daemon_msg () { > echo -n "${1}: ${2}" > } > > log_end_msg () { > if [ "${1}" -eq 0 ]; then > echo "." > elif [ "${1}" -eq 255 ]; then > /bin/echo -e " (warning)." > else > /bin/echo -e " failed!" > fi > } 76c77 < # Note that if the resolvconf package is installed it is not possible to --- > # Note that if the resolvconf package is installed it is not possible to 80,81c81,82 < if [ ! "$RESOLV_CONF" ] && < [ "$IGNORE_RESOLVCONF" != "yes" ] && --- > if [ ! "${RESOLV_CONF}" ] && > [ "${IGNORE_RESOLVCONF}" != "yes" ] && 84c85 < RESOLV_CONF=/run/dnsmasq/resolv.conf --- > RESOLV_CONF=/run/dnsmasq/resolv.conf 87,88c88,89 < for INTERFACE in $DNSMASQ_INTERFACE; do < DNSMASQ_INTERFACES="$DNSMASQ_INTERFACES -i $INTERFACE" --- > for INTERFACE in ${DNSMASQ_INTERFACE}; do > DNSMASQ_INTERFACES="${DNSMASQ_INTERFACES} -i ${INTERFACE}" 91,92c92,93 < for INTERFACE in $DNSMASQ_EXCEPT; do < DNSMASQ_INTERFACES="$DNSMASQ_INTERFACES -I $INTERFACE" --- > for INTERFACE in ${DNSMASQ_EXCEPT}; do > DNSMASQ_INTERFACES="${DNSMASQ_INTERFACES} -I ${INTERFACE}" 95c96 < if [ ! "$DNSMASQ_USER" ]; then --- > if [ ! "${DNSMASQ_USER}" ]; then 100c101 < # It's automatically ignored if --interface --except-interface, --listen-address --- > # It's automatically ignored if --interface --except-interface, > --listen-address 105c106 < DNSMASQ_OPTS="$DNSMASQ_OPTS --local-service" --- > DNSMASQ_OPTS="${DNSMASQ_OPTS} --local-service" 107,108c108,109 < # If the dns-root-data package is installed, then the trust anchors will be < # available in $ROOT_DS, in BIND zone-file format. Reformat as dnsmasq --- > # If the dns-root-data package is installed, then the trust anchors will be > # available in ROOT_DS, in BIND zone-file format. Reformat as dnsmasq 113c114 < if [ -f $ROOT_DS ]; then --- > if [ -f ${ROOT_DS} ]; then 119,145c120,146 < # Return < # 0 if daemon has been started < # 1 if daemon was already running < # 2 if daemon could not be started < < # /run may be volatile, so we need to ensure that < # /run/dnsmasq exists here as well as in postinst < if [ ! -d /run/dnsmasq ]; then < mkdir /run/dnsmasq || return 2 < chown dnsmasq:nogroup /run/dnsmasq || return 2 < fi < [ -x /sbin/restorecon ] && /sbin/restorecon /run/dnsmasq < < start-stop-daemon --start --quiet --pidfile /run/dnsmasq/$NAME.pid --exec $DAEMON --test > /dev/null || return 1 < start-stop-daemon --start --quiet --pidfile /run/dnsmasq/$NAME.pid --exec $DAEMON -- \ < -x /run/dnsmasq/$NAME.pid \ < ${MAILHOSTNAME:+ -m $MAILHOSTNAME} \ < ${MAILTARGET:+ -t $MAILTARGET} \ < ${DNSMASQ_USER:+ -u $DNSMASQ_USER} \ < ${DNSMASQ_INTERFACES:+ $DNSMASQ_INTERFACES} \ < ${DHCP_LEASE:+ -l $DHCP_LEASE} \ < ${DOMAIN_SUFFIX:+ -s $DOMAIN_SUFFIX} \ < ${RESOLV_CONF:+ -r $RESOLV_CONF} \ < ${CACHESIZE:+ -c $CACHESIZE} \ < ${CONFIG_DIR:+ -7 $CONFIG_DIR} \ < ${DNSMASQ_OPTS:+ $DNSMASQ_OPTS} \ < || return 2 --- > # Return > # 0 if daemon has been started > # 1 if daemon was already running > # 2 if daemon could not be started > > # /run may be volatile, so we need to ensure that > # /run/dnsmasq exists here as well as in postinst > if [ ! -d /run/dnsmasq ]; then > mkdir /run/dnsmasq || { [ -d /run/dnsmasq ] || return 2 ; } > chown dnsmasq:nogroup /run/dnsmasq || return 2 > fi > [ -x /sbin/restorecon ] && /sbin/restorecon /run/dnsmasq > > start-stop-daemon --start --quiet --pidfile > /run/dnsmasq/${NAME}${INSTANCE:+.${INSTANCE}}.pid --exec ${DAEMON} --test > > /dev/null || return 1 > start-stop-daemon --start --quiet --pidfile > /run/dnsmasq/${NAME}${INSTANCE:+.${INSTANCE}}.pid --exec ${DAEMON} -- \ > -x /run/dnsmasq/${NAME}${INSTANCE:+.${INSTANCE}}.pid \ > ${MAILHOSTNAME:+ -m ${MAILHOSTNAME}} \ > ${MAILTARGET:+ -t ${MAILTARGET}} \ > ${DNSMASQ_USER:+ -u ${DNSMASQ_USER}} \ > ${DNSMASQ_INTERFACES:+ ${DNSMASQ_INTERFACES}} \ > ${DHCP_LEASE:+ -l ${DHCP_LEASE}} \ > ${DOMAIN_SUFFIX:+ -s ${DOMAIN_SUFFIX}} \ > ${RESOLV_CONF:+ -r ${RESOLV_CONF}} \ > ${CACHESIZE:+ -c ${CACHESIZE}} \ > ${CONFIG_DIR:+ -7 ${CONFIG_DIR}} \ > ${DNSMASQ_OPTS:+ ${DNSMASQ_OPTS}} \ > || return 2 153,166c154,166 < for interface in $DNSMASQ_EXCEPT < do < [ $interface = lo ] && return < done < < # Also skip this if DNS functionality is disabled in /etc/dnsmasq.conf < if grep -qs '^port=0' /etc/dnsmasq.conf; then < return < fi < < if [ -x /sbin/resolvconf ] ; then < echo "nameserver 127.0.0.1" | /sbin/resolvconf -a lo.$NAME < fi < return 0 --- > for interface in ${DNSMASQ_EXCEPT}; do > [ ${interface} = lo ] && return > done > > # Also skip this if DNS functionality is disabled in /etc/dnsmasq.conf > if grep -qs '^port=0' /etc/dnsmasq.conf; then > return > fi > > if [ -x /sbin/resolvconf ] ; then > echo "nameserver 127.0.0.1" | /sbin/resolvconf -a > lo.${NAME}${INSTANCE:+.${INSTANCE}} > fi > return 0 171,176c171,176 < # Return < # 0 if daemon has been stopped < # 1 if daemon was already stopped < # 2 if daemon could not be stopped < # other if a failure occurred < start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile /run/dnsmasq/$NAME.pid --name $NAME --- > # Return > # 0 if daemon has been stopped > # 1 if daemon was already stopped > # 2 if daemon could not be stopped > # other if a failure occurred > start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile > /run/dnsmasq/${NAME}${INSTANCE:+.${INSTANCE}}.pid --name ${NAME} 181,184c181,184 < if [ -x /sbin/resolvconf ] ; then < /sbin/resolvconf -d lo.$NAME < fi < return 0 --- > if [ -x /sbin/resolvconf ] ; then > /sbin/resolvconf -d lo.${NAME}${INSTANCE:+.${INSTANCE}} > fi > return 0 189,199c189,199 < # Return < # 0 if daemon is running < # 1 if daemon is dead and pid file exists < # 3 if daemon is not running < # 4 if daemon status is unknown < start-stop-daemon --start --quiet --pidfile /run/dnsmasq/$NAME.pid --exec $DAEMON --test > /dev/null < case "$?" in < 0) [ -e "/run/dnsmasq/$NAME.pid" ] && return 1 ; return 3 ;; < 1) return 0 ;; < *) return 4 ;; < esac --- > # Return > # 0 if daemon is running > # 1 if daemon is dead and pid file exists > # 3 if daemon is not running > # 4 if daemon status is unknown > start-stop-daemon --start --quiet --pidfile > /run/dnsmasq/${NAME}${INSTANCE:+.${INSTANCE}}.pid --exec ${DAEMON} --test > > /dev/null > case "${?}" in > 0) [ -e "/run/dnsmasq/${NAME}${INSTANCE:+.${INSTANCE}}.pid" ] && return > 1 ; return 3 ;; > 1) return 0 ;; > *) return 4 ;; > esac 202c202 < case "$1" in --- > case "${1}" in 204,222c204,222 < test "$ENABLED" != "0" || exit 0 < log_daemon_msg "Starting $DESC" "$NAME" < start < case "$?" in < 0) < log_end_msg 0 < start_resolvconf < exit 0 < ;; < 1) < log_success_msg "(already running)" < exit 0 < ;; < *) < log_end_msg 1 < exit 1 < ;; < esac < ;; --- > test "${ENABLED}" != "0" || exit 0 > log_daemon_msg "Starting ${DESC}" "${NAME}${INSTANCE:+.${INSTANCE}}" > start > case "${?}" in > 0) > log_end_msg 0 > start_resolvconf > exit 0 > ;; > 1) > log_success_msg "(already running)" > exit 0 > ;; > *) > log_end_msg 1 > exit 1 > ;; > esac > ;; 224,241c224,246 < stop_resolvconf < if [ "$ENABLED" != "0" ]; then < log_daemon_msg "Stopping $DESC" "$NAME" < fi < stop < RETVAL="$?" < if [ "$ENABLED" = "0" ]; then < case "$RETVAL" in < 0) log_daemon_msg "Stopping $DESC" "$NAME"; log_end_msg 0 ;; < esac < exit 0 < fi < case "$RETVAL" in < 0) log_end_msg 0 ; exit 0 ;; < 1) log_warning_msg "(not running)" ; exit 0 ;; < *) log_end_msg 1; exit 1 ;; < esac < ;; --- > stop_resolvconf > if [ "${ENABLED}" != "0" ]; then > log_daemon_msg "Stopping ${DESC}" "${NAME}${INSTANCE:+.${INSTANCE}}" > fi > stop > RETVAL="${?}" > if [ "${ENABLED}" = "0" ]; then > case "${RETVAL}" in > 0) log_daemon_msg "Stopping ${DESC}" > "${NAME}${INSTANCE:+.${INSTANCE}}"; log_end_msg 0 ;; > esac > exit 0 > fi > case "${RETVAL}" in > 0) log_end_msg 0 ; exit 0 ;; > 1) log_warning_msg "(not running)" ; exit 0 ;; > *) log_end_msg 1; exit 1 ;; > esac > ;; > checkconfig) > ${DAEMON} --test ${CONFIG_DIR:+ -7 ${CONFIG_DIR}} ${DNSMASQ_OPTS:+ > ${DNSMASQ_OPTS}} >/dev/null 2>&1 > RETVAL="${?}" > exit ${RETVAL} > ;; 243,275c248,280 < test "$ENABLED" != "0" || exit 1 < $DAEMON --test ${CONFIG_DIR:+ -7 $CONFIG_DIR} ${DNSMASQ_OPTS:+ $DNSMASQ_OPTS} >/dev/null 2>&1 < if [ $? -ne 0 ]; then < NAME="configuration syntax check" < RETVAL="2" < else < stop_resolvconf < stop < RETVAL="$?" < fi < log_daemon_msg "Restarting $DESC" "$NAME" < case "$RETVAL" in < 0|1) < sleep 2 < start < case "$?" in < 0) < log_end_msg 0 < start_resolvconf < exit 0 < ;; < *) < log_end_msg 1 < exit 1 < ;; < esac < ;; < *) < log_end_msg 1 < exit 1 < ;; < esac < ;; --- > test "${ENABLED}" != "0" || exit 1 > ${DAEMON} --test ${CONFIG_DIR:+ -7 ${CONFIG_DIR}} ${DNSMASQ_OPTS:+ > ${DNSMASQ_OPTS}} >/dev/null 2>&1 > if [ ${?} -ne 0 ]; then > NAME="configuration syntax check" > RETVAL="2" > else > stop_resolvconf > stop > RETVAL="${?}" > fi > log_daemon_msg "Restarting ${DESC}" "${NAME}${INSTANCE:+.${INSTANCE}}" > case "${RETVAL}" in > 0|1) > sleep 2 > start > case "${?}" in > 0) > log_end_msg 0 > start_resolvconf > exit 0 > ;; > *) > log_end_msg 1 > exit 1 > ;; > esac > ;; > *) > log_end_msg 1 > exit 1 > ;; > esac > ;; 277,285c282,290 < log_daemon_msg "Checking $DESC" "$NAME" < status < case "$?" in < 0) log_success_msg "(running)" ; exit 0 ;; < 1) log_success_msg "(dead, pid file exists)" ; exit 1 ;; < 3) log_success_msg "(not running)" ; exit 3 ;; < *) log_success_msg "(unknown)" ; exit 4 ;; < esac < ;; --- > log_daemon_msg "Checking ${DESC}" "${NAME}${INSTANCE:+.${INSTANCE}}" > status > case "${?}" in > 0) log_success_msg "(running)" ; exit 0 ;; > 1) log_success_msg "(dead, pid file exists)" ; exit 1 ;; > 3) log_success_msg "(not running)" ; exit 3 ;; > *) log_success_msg "(unknown)" ; exit 4 ;; > esac > ;; 287,288c292,293 < kill -s USR1 `cat /run/dnsmasq/$NAME.pid` < ;; --- > kill -s USR1 `cat /run/dnsmasq/${NAME}${INSTANCE:+.${INSTANCE}}.pid` > ;; 290,291c295,296 < start_resolvconf < ;; --- > start_resolvconf > ;; 293,294c298,299 < stop_resolvconf < ;; --- > stop_resolvconf > ;; 296,313c301,318 < # /run may be volatile, so we need to ensure that < # /run/dnsmasq exists here as well as in postinst < if [ ! -d /run/dnsmasq ]; then < mkdir /run/dnsmasq || return 2 < chown dnsmasq:nogroup /run/dnsmasq || return 2 < fi < exec $DAEMON -x /run/dnsmasq/$NAME.pid \ < ${MAILHOSTNAME:+ -m $MAILHOSTNAME} \ < ${MAILTARGET:+ -t $MAILTARGET} \ < ${DNSMASQ_USER:+ -u $DNSMASQ_USER} \ < ${DNSMASQ_INTERFACES:+ $DNSMASQ_INTERFACES} \ < ${DHCP_LEASE:+ -l $DHCP_LEASE} \ < ${DOMAIN_SUFFIX:+ -s $DOMAIN_SUFFIX} \ < ${RESOLV_CONF:+ -r $RESOLV_CONF} \ < ${CACHESIZE:+ -c $CACHESIZE} \ < ${CONFIG_DIR:+ -7 $CONFIG_DIR} \ < ${DNSMASQ_OPTS:+ $DNSMASQ_OPTS} < ;; --- > # /run may be volatile, so we need to ensure that > # /run/dnsmasq exists here as well as in postinst > if [ ! -d /run/dnsmasq ]; then > mkdir /run/dnsmasq || { [ -d /run/dnsmasq ] || return 2 ; } > chown dnsmasq:nogroup /run/dnsmasq || return 2 > fi > exec ${DAEMON} -x /run/dnsmasq/${NAME}${INSTANCE:+.${INSTANCE}}.pid \ > ${MAILHOSTNAME:+ -m ${MAILHOSTNAME}} \ > ${MAILTARGET:+ -t ${MAILTARGET}} \ > ${DNSMASQ_USER:+ -u ${DNSMASQ_USER}} \ > ${DNSMASQ_INTERFACES:+ ${DNSMASQ_INTERFACES}} \ > ${DHCP_LEASE:+ -l ${DHCP_LEASE}} \ > ${DOMAIN_SUFFIX:+ -s ${DOMAIN_SUFFIX}} \ > ${RESOLV_CONF:+ -r ${RESOLV_CONF}} \ > ${CACHESIZE:+ -c ${CACHESIZE}} \ > ${CONFIG_DIR:+ -7 ${CONFIG_DIR}} \ > ${DNSMASQ_OPTS:+ ${DNSMASQ_OPTS}} > ;; 315,317c320,322 < echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload|dump-stats|status}" >&2 < exit 3 < ;; --- > echo "Usage: /etc/init.d/${NAME} > {start|stop|restart|force-reload|dump-stats|status}" >&2 > exit 3 > ;; 321d325 <
_______________________________________________ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss