From owner-freebsd-current@FreeBSD.ORG Thu Dec 22 19:31:21 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31790106566C for ; Thu, 22 Dec 2011 19:31:21 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id B6C6D8FC19 for ; Thu, 22 Dec 2011 19:31:20 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 9851D25D37C7; Thu, 22 Dec 2011 19:31:19 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 9FF95BD78FE; Thu, 22 Dec 2011 19:31:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 21h+GAJw3t5a; Thu, 22 Dec 2011 19:31:17 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 752EEBD78FB; Thu, 22 Dec 2011 19:31:17 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: Date: Thu, 22 Dec 2011 19:31:16 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <01A08619-4DE1-42E6-8F2F-38BB56C8615F@lists.zabbadoz.net> To: Dan The Man X-Mailer: Apple Mail (2.1084) Cc: freebsd-current@freebsd.org Subject: Re: jexec -h hostname option X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Dec 2011 19:31:21 -0000 On 22. Dec 2011, at 16:03 , Dan The Man wrote: >=20 >=20 > On Thu, 22 Dec 2011, Bjoern A. Zeeb wrote: >=20 >>=20 >> On 22. Dec 2011, at 14:03 , Dan The Man wrote: >>=20 >>>=20 >>>=20 >>> http://www.freebsd.org/relnotes/CURRENT/relnotes/new.html#USERLAND >>> jexec(8) now supports -h hostname option to specify the jail where = the command will be executed. >>>=20 >>=20 >> Oh wow. That's all but current. >>=20 >>=20 >>>=20 >>> When was this added? I don't see it functioning: >>=20 >> 3 years 6 months ago and it was shortly afterwards removed again as = neither >> a) the hostname not b) the ip addresses needed to be unique anymore = with >> multi-IP jails (a) not even before that). The suggested replacement = was >> -n to name the jails yourself. I think the uniqueness limit has = since been >> removed on that as well but the option has stayed and by default is = the >> jail ID these days and it's name=3D<..> in the modern syntax. >>=20 >> /bz >>=20 >> --=20 >> Bjoern A. Zeeb You have to have = visions! >> Stop bit received. Insert coin for new address family. >>=20 >>=20 >=20 > Yeah, seems problematic, from what I have seen so far everytime you = stop and restart the jail it gets a different jail ID, which would make = it difficult to cron anything to execute in the jail. I can't seem to = get jexec to take anything but jail id. >=20 > Came up with a temporary type solution assuming you have only 1 jail: > JAILID=3D`/usr/sbin/jls -n name|cut -d '=3D' -f 2`; /usr/sbin/jexec = $JAILID command >=20 > I can see this being problematic for a long term/portable solution. jexec on a name works fine if you start the jail with a name as well. See the jail(8) man page on how to either use -n or name=3D. jail -n foo ... or jail name=3Dfoo ... then jexec foo ... --=20 Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family.