From owner-freebsd-jail@freebsd.org Wed Feb 6 17:43:50 2019 Return-Path: Delivered-To: freebsd-jail@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7849A14DA508 for ; Wed, 6 Feb 2019 17:43:50 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id E04A576B13 for ; Wed, 6 Feb 2019 17:43:49 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id A0B9814DA507; Wed, 6 Feb 2019 17:43:49 +0000 (UTC) Delivered-To: jail@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E57E14DA506 for ; Wed, 6 Feb 2019 17:43:49 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (gritton.org [199.192.165.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 232AA76B12 for ; Wed, 6 Feb 2019 17:43:49 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org ([127.0.0.131]) by gritton.org (8.15.2/8.15.2) with ESMTP id x16HFB60035576; Wed, 6 Feb 2019 10:15:11 -0700 (MST) (envelope-from jamie@freebsd.org) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 06 Feb 2019 10:15:11 -0700 From: James Gritton To: jail@freebsd.org Subject: Re: jail exit code? In-Reply-To: <20190206152759.GB47586@mail.michaelwlucas.com> References: <20190206152759.GB47586@mail.michaelwlucas.com> Message-ID: X-Sender: jamie@freebsd.org User-Agent: Roundcube Webmail/1.3.8 X-Greylist: inspected by milter-greylist-4.6.2 (gritton.org [127.0.0.131]); Wed, 06 Feb 2019 10:15:11 -0700 (MST) for IP:'127.0.0.131' DOMAIN:'[127.0.0.131]' HELO:'gritton.org' FROM:'jamie@freebsd.org' RCPT:'' X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (gritton.org [127.0.0.131]); Wed, 06 Feb 2019 10:15:11 -0700 (MST) X-Rspamd-Queue-Id: 232AA76B12 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2019 17:43:50 -0000 On 2019-02-06 08:27, Michael W. Lucas wrote: > Hi, > > It *appears* from my reading of mailing list archives & forum posts > that the return code of a jail is the return code of the last jailed > process to exit. > > Is that the standard? Or is that just an accident, and people > shouldn't rely on it? > > (Either way, might be a nice addition to the man page.) Not quite, though there's some relationship. If jail(8) fails to start or stop a jail, it will return an error - just the typical 0 for success, 1 for fail. One reason for this failure may be one of the start or stop scripts returning an error code, in which case while you don't get the command's exit status you do get its general "errorness." But there are other reasons the jail may fail to start/stop, so you can't rely on the exit status to tell you the particulars. - Jamie