Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Mar 2010 09:26:11 +0100
From:      Alexander Leidinger <Alexander@Leidinger.net>
To:        freebsd-emulation@freebsd.org, ed@freebsd.org
Subject:   Re: linux-only jail possible?
Message-ID:  <20100305092611.0000772c@unknown>
In-Reply-To: <201003041322.57875.lists@jnielsen.net>
References:  <201003021325.27197.lists@jnielsen.net> <20100303180636.GA31551@freebsd.org> <20100304114050.00007a59@unknown> <201003041322.57875.lists@jnielsen.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 4 Mar 2010 13:22:57 -0500 John Nielsen <lists@jnielsen.net>
wrote:

Ed, I Cced you because of a ttyname thing below. It's the linuxulator
ttyname call.

> I went ahead and gave this a try with some encouraging results.
> Comments below.
> 
> On Thursday 04 March 2010 05:40:50 Alexander Leidinger wrote:

> > Now you just need to configure a jail. It does not matter much if
> > you use the jail stuff in the base system or a framework like
> > ezjail or similar, as long as you configure an appropriate startup
> > script in the linux-jail. The linux-startup part you need to do
> > yourself, I do not think the default linux startup stuff is
> > approrpiate. I suggest to start at least a sshd before you start
> > the software you want to use. This way you can login into the
> > linux-jail and investigate issues like it is a real system.
> 
> I actually did install the init scripts, etc. I was pleasantly
> surprised to find (after reading through them) that rc.sysinit can be
> skipped entirely while rc itself will do the right thing for the rest
> of the init scripts (starting services, etc). Here's what I'm using:
> 
> jail_centos_exec_start="/bin/sh /etc/rc.d/rc 3"
> jail_centos_exec_stop="/bin/sh /etc/rc.d/rc 0"
> 
> > I suggest to monitor the kernel messages on the FreeBSD host. There
> > may be linux-syscalls which are not implemented (e.g. epoll stuff).
> 
> Thanks, I had forgotten about that. So far nothing seems to have
> blown up too terribly.
> 
> The "consoletype" utility runs despite this message:
> linux: pid 2100 (consoletype): ioctl fd=0, cmd=0x541c ('T',28) is not 
> implemented

Dokumented in the wiki. If someone knows what ioctl this is, that's
some info which is needed in the wiki, so feel free to edit the page
or tell me.

> And sshd and crond both run despite this one:
> linux: pid 2221 (sshd): syscall keyctl not implemented
> linux: pid 2240 (crond): syscall keyctl not implemented

That's docuemnted in the wiki. I added a note that it is used by cron
and sshd.

> Syslogd ran without complaint as well but didn't actually log
> anything. I had to run it with "-p /var/run/log" (inside the jail via 
> /etc/sysconfig/syslog) and create a symlink to the socket in the
> jail's /dev/log (outside the jail via exec_poststart). That's not
> ideal since there's a period of time between when syslogd starts in
> the jail and the symlink is created, but it works after that. It
> would be better in the exec_prestart RC knob but the jail's devfs
> isn't necessarily mounted at that point.

Why don't you add a script into rc3 on the linux side which does the
link?

> My current hurdle is sshd:
> Mar  3 22:20:51 centos sshd[88836]: fatal: openpty returns device for
> which ttyname fails.
> 
> Apparently the Linux sshd isn't using /dev/ptmx appropriately. I'll
> probably just have to replace it with one that does..

Ed, can it be that the linuxulator ttyname stuff needs to be fixed
after your tty changes?

Bye,
Alexander.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100305092611.0000772c>