Date: Wed, 10 Feb 2016 18:04:58 +0100 From: "Ronald Klop" <ronald-lists@klop.ws> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Mark Felder" <feld@freebsd.org> Subject: Re: svn commit: r295471 - in head/etc: defaults rc.d Message-ID: <op.ycmm2qq8kndu52@53555a16.cm-6-6b.dynamic.ziggo.nl> In-Reply-To: <201602101613.u1AGDx0I003885@repo.freebsd.org> References: <201602101613.u1AGDx0I003885@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 10 Feb 2016 17:13:59 +0100, Mark Felder <feld@freebsd.org> wrote: > Author: feld (ports committer) > Date: Wed Feb 10 16:13:59 2016 > New Revision: 295471 > URL: https://svnweb.freebsd.org/changeset/base/295471 > > Log: > Add new rc.conf parameter "jail_reverse_stop" > When a user defines "jail_list" in rc.conf the jails are started in the > order defined. Currently the jails are not are stopped in reverse order > which may break dependencies between jails/services and prevent a clean > shutdown. The new parameter "jail_reverse_stop" will shutdown jails in > "jail_list" in reverse order when set to "YES". > Please note that this does not affect manual invocation of the jail rc > script. If a user runs the command > # service jail stop jail1 jail2 jail3 > the jails will be stopped in exactly the order specified regardless of > jail_reverse_stop being defined in rc.conf. > PR: 196152 Good feature. I know POLA is always very important in FreeBSD development, but having this setting on by default seems very reasonable to me. Regards, Ronald. > Approved by: jamie > MFC after: 1 week > Relnotes: yes > Differential Revision: https://reviews.freebsd.org/D5233 > > Modified: > head/etc/defaults/rc.conf > head/etc/rc.d/jail > > Modified: head/etc/defaults/rc.conf > ============================================================================== > --- head/etc/defaults/rc.conf Wed Feb 10 15:56:52 2016 (r295470) > +++ head/etc/defaults/rc.conf Wed Feb 10 16:13:59 2016 (r295471) > @@ -694,6 +694,7 @@ iovctl_files="" # Config files for iovc > jail_enable="NO" # Set to NO to disable starting of any jails > jail_parallel_start="NO" # Start jails in the background > jail_list="" # Space separated list of names of jails > +jail_reverse_stop="NO" # Stop jails in reverse order > ############################################################## > ### Define source_rc_confs, the mechanism used by /etc/rc.* ## > > Modified: head/etc/rc.d/jail > ============================================================================== > --- head/etc/rc.d/jail Wed Feb 10 15:56:52 2016 (r295470) > +++ head/etc/rc.d/jail Wed Feb 10 16:13:59 2016 (r295471) > @@ -521,7 +521,11 @@ jail_stop() > command=$jail_program > rc_flags=$jail_flags > command_args="-f $jail_conf -r" > - $jail_jls name | while read _j; do > + if checkyesno jail_reverse_stop; then > + $jail_jls name | tail -r > + else > + $jail_jls name > + fi | while read _j; do > echo -n " $_j" > _tmp=`mktemp -t jail` || exit 3 > $command $rc_flags $command_args $_j >> $_tmp 2>&1 > @@ -536,6 +540,7 @@ jail_stop() > return > ;; > esac > + checkyesno jail_reverse_stop && set -- $(reverse_list $@) > for _j in $@; do > _j=$(echo $_j | tr /. _) > _jv=$(echo -n $_j | tr -c '[:alnum:]' _) > @@ -571,5 +576,6 @@ jail_warn() > load_rc_config $name > case $# in > 1) run_rc_command $@ ${jail_list:-_ALL} ;; > -*) run_rc_command $@ ;; > +*) jail_reverse_stop="no" > + run_rc_command $@ ;; > esac > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?op.ycmm2qq8kndu52>