From owner-freebsd-current@FreeBSD.ORG Thu Dec 22 16:03:44 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 1783A1065673 for ; Thu, 22 Dec 2011 16:03:44 +0000 (UTC) (envelope-from dan@sunsaturn.com) Received: from sunsaturn.com (mail1.sunsaturn.com [IPv6:2001:49f0:4004::2]) by mx1.freebsd.org (Postfix) with ESMTP id D46ED8FC0C for ; Thu, 22 Dec 2011 16:03:43 +0000 (UTC) Received: by sunsaturn.com (Postfix, from userid 1001) id 1F3BA119C6D; Thu, 22 Dec 2011 10:03:43 -0600 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=sunsaturn.com; s=gamma; t=1324569823; bh=3u+PjdCBZi3vub1azt3kHrpDm59heg+3SfzKMldE8kI=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=RVtrsFSgoqhyXPO3yzQagOJLZ6plHz4G0lYKQ0Srf+D3ZrNObcVyiDKMNzDH6L/g7 eWOlPAg/3HkArG6EqFGfDXKD87VXpuea2eG1Pq6Qp2idDHAFSg6CjfnABvn49wQkW2 ACgIBQd0TyHDWH9I5VxKQKjHVSmP7Se2YyIxPvm0= Received: from localhost (localhost [127.0.0.1]) by sunsaturn.com (Postfix) with ESMTP id 1EA38119C6C; Thu, 22 Dec 2011 10:03:43 -0600 (CST) Date: Thu, 22 Dec 2011 10:03:43 -0600 (CST) From: Dan The Man To: "Bjoern A. Zeeb" In-Reply-To: <01A08619-4DE1-42E6-8F2F-38BB56C8615F@lists.zabbadoz.net> Message-ID: References: <01A08619-4DE1-42E6-8F2F-38BB56C8615F@lists.zabbadoz.net> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed 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 16:03:44 -0000 On Thu, 22 Dec 2011, Bjoern A. Zeeb wrote: > > On 22. Dec 2011, at 14:03 , Dan The Man wrote: > >> >> >> 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. >> > > Oh wow. That's all but current. > > >> >> When was this added? I don't see it functioning: > > 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=<..> in the modern syntax. > > /bz > > -- > Bjoern A. Zeeb You have to have visions! > Stop bit received. Insert coin for new address family. > > 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. Came up with a temporary type solution assuming you have only 1 jail: JAILID=`/usr/sbin/jls -n name|cut -d '=' -f 2`; /usr/sbin/jexec $JAILID command I can see this being problematic for a long term/portable solution. Dan. -- Dan The Man CTO/ Senior System Administrator Websites, Domains and Everything else http://www.SunSaturn.com Email: Dan@SunSaturn.com