Re: svn commit: r316487 - head/etc

2017-04-06 Thread Dag-Erling Smørgrav
Cy Schubert  writes:
> Dag-Erling Smørgrav  writes:
> > Note that none of these variables are documented, so using them
> > outside of rc.subr itself is arguably a bug.
> Agreed. Regardless, an UPDATING entry will still be needed because ports 
> and third party software may have the same "bug" as rc.d/dhclient and 
> rc.d/bgfsck.

We could ask portmgr for a list of packages that install files in
%%ETCDIR%%/rc.d and a copy of those files.

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Re: svn commit: r316487 - head/etc

2017-04-06 Thread Cy Schubert
In message <868tne3rfh@desk.des.no>, =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?
= w
rites:
> Cy Schubert  writes:
> > Dag-Erling Smørgrav  writes:
> > > Could you please revert?
> > Sure, it's been reverted.
> 
> No, you misunderstood...  I meant revert *my* commit.  I didn't know it
> had already been fixed (for some value of fixed) when I wrote this.

It's reverted now.

> 
> > Are you thinking of a more intrusive change like my first draft of the
> > patch?
> 
> Sorry, haven't looked at your patch.  Mine adds check_debug, check_force
> etc. and uses them everywhere.
> 
> Note that none of these variables are documented, so using them outside
> of rc.subr itself is arguably a bug.

Agreed. Regardless, an UPDATING entry will still be needed because ports 
and third party software may have the same "bug" as rc.d/dhclient and 
rc.d/bgfsck.


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX:     Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r316487 - head/etc

2017-04-06 Thread Dag-Erling Smørgrav
Cy Schubert  writes:
> Dag-Erling Smørgrav  writes:
> > Could you please revert?
> Sure, it's been reverted.

No, you misunderstood...  I meant revert *my* commit.  I didn't know it
had already been fixed (for some value of fixed) when I wrote this.

> Are you thinking of a more intrusive change like my first draft of the
> patch?

Sorry, haven't looked at your patch.  Mine adds check_debug, check_force
etc. and uses them everywhere.

Note that none of these variables are documented, so using them outside
of rc.subr itself is arguably a bug.

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Re: svn commit: r316487 - head/etc

2017-04-05 Thread Cy Schubert
In message <861st64hjz@desk.des.no>, =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?
= w
rites:
> Cy Schubert  writes:
> > This patch caused some boot failures because the contents of rc_force were 
> > redefined from "yes" (for yes) and NULL (for no) to the words "yes" and 
> > "no". This in turn caused etc/rc.d/dhclient to assume force when $rc_force 
> > was not NULL (test -z failed). Interfaces with static IP addresses invoked 
> > rc.d/dhclient through devd. The attached patch should make all instances 
> > $rc_force consistent with your change.
> 
> Yes, I just realized.  I committed the wrong version of the patch.  I
> had a version in a different tree which added check_force
> etc. functions.
> 
> Could you please revert?  I'd like to spend a little more time making
> sure I get everything right.

Sure, it's been reverted. People will need to remember to not run 
mergemaster or avoid updating rc.subr until the final version is committed 
or dhclient will *always* be started by devd regardless of rc.conf.

Are you thinking of a more intrusive change like my first draft of the 
patch? ngie@ suggested that there be an UPDATING entry.


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX:     Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r316487 - head/etc

2017-04-05 Thread Dag-Erling Smørgrav
Cy Schubert  writes:
> This patch caused some boot failures because the contents of rc_force were 
> redefined from "yes" (for yes) and NULL (for no) to the words "yes" and 
> "no". This in turn caused etc/rc.d/dhclient to assume force when $rc_force 
> was not NULL (test -z failed). Interfaces with static IP addresses invoked 
> rc.d/dhclient through devd. The attached patch should make all instances 
> $rc_force consistent with your change.

Yes, I just realized.  I committed the wrong version of the patch.  I
had a version in a different tree which added check_force
etc. functions.

Could you please revert?  I'd like to spend a little more time making
sure I get everything right.

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Re: svn commit: r316487 - head/etc

