From owner-freebsd-rc@FreeBSD.ORG Thu Jun 3 01:10:04 2010 Return-Path: Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48009106566C for ; Thu, 3 Jun 2010 01:10:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (unknown [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 1E2108FC0C for ; Thu, 3 Jun 2010 01:10:04 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o531A3um038676 for ; Thu, 3 Jun 2010 01:10:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o531A3I8038674; Thu, 3 Jun 2010 01:10:03 GMT (envelope-from gnats) Date: Thu, 3 Jun 2010 01:10:03 GMT Message-Id: <201006030110.o531A3I8038674@freefall.freebsd.org> To: freebsd-rc@FreeBSD.org From: Chad Milios Cc: Subject: Re: conf/146053: [patch] [request] shutdown of jails breaks inter-jail dependencies X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Chad Milios List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2010 01:10:04 -0000 The following reply was made to PR conf/146053; it has been noted by GNATS. From: Chad Milios To: bug-followup@FreeBSD.org Cc: Subject: Re: conf/146053: [patch] [request] shutdown of jails breaks inter-jail dependencies Date: Wed, 2 Jun 2010 18:03:32 -0700 (PDT) I think my original change request may have been unclear and my example was certainly contrived. If a user of FreeBSD jails wishes to ensure that for jail A B and C, A and B are always running at any point in time in which C is, it is impossible to do so using the existing rc.conf system because `/etc/rc.d/jail stop` will stop them all, serially, in the same order that `./jail start` started them all. In the EXISTING implementation, for rc.d scripts "a b jail f" (as a list output by rcorder(8)), and jails "C D E": rc does basically something to the effect of: `./a start; ./b start; ./jail start C; ./jail stop D; ./jail stop E; ./f start` while rc.shutdown then later does something to the effect of: `./f stop; ./jail stop C; ./jail stop D; ./jail stop E; ./b stop; ./a stop` but I PROPOSE that the rc.shutdown process should instead result in: `./f stop; ./jail stop E; ./jail stop D; ./jail stop C; ./b stop; ./a stop` If no one seems to care and there is no one worrying about their jails' shutdown order, IMHO we should just quietly add the single important line of my patch to rc.d/jail: jail_stop() { echo -n 'Stopping jails:' +jail_list=`reverse_list $jail_list` and not clutter up rc.conf any more with this jail_reverse_shutdown boolean. But, the patch i originally provided will add this rc.conf variable while allowing existing behavior to remain the default. Just because we are not meta-data gathering and automatically dependency sorting the jails for the user (a la what rcorder does with the rc.d scripts) doesn't mean we shouldn't reverse that jail_list for them when it comes time to shutdown, (like rc.shutdown does to the dependency-sorted list of rc.d scripts that are output from rcorder,) since the user may have ordered their jail_list manually for dependency reasons, and some dependencies may be required all the way through shutdown for a particular servi ce. reversing the jail list in jail_stop also affects manual use of the jail rc.d script on the command line such as `./jail start A B C` and `./jail stop A B C`. the jails should still be listed in dependency order on the command line because jail_stop will reverse the list when stopping them.