From nobody Sat Mar 25 20:41:17 2023 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PkWFT6wmtz41h98 for ; Sat, 25 Mar 2023 20:41:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PkWFT5v5Dz3q2t for ; Sat, 25 Mar 2023 20:41:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679776877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bZtNOY68JewofauFOg3uEbkPPY70VUmUOlL362ntBeo=; b=nRI8/LVu7AhOBy3AGuP12uiQfS5WQXsL/281nHoH6k3alyPBjXcquV890PBims2w6SIKwP zg4gq1lFQtVeOMVXPA+UmMqmP/CfkN+6NFd/ppTscrii7gb9+JJQYs9U1ckyB7diQCfCJk gH6GS32awZsHJxTtF4Da/Jm+96iaN3rECU3qVePMbp8JyEsP4zgZVyHZOrTS3CGkQxdteG AJxznj60wT/4u78oeMW4Hwd5f1mzAEPIz65u9cGbIxibshh42OZpPHuJA02bpPSkZ0znHb GipQbhpM+aswx3bXmXfN7QOGXmpD1b15sBoiT0ti9g0KcNL5tegDMrimsKo7TQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679776877; a=rsa-sha256; cv=none; b=xksCWd4GTwIkbUN1uKsMzDFBGwx1rUTrrMrlBGd1ozzNArOljatlxdGMfiux3h8LJySiw5 e5CZDnKfWSmyycOTl2VBmbZgQFKjLcIxcpvxMjpeoUW7+gYpfiOqdAKCQAeRD0+xPcrJcY DzSxhgsbjnnig/De9rnrSMsoLWdLzSVIAtFHTV3YP6iAxxNdMcDYvrRrR/OU5otQqcBZVn nQTvocYu5CS6lQM8yWcEGRiNNfLTk2zx+P4wOMbKrGxmc5TA+EPyAoKnccau2cXVRHIhQ7 DsTAhuC/GYdIOsFeS6mE8knPkr7c1jH7DfgOQALwksxRAqN8umwTZdlLGtt2jA== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PkWFT4z8Lz1Cbs for ; Sat, 25 Mar 2023 20:41:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 32PKfHL5098359 for ; Sat, 25 Mar 2023 20:41:17 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 32PKfHew098358 for bugs@FreeBSD.org; Sat, 25 Mar 2023 20:41:17 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 270428] rc.d improve using info/warn instead of just echo Date: Sat, 25 Mar 2023 20:41:17 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: vermaden@interia.pl X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D270428 --- Comment #7 from Slawomir Wojciech Wojtczak --- Here - patches for three next services with echo->info/warn conversion: - /etc/rc.d/zpool - /etc/rc.d/random=20 # diff -u /root/zpool /etc/rc.d/zpool --- /root/zpool 2023-03-25 21:10:38.312121000 +0100 +++ /etc/rc.d/zpool 2023-03-25 21:15:42.782103000 +0100 @@ -22,7 +22,10 @@ for cachefile in /etc/zfs/zpool.cache /boot/zfs/zpool.cache; do if [ -r $cachefile ]; then - zpool import -c $cachefile -a -N && break + message=3D$( zpool import -c $cachefile -a -N 2>&1 ) + return_value=3D${?} + info ${message} + [ ${return_value} -eq 0 ] && break fi done } # diff -u /root/random /etc/rc.d/random=20 --- /root/random 2023-03-25 21:16:33.459248000 +0100 +++ /etc/rc.d/random 2023-03-25 21:29:03.982450000 +0100 @@ -48,13 +48,12 @@ { if [ ${harvest_mask} -gt 0 ]; then - echo -n 'Setting up harvesting: ' - ${SYSCTL} kern.random.harvest.mask=3D${harvest_mask} > /dev= /null - ${SYSCTL_N} kern.random.harvest.mask_symbolic + message=3D$( echo -n 'Setting up harvesting:' ) + ${SYSCTL} kern.random.harvest.mask=3D${harvest_mask} 1> /de= v/null 2> /dev/null + message=3D"${message} $( ${SYSCTL_N} kern.random.harvest.mask_symbolic )" + info "${message}" fi - echo -n 'Feeding entropy: ' - if [ ! -w /dev/random ] ; then warn "/dev/random is not writeable" return 1 @@ -88,7 +87,7 @@ ;; esac - echo '.' + info 'Feeding entropy: .' } random_stop() # diff -u /etc/rc.d/routing /root/routing=20 --- /etc/rc.d/routing 2023-03-25 21:38:38.048212000 +0100 +++ /root/routing 2023-03-25 21:29:36.241501000 +0100 @@ -67,8 +67,7 @@ ""|[Aa][Ll][Ll]|[Aa][Nn][Yy]) for _a in inet inet6; do afexists $_a || continue - message=3D$( eval static_${_a} delete $_if ) - info "${message}" + eval static_${_a} delete $_if # When $_if is specified, do not flush routes. if ! [ -n "$_if" ]; then eval routing_stop_${_a} @@ -95,17 +94,15 @@ _ret=3D0 case $1 in static) - message=3D$( static_$2 add $3 ) - info "${message}" + static_$2 add $3 _ret=3D$? ;; options) options_$2 ;; doall) - message=3D$( static_$2 add $3 ) + static_$2 add $3 _ret=3D$? - info "${message}" options_$2 ;; esac @@ -135,9 +132,9 @@ _fibs=3D$((`${SYSCTL_N} net.fibs` - 1)) if [ ${_fibs} -gt 0 ]; then - info "-fib 0-${_fibs}" + echo "-fib 0-${_fibs}" else - info '' + echo fi } @@ -290,7 +287,7 @@ ropts_init() { if [ -z "${_ropts_initdone}" ]; then - message=3D$( echo -n "Additional $1 routing options:" ) + echo -n "Additional $1 routing options:" _ropts_initdone=3Dyes fi } @@ -355,8 +352,7 @@ if checkyesno gateway_enable; then ropts_init inet - message=3D"${message} gateway=3DYES" - + echo -n ' gateway=3DYES' ${SYSCTL} net.inet.ip.forwarding=3D1 > /dev/null else ${SYSCTL} net.inet.ip.forwarding=3D0 > /dev/null @@ -364,7 +360,7 @@ if checkyesno forward_sourceroute; then ropts_init inet - message=3D"${message} do source routing=3DYES" + echo -n ' do source routing=3DYES' ${SYSCTL} net.inet.ip.sourceroute=3D1 > /dev/null else ${SYSCTL} net.inet.ip.sourceroute=3D0 > /dev/null @@ -372,7 +368,7 @@ if checkyesno accept_sourceroute; then ropts_init inet - message=3D"${message} accept source routing=3DYES" + echo -n ' accept source routing=3DYES' ${SYSCTL} net.inet.ip.accept_sourceroute=3D1 > /dev/null else ${SYSCTL} net.inet.ip.accept_sourceroute=3D0 > /dev/null @@ -380,15 +376,13 @@ if checkyesno arpproxy_all; then ropts_init inet - message=3D"${message} ARP proxyall=3DYES" + echo -n ' ARP proxyall=3DYES' ${SYSCTL} net.link.ether.inet.proxyall=3D1 > /dev/null else ${SYSCTL} net.link.ether.inet.proxyall=3D0 > /dev/null fi - [ -n "${_ropts_initdone}" ] && message=3D"${message} ." - - info "${message}" + [ -n "${_ropts_initdone}" ] && echo '.' } options_inet6() @@ -397,15 +391,13 @@ if checkyesno ipv6_gateway_enable; then ropts_init inet6 - message=3D"${message} gateway=3DYES" + echo -n ' gateway=3DYES' ${SYSCTL} net.inet6.ip6.forwarding=3D1 > /dev/null else ${SYSCTL} net.inet6.ip6.forwarding=3D0 > /dev/null fi - [ -n "${_ropts_initdone}" ] && message=3D"${message} ." - - info "${message}" + [ -n "${_ropts_initdone}" ] && echo '.' } load_rc_config $name Regards, vermaden --=20 You are receiving this mail because: You are the assignee for the bug.=