2017-04-04 Thread Cy Schubert
In message <58cc0b95-0423-429e-ba73-0f0bd3a2a...@gmail.com>, Ngie Cooper 
writes
:
> 
> 
> > On Apr 4, 2017, at 20:05, Cy Schubert  wrote:
> > 
> > In message <201704041143.v34bhvna046...@repo.freebsd.org>, 
> > =?UTF-8?Q?Dag-Erling
> > _Sm=c3=b8rgrav?= writes:
> >> Author: des
> >> Date: Tue Apr  4 11:43:31 2017
> >> New Revision: 316487
> >> URL: https://svnweb.freebsd.org/changeset/base/316487
> >> 
> >> Log:
> >>  Allow command modifiers (fast, quiet etc.) to be stacked in any order.
> >>  Add a "debug" modifier that sets rc_debug.
> >> 
> >>  MFC after:3 weeks
> >> 
> >> Modified:
> >>  head/etc/rc.subr
> >> 
> >> Modified: head/etc/rc.subr
> >> ==
> ===
> >> =
> >> --- head/etc/rc.subrTue Apr  4 08:17:03 2017(r316486)
> >> +++ head/etc/rc.subrTue Apr  4 11:43:31 2017(r316487)
> >> @@ -703,10 +703,11 @@ check_startmsgs()
> >> #If argument has a given prefix, then change the operation as follows:
> >> #PrefixOperation
> >> #---
> >> -#fastSkip the pid check, and set rc_fast=yes, rc_quiet=yes
> >> -#forceSet ${rcvar} to YES, and set rc_force=yes
> >> -#oneSet ${rcvar} to YES
> >> -#quietDon't output some diagnostics, and set rc_quiet=yes
> >> +#debugEnable debugging messages and set rc_debug to yes
> >> +#fastSkip the pid check and set rc_fast and rc_quiet to yes
> >> +#forceSkip sanity checks and set ${rcvar} and rc_force to yes
> >> +#oneSet ${rcvar} and set rc_one to yes
> >> +#quietDon't output some diagnostics, and set rc_quiet to yes
> >> #
> >> #The following globals are used:
> >> #
> >> @@ -856,6 +857,8 @@ check_startmsgs()
> >> #rc_argArgument to command, after fast/force/one processing
> >> #performed
> >> #
> >> +#rc_debugTrue if "debug" was provided
> >> +#
> >> #rc_flagsFlags to start the default command with.
> >> #Defaults to ${name}_flags, unless overridden
> >> #by $flags from the environment.
> >> @@ -863,9 +866,11 @@ check_startmsgs()
> >> #
> >> #rc_pidPID of command (if appropriate)
> >> #
> >> -#rc_fastNot empty if "fast" was provided (q.v.)
> >> +#rc_fastNot empty if "fast" was provided
> >> +#
> >> +#rc_forceNot empty if "force" was provided
> >> #
> >> -#rc_forceNot empty if "force" was provided (q.v.)
> >> +#rc_oneNot empty if "one" was provided
> >> #
> >> #rc_quietNot empty if "quiet" was provided
> >> #
> >> @@ -884,34 +889,47 @@ run_rc_command()
> >>shift 1
> >>rc_extra_args="$*"
> >> 
> >> -_rc_prefix=
> >> -case "$rc_arg" in
> >> -fast*)# "fast" prefix; don't check pid
> >> -rc_arg=${rc_arg#fast}
> >> -rc_fast=yes
> >> -rc_quiet=yes
> >> -;;
> >> -force*)# "force" prefix; always run
> >> -rc_force=yes
> >> -_rc_prefix=force
> >> -rc_arg=${rc_arg#${_rc_prefix}}
> >> -if [ -n "${rcvar}" ]; then
> >> -eval ${rcvar}=YES
> >> -fi
> >> -;;
> >> -one*)# "one" prefix; set ${rcvar}=yes
> >> -_rc_prefix=one
> >> -rc_arg=${rc_arg#${_rc_prefix}}
> >> +: ${rc_debug:=no} ${rc_fast:=no} ${rc_force:=no} ${rc_one:=no} ${rc_q
> ui
> >> et:=no}
> >> +while :; do
> >> +case "$rc_arg" in
> >> +debug*)# "debug" prefix; enable debugging
> >> +rc_debug=yes
> >> +rc_quiet=no
> >> +rc_arg=${rc_arg#debug}
> >> +_rc_prefix="${_rc_prefix}debug"
> >> +;;
> >> +fast*)# "fast" prefix; don't check pid
> >> +rc_fast=yes
> >> +rc_quiet=yes
> >> +rc_arg=${rc_arg#fast}
> >> +_rc_prefix="${_rc_prefix}fast"
> >> +;;
> >> +force*)# "force" prefix; always run
> >> +rc_force=yes
> >> +rc_arg=${rc_arg#force}
> >> +_rc_prefix="${_rc_prefix}force"
> >> +;;
> >> +one*)# "one" prefix; set ${rcvar}=yes
> >> +rc_one=yes
> >> +rc_arg=${rc_arg#one}
> >> +_rc_prefix="${_rc_prefix}one"
> >> +;;
> >> +quiet*)# "quiet" prefix; omit some messages
> >> +rc_quiet=yes
> >> +rc_arg=${rc_arg#quiet}
> >> +_rc_prefix="${_rc_prefix}quiet"
> >> +;;
> >> +*)
> >> +break
> >> +;;
> >> +esac
> >> +done
> >> +if checkyesno rc_force || checkyesno rc_one ; then
> >>if [ -n "${rcvar}" ]; then
> >>eval ${rcvar}=YES
> >>fi
> >> -;;
> >> -quiet*)# "quiet" prefix; omit some messages
> >> -   

