From owner-freebsd-questions@FreeBSD.ORG Tue Jun 24 16:26:47 2014 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8831D883 for ; Tue, 24 Jun 2014 16:26:47 +0000 (UTC) Received: from relay.mailchannels.net (ar-005-i202.relay.mailchannels.net [162.253.144.84]) by mx1.freebsd.org (Postfix) with ESMTP id E1AF42DB3 for ; Tue, 24 Jun 2014 16:26:46 +0000 (UTC) X-Sender-Id: _forwarded-from|107.201.34.133 Received: from mail-24.name-services.com (unknown [10.33.130.169]) by relay.mailchannels.net (Postfix) with ESMTPA id 6E63D61929 for ; Tue, 24 Jun 2014 16:26:36 +0000 (UTC) X-Sender-Id: _forwarded-from|107.201.34.133 Received: from mail-24.name-services.com (mail-24.name-services.com [10.227.41.147]) (using TLSv1 with cipher AES128-SHA) by 0.0.0.0:2500 (trex/5.2.4); Tue, 24 Jun 2014 16:26:37 GMT X-MC-Relay: Forwarding X-MailChannels-SenderId: _forwarded-from|107.201.34.133 X-MailChannels-Auth-Id: demandmedia Received: from [10.0.10.1] (107-201-34-133.lightspeed.bcvloh.sbcglobal.net [107.201.34.133]) by mail-24.name-services.com with SMTP; Tue, 24 Jun 2014 09:26:27 -0700 Message-ID: <53A9A6B1.5060804@a1poweruser.com> Date: Tue, 24 Jun 2014 12:26:25 -0400 From: Fbsd8 User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: questions Subject: Re: chroot command used with screen utility References: <53A712AF.4030900@a1poweruser.com> In-Reply-To: <53A712AF.4030900@a1poweruser.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jun 2014 16:26:47 -0000 Fbsd8 wrote: > Hello list > > I have three directory tree filesystems that I want chrooted. > When I issue the chroot path command the host console turns into > the console prompt for the chroot. To have 3 individual chrooted > filesystems I alt/F2 and chroot filesystem #1 , > then I alt/F2 and chroot filesystem #2 and so on. > So I end up having F1 for the host console, > F2 for the filesystem #1 > F3 for the filesystem #2 > F4 for the filesystem #3 > > The goal is to have a primary start up script which will start the > chroot filesystems from the host console without the chroot consuming > the host's console. The "man chroot" command has very little info about > usage. I can only think what I want done can not be done with the chroot > command syntax. > > I am now testing with the screen command. I get a daisy-string effect of > shells within shells. > > If there is some other method to do this I am interested. > But help with using screen is desired. > > Thanks > For the archives. Never received a reply. But I continued to work on scripting screen to run multiple chroot filesystems. Finally this created a screen in detached mode that was running a chrooted filesystem. screen -S $name -d -m chroot /usr/chroot/$name This was only half of the problem, still needed to script some way to stop the chroot running in a screen. Tried these different commands screen -S $name -X exit screen -p $name -X exit screen -S $name -X shutdown now They did not work. Finally went the kill task method screen_pid=`screen -ls | grep $name | cut -f 1 -d .` /bin/kill ${screen_pid}