rc.d/*: Use startmsg instead of echo on start messages

By rc.conf(5), setting rc_startmsgs="NO" should silence start messages.

Fix a few rc scripts by using startmsg.

PR:		255207
Reported by:	Jose Luis Duran <jlduran@gmail.com>
Reviewed by:	imp, 0mp
Approved by:	imp (src)
Differential Revision:	https://reviews.freebsd.org/D34514
This commit is contained in:
Jose Luis Duran 2022-03-13 18:54:39 +01:00 committed by Mateusz Piotrowski
parent 325ebf37d8
commit 19a6267d61
6 changed files with 18 additions and 18 deletions

View File

@ -450,7 +450,7 @@ jail_start()
if [ $# = 0 ]; then
return
fi
echo -n 'Starting jails:'
startmsg -n 'Starting jails:'
case $1 in
_ALL)
command=$jail_program
@ -462,14 +462,14 @@ jail_start()
_tmp=`mktemp -t jail` || exit 3
if $command $rc_flags $command_args >> $_tmp 2>&1; then
$jail_jls jid name | while read _id _name; do
echo -n " $_name"
startmsg -n " $_name"
echo $_id > /var/run/jail_${_name}.id
done
else
cat $_tmp
fi
rm -f $_tmp
echo '.'
startmsg '.'
return
;;
esac
@ -490,11 +490,11 @@ jail_start()
_tmp=`mktemp -t jail_${_j}` || exit 3
if $command $rc_flags $command_args \
>> $_tmp 2>&1 </dev/null; then
echo -n " ${_hostname:-${_j}}"
startmsg -n " ${_hostname:-${_j}}"
_jid=$($jail_jls -j $_j jid)
echo $_jid > /var/run/jail_${_j}.id
else
echo " cannot start jail " \
startmsg " cannot start jail " \
"\"${_hostname:-${_j}}\": "
cat $_tmp
fi
@ -517,18 +517,18 @@ jail_start()
_tmp=`mktemp -t jail` || exit 3
if $command $rc_flags $command_args \
>> $_tmp 2>&1 </dev/null; then
echo -n " ${_hostname:-${_j}}"
startmsg -n " ${_hostname:-${_j}}"
_jid=$($jail_jls -j $_j jid)
echo $_jid > /var/run/jail_${_j}.id
else
echo " cannot start jail " \
startmsg " cannot start jail " \
"\"${_hostname:-${_j}}\": "
cat $_tmp
fi
rm -f $_tmp
done
fi
echo '.'
startmsg '.'
}
jail_stop()

View File

@ -18,9 +18,9 @@ stop_cmd="local_stop"
local_start()
{
if [ -f /etc/rc.local ]; then
echo -n 'Starting local daemons:'
startmsg -n 'Starting local daemons:'
. /etc/rc.local
echo '.'
startmsg '.'
fi
}

View File

@ -247,7 +247,7 @@ netif_common()
_str='Reclaiming'
;;
esac
echo "${_str} Network:${_ok}."
startmsg "${_str} Network:${_ok}."
case ${_func} in
ifn_vnetup)
# Clear _ok not to do "ifconfig $ifn"

View File

@ -82,14 +82,14 @@ ppp_start()
_ppp_profile=$ppp_profile
fi
echo -n "Starting PPP profile:"
startmsg -n "Starting PPP profile:"
for _p in $_ppp_profile; do
echo -n " $_p"
startmsg -n " $_p"
ppp_start_profile $_p
done
echo "."
startmsg "."
}
ppp_poststart()

View File

@ -24,7 +24,7 @@ pppoed_start()
if [ -n "${pppoed_provider}" ]; then
pppoed_flags="${pppoed_flags} -p ${pppoed_provider}"
fi
echo 'Starting pppoed'
startmsg 'Starting pppoed'
_opts=$-; set -f
/usr/libexec/pppoed ${pppoed_flags} ${pppoed_interface}
set +f; set -${_opts}

View File

@ -90,14 +90,14 @@ rfcomm_pppd_server_start()
_profile=${rfcomm_pppd_server_profile}
fi
echo -n "Starting RFCOMM PPP profile:"
startmsg -n "Starting RFCOMM PPP profile:"
for _p in ${_profile} ; do
echo -n " ${_p}"
startmsg -n " ${_p}"
rfcomm_pppd_server_start_profile ${_p}
done
echo "."
startmsg "."
}
rfcomm_pppd_server_stop()