From owner-freebsd-questions@FreeBSD.ORG Wed Apr 9 00:52:18 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF7D81065671 for ; Wed, 9 Apr 2008 00:52:18 +0000 (UTC) (envelope-from erik@cepheid.org) Received: from mail.cepheid.org (aleph.cepheid.org [72.232.60.94]) by mx1.freebsd.org (Postfix) with ESMTP id 918CB8FC12 for ; Wed, 9 Apr 2008 00:52:18 +0000 (UTC) (envelope-from erik@cepheid.org) Received: by mail.cepheid.org (Postfix, from userid 1006) id DEC769B4002; Tue, 8 Apr 2008 19:52:17 -0500 (CDT) Date: Tue, 8 Apr 2008 19:52:17 -0500 From: Erik Osterholm To: FreeBSD Mailing Lists Message-ID: <20080409005217.GA97058@aleph.cepheid.org> Mail-Followup-To: Erik Osterholm , FreeBSD Mailing Lists , mla@nasreddine.com References: <20080408220005.GA23508@phoenix.nasreddine.info> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080408220005.GA23508@phoenix.nasreddine.info> User-Agent: Mutt/1.4.2.3i Cc: Subject: Re: Screen inside Jails + su X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2008 00:52:18 -0000 On Wed, Apr 09, 2008 at 12:00:05AM +0200, Wael Nasreddine wrote: > Hello, > > I have a FreeBSD server which is Jails based, I have created a special > jail to run 3 rTorrent process for 3 users, I made all the permissions > and added the users, then I launched manually (for testing purpose) > these screen sessions for the 3 users using the below method: > - jexec onto the jail. > - su to the user: su -l wael > - run a detached screen: screen -dmS Rtorrent > I have a .screenrc for each user in place to run one command, > rtorrent > > Now I have 2 questions: > 1) How can I add this procedure to the jail startup?? The common way for a user to run a program at startup is to use cron with the special @reboot directive instead of giving it a time to run a job. http://www.freebsd.org/doc/en/books/handbook/configtuning-starting-services.html > 2) I can't attach the screen, everytime I try to I get an error: > # su -l wael > % screen -Dr Rtorrent > Cannot open your terminal '/dev/ttyp6' - please check. > What's going on? why can't I attach the screen session ?? If you have used jexec to get into the jail, then you won't have a pty within the jail, and anything which relies on one will fail to execute. Start up sshd in the jail, then ssh to it and see if you can attach the screen. Erik