MFC r270780:

Fix rc.d/gssd script to define the default values in a standard way.

MFC r270781:
  - Add a warning message when an IPv6 address is specified with no prefixlen.
  - Use a parameter argument in jls(8) instead of doing grep.
This commit is contained in:
hrs 2014-10-09 23:33:33 +00:00
parent d08a17cdad
commit 2197b3dd4a
3 changed files with 18 additions and 25 deletions

View File

@ -288,6 +288,7 @@ kfd_enable="NO" # Run kfd (or NO)
kfd_program="/usr/libexec/kfd" # path to kerberos 5 kfd daemon
gssd_enable="NO" # Run the gssd daemon (or NO).
gssd_program="/usr/sbin/gssd" # Path to gssd.
gssd_flags="" # Flags for gssd.
rwhod_enable="NO" # Run the rwho daemon (or NO).

View File

@ -9,10 +9,8 @@
. /etc/rc.subr
name="gssd"
name=gssd
rcvar=gssd_enable
load_rc_config $name
rcvar="gssd_enable"
command="${gssd:-/usr/sbin/${name}}"
eval ${name}_flags=\"${gssd_flags}\"
run_rc_command "$1"

View File

@ -420,7 +420,7 @@ jail_status()
jail_start()
{
local _j _jid _jn _jl
local _j _jid _jl
if [ $# = 0 ]; then
return
@ -433,12 +433,10 @@ jail_start()
command_args="-f $jail_conf -c"
_tmp=`mktemp -t jail` || exit 3
if $command $rc_flags $command_args >> $_tmp 2>&1; then
$jail_jls -nq | while read IN; do
_jn=$(echo $IN | tr " " "\n" | grep ^name=)
_jid=$(echo $IN | tr " " "\n" | grep ^jid=)
echo -n " ${_jn#name=}"
echo "${_jid#jid=}" \
> /var/run/jail_${_jn#name=}.id
$jail_jls jid name | while read IN; do
set -- $IN
echo -n " $2"
echo $1 > /var/run/jail_$2.id
done
else
tail -1 $_tmp
@ -468,9 +466,8 @@ jail_start()
sleep 1
for _j in $_jl; do
echo -n " ${_hostname:-${_j}}"
if _jid=$($jail_jls -n -j $_j | tr " " "\n" | \
grep ^jid=); then
echo "${_jid#jid=}" > /var/run/jail_${_j}.id
if _jid=$($jail_jls -j $_j jid); then
echo "$_jid" > /var/run/jail_${_j}.id
else
rm -f /var/run/jail_${_j}.id
echo " cannot start jail " \
@ -492,9 +489,8 @@ jail_start()
if $command $rc_flags $command_args \
>> $_tmp 2>&1 </dev/null; then
echo -n " ${_hostname:-${_j}}"
_jid=$($jail_jls -n -j $_j | \
tr " " "\n" | grep ^jid=)
echo "${_jid#jid=}" > /var/run/jail_${_j}.id
_jid=$($jail_jls -j $_j jid)
echo $_jid > /var/run/jail_${_j}.id
else
rm -f /var/run/jail_${_j}.id
echo " cannot start jail " \
@ -509,7 +505,7 @@ jail_start()
jail_stop()
{
local _j _jn
local _j
if [ $# = 0 ]; then
return
@ -520,16 +516,14 @@ jail_stop()
command=$jail_program
rc_flags=$jail_flags
command_args="-f $jail_conf -r"
$jail_jls -nq | while read IN; do
_jn=$(echo $IN | tr " " "\n" | grep ^name=)
echo -n " ${_jn#name=}"
$jail_jls name | while read _j; do
echo -n " $_j"
_tmp=`mktemp -t jail` || exit 3
$command $rc_flags $command_args ${_jn#name=} \
>> $_tmp 2>&1
if $jail_jls -j ${_jn#name=} > /dev/null 2>&1; then
$command $rc_flags $command_args $_j >> $_tmp 2>&1
if $jail_jls -j $_j > /dev/null 2>&1; then
tail -1 $_tmp
else
rm -f /var/run/jail_${_jn#name=}.id
rm -f /var/run/jail_${_j}.id
fi
rm -f $_tmp
done