aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Luis Duran <jlduran@gmail.com>2022-03-13 17:54:39 +0000
committerMateusz Piotrowski <0mp@FreeBSD.org>2023-02-22 12:27:50 +0000
commite8396a9592abb08069009e48b84ead2636681b16 (patch)
treecbdb625e5eab231e91f2de6fc748f4facb7c5895
parent8f2bb173bfc6e1a03a56b5098f8d2af740ce743f (diff)
downloadsrc-e8396a9592abb08069009e48b84ead2636681b16.tar.gz
src-e8396a9592abb08069009e48b84ead2636681b16.zip
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 (cherry picked from commit 19a6267d61a0c3bd6cd56f19ca3f8a67a54f675c)
-rwxr-xr-xlibexec/rc/rc.d/jail16
-rwxr-xr-xlibexec/rc/rc.d/local4
-rwxr-xr-xlibexec/rc/rc.d/netif2
-rwxr-xr-xlibexec/rc/rc.d/ppp6
-rwxr-xr-xlibexec/rc/rc.d/pppoed2
-rwxr-xr-xlibexec/rc/rc.d/rfcomm_pppd_server6
6 files changed, 18 insertions, 18 deletions
diff --git a/libexec/rc/rc.d/jail b/libexec/rc/rc.d/jail
index 1d544501e32b..d95af40f459e 100755
--- a/libexec/rc/rc.d/jail
+++ b/libexec/rc/rc.d/jail
@@ -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()
diff --git a/libexec/rc/rc.d/local b/libexec/rc/rc.d/local
index ba17a674ae9d..53907ad27011 100755
--- a/libexec/rc/rc.d/local
+++ b/libexec/rc/rc.d/local
@@ -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
}
diff --git a/libexec/rc/rc.d/netif b/libexec/rc/rc.d/netif
index 3dbb3e1a9588..bb401a6d5ce4 100755
--- a/libexec/rc/rc.d/netif
+++ b/libexec/rc/rc.d/netif
@@ -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"
diff --git a/libexec/rc/rc.d/ppp b/libexec/rc/rc.d/ppp
index 93d0655b296f..8dbff30a7e32 100755
--- a/libexec/rc/rc.d/ppp
+++ b/libexec/rc/rc.d/ppp
@@ -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()
diff --git a/libexec/rc/rc.d/pppoed b/libexec/rc/rc.d/pppoed
index 7e848595e833..c368b32008a1 100755
--- a/libexec/rc/rc.d/pppoed
+++ b/libexec/rc/rc.d/pppoed
@@ -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}
diff --git a/libexec/rc/rc.d/rfcomm_pppd_server b/libexec/rc/rc.d/rfcomm_pppd_server
index 990a22475b0e..a7035f6e4ea7 100755
--- a/libexec/rc/rc.d/rfcomm_pppd_server
+++ b/libexec/rc/rc.d/rfcomm_pppd_server
@@ -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()