Re: svn commit: r316487 - head/etc

2017-04-04 Thread Ngie Cooper

> On Apr 4, 2017, at 20:05, Cy Schubert  wrote:
> 
> In message <201704041143.v34bhvna046...@repo.freebsd.org>, 
> =?UTF-8?Q?Dag-Erling
> _Sm=c3=b8rgrav?= writes:
>> Author: des
>> Date: Tue Apr  4 11:43:31 2017
>> New Revision: 316487
>> URL: https://svnweb.freebsd.org/changeset/base/316487
>> 
>> Log:
>>  Allow command modifiers (fast, quiet etc.) to be stacked in any order.
>>  Add a "debug" modifier that sets rc_debug.
>> 
>>  MFC after:3 weeks
>> 
>> Modified:
>>  head/etc/rc.subr
>> 
>> Modified: head/etc/rc.subr
>> =
>> =
>> --- head/etc/rc.subrTue Apr  4 08:17:03 2017(r316486)
>> +++ head/etc/rc.subrTue Apr  4 11:43:31 2017(r316487)
>> @@ -703,10 +703,11 @@ check_startmsgs()
>> #If argument has a given prefix, then change the operation as follows:
>> #PrefixOperation
>> #---
>> -#fastSkip the pid check, and set rc_fast=yes, rc_quiet=yes
>> -#forceSet ${rcvar} to YES, and set rc_force=yes
>> -#oneSet ${rcvar} to YES
>> -#quietDon't output some diagnostics, and set rc_quiet=yes
>> +#debugEnable debugging messages and set rc_debug to yes
>> +#fastSkip the pid check and set rc_fast and rc_quiet to yes
>> +#forceSkip sanity checks and set ${rcvar} and rc_force to yes
>> +#oneSet ${rcvar} and set rc_one to yes
>> +#quietDon't output some diagnostics, and set rc_quiet to yes
>> #
>> #The following globals are used:
>> #
>> @@ -856,6 +857,8 @@ check_startmsgs()
>> #rc_argArgument to command, after fast/force/one processing
>> #performed
>> #
>> +#rc_debugTrue if "debug" was provided
>> +#
>> #rc_flagsFlags to start the default command with.
>> #Defaults to ${name}_flags, unless overridden
>> #by $flags from the environment.
>> @@ -863,9 +866,11 @@ check_startmsgs()
>> #
>> #rc_pidPID of command (if appropriate)
>> #
>> -#rc_fastNot empty if "fast" was provided (q.v.)
>> +#rc_fastNot empty if "fast" was provided
>> +#
>> +#rc_forceNot empty if "force" was provided
>> #
>> -#rc_forceNot empty if "force" was provided (q.v.)
>> +#rc_oneNot empty if "one" was provided
>> #
>> #rc_quietNot empty if "quiet" was provided
>> #
>> @@ -884,34 +889,47 @@ run_rc_command()
>>shift 1
>>rc_extra_args="$*"
>> 
>> -_rc_prefix=
>> -case "$rc_arg" in
>> -fast*)# "fast" prefix; don't check pid
>> -rc_arg=${rc_arg#fast}
>> -rc_fast=yes
>> -rc_quiet=yes
>> -;;
>> -force*)# "force" prefix; always run
>> -rc_force=yes
>> -_rc_prefix=force
>> -rc_arg=${rc_arg#${_rc_prefix}}
>> -if [ -n "${rcvar}" ]; then
>> -eval ${rcvar}=YES
>> -fi
>> -;;
>> -one*)# "one" prefix; set ${rcvar}=yes
>> -_rc_prefix=one
>> -rc_arg=${rc_arg#${_rc_prefix}}
>> +: ${rc_debug:=no} ${rc_fast:=no} ${rc_force:=no} ${rc_one:=no} ${rc_qui
>> et:=no}
>> +while :; do
>> +case "$rc_arg" in
>> +debug*)# "debug" prefix; enable debugging
>> +rc_debug=yes
>> +rc_quiet=no
>> +rc_arg=${rc_arg#debug}
>> +_rc_prefix="${_rc_prefix}debug"
>> +;;
>> +fast*)# "fast" prefix; don't check pid
>> +rc_fast=yes
>> +rc_quiet=yes
>> +rc_arg=${rc_arg#fast}
>> +_rc_prefix="${_rc_prefix}fast"
>> +;;
>> +force*)# "force" prefix; always run
>> +rc_force=yes
>> +rc_arg=${rc_arg#force}
>> +_rc_prefix="${_rc_prefix}force"
>> +;;
>> +one*)# "one" prefix; set ${rcvar}=yes
>> +rc_one=yes
>> +rc_arg=${rc_arg#one}
>> +_rc_prefix="${_rc_prefix}one"
>> +;;
>> +quiet*)# "quiet" prefix; omit some messages
>> +rc_quiet=yes
>> +rc_arg=${rc_arg#quiet}
>> +_rc_prefix="${_rc_prefix}quiet"
>> +;;
>> +*)
>> +break
>> +;;
>> +esac
>> +done
>> +if checkyesno rc_force || checkyesno rc_one ; then
>>if [ -n "${rcvar}" ]; then
>>eval ${rcvar}=YES
>>fi
>> -;;
>> -quiet*)# "quiet" prefix; omit some messages
>> -_rc_prefix=quiet
>> -rc_arg=${rc_arg#${_rc_prefix}}
>> -rc_quiet=yes
>> -;;
>> -esac
>> +fi
>> +debug "_rc_prefix=${_rc_prefix}"
>> 
>>eval _override_command=\$${name}_program
>>command=${_override_command:-$command}
>> 
>> 
> 
> 
> Hi des,
> 
> This patch caused some boot failures because the 

Re: svn commit: r316487 - head/etc

2017-04-04 Thread Cy Schubert
In message <201704041143.v34bhvna046...@repo.freebsd.org>, 
=?UTF-8?Q?Dag-Erling
_Sm=c3=b8rgrav?= writes:
> Author: des
> Date: Tue Apr  4 11:43:31 2017
> New Revision: 316487
> URL: https://svnweb.freebsd.org/changeset/base/316487
> 
> Log:
>   Allow command modifiers (fast, quiet etc.) to be stacked in any order.
>   Add a "debug" modifier that sets rc_debug.
>   
>   MFC after:  3 weeks
> 
> Modified:
>   head/etc/rc.subr
> 
> Modified: head/etc/rc.subr
> =
> =
> --- head/etc/rc.subr  Tue Apr  4 08:17:03 2017(r316486)
> +++ head/etc/rc.subr  Tue Apr  4 11:43:31 2017(r316487)
> @@ -703,10 +703,11 @@ check_startmsgs()
>  #If argument has a given prefix, then change the operation as follows:
>  #Prefix  Operation
>  #--  -
> -#fastSkip the pid check, and set rc_fast=yes, rc_quiet=yes
> -#force   Set ${rcvar} to YES, and set rc_force=yes
> -#one Set ${rcvar} to YES
> -#quiet   Don't output some diagnostics, and set rc_quiet=yes
> +#debug   Enable debugging messages and set rc_debug to yes
> +#fastSkip the pid check and set rc_fast and rc_quiet to yes
> +#force   Skip sanity checks and set ${rcvar} and rc_force to yes
> +#one Set ${rcvar} and set rc_one to yes
> +#quiet   Don't output some diagnostics, and set rc_quiet to yes
>  #
>  #The following globals are used:
>  #
> @@ -856,6 +857,8 @@ check_startmsgs()
>  #rc_arg  Argument to command, after fast/force/one processing
>  #performed
>  #
> +#rc_debugTrue if "debug" was provided
> +#
>  #rc_flagsFlags to start the default command with.
>  #Defaults to ${name}_flags, unless overridden
>  #by $flags from the environment.
> @@ -863,9 +866,11 @@ check_startmsgs()
>  #
>  #rc_pid  PID of command (if appropriate)
>  #
> -#rc_fast Not empty if "fast" was provided (q.v.)
> +#rc_fast Not empty if "fast" was provided
> +#
> +#rc_forceNot empty if "force" was provided
>  #
> -#rc_forceNot empty if "force" was provided (q.v.)
> +#rc_one  Not empty if "one" was provided
>  #
>  #rc_quietNot empty if "quiet" was provided
>  #
> @@ -884,34 +889,47 @@ run_rc_command()
>   shift 1
>   rc_extra_args="$*"
>  
> - _rc_prefix=
> - case "$rc_arg" in
> - fast*)  # "fast" prefix; don't check pid
> - rc_arg=${rc_arg#fast}
> - rc_fast=yes
> - rc_quiet=yes
> - ;;
> - force*) # "force" prefix; always run
> - rc_force=yes
> - _rc_prefix=force
> - rc_arg=${rc_arg#${_rc_prefix}}
> - if [ -n "${rcvar}" ]; then
> - eval ${rcvar}=YES
> - fi
> - ;;
> - one*)   # "one" prefix; set ${rcvar}=yes
> - _rc_prefix=one
> - rc_arg=${rc_arg#${_rc_prefix}}
> + : ${rc_debug:=no} ${rc_fast:=no} ${rc_force:=no} ${rc_one:=no} ${rc_qui
> et:=no}
> + while :; do
> + case "$rc_arg" in
> + debug*) # "debug" prefix; enable debugging
> + rc_debug=yes
> + rc_quiet=no
> + rc_arg=${rc_arg#debug}
> + _rc_prefix="${_rc_prefix}debug"
> + ;;
> + fast*)  # "fast" prefix; don't check pid
> + rc_fast=yes
> + rc_quiet=yes
> + rc_arg=${rc_arg#fast}
> + _rc_prefix="${_rc_prefix}fast"
> + ;;
> + force*) # "force" prefix; always run
> + rc_force=yes
> + rc_arg=${rc_arg#force}
> + _rc_prefix="${_rc_prefix}force"
> + ;;
> + one*)   # "one" prefix; set ${rcvar}=yes
> + rc_one=yes
> + rc_arg=${rc_arg#one}
> + _rc_prefix="${_rc_prefix}one"
> + ;;
> + quiet*) # "quiet" prefix; omit some messages
> + rc_quiet=yes
> + rc_arg=${rc_arg#quiet}
> + _rc_prefix="${_rc_prefix}quiet"
> + ;;
> + *)
> + break
> + ;;
> + esac
> + done
> + if checkyesno rc_force || checkyesno rc_one ; then
>   if [ -n "${rcvar}" ]; then
>   eval ${rcvar}=YES
>   fi
> - ;;
> - quiet*) # "quiet" prefix; omit some messages
> -