Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 04 Apr 2019 09:52:19 -0600
From:      James Gritton <jamie@freebsd.org>
To:        freebsd-jail@freebsd.org
Subject:   Re: exec.clean not working correctly on FreeBSD 12.0-RELEASE-p3?
Message-ID:  <fbedd6f15f8fb7db5eeed0e46927ccce@freebsd.org>
In-Reply-To: <20190403212225.0121443C26B5@dd14614.kasserver.com>
References:  <20190403212225.0121443C26B5@dd14614.kasserver.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2019-04-03 15:22, freebsd-en@lists.vlassakakis.de wrote:
> Hi,
> 
> I noticed that exec.clean does not work correctly on FreeBSD 
> 12.0-RELEASE-p3.
> Can anyone confirm this?
> 
> root@server1:~ # freebsd-version -kru
> 12.0-RELEASE-p3
> 12.0-RELEASE-p3
> 12.0-RELEASE-p3
> 
> 
> /etc/jail.conf:
> [...]
> Some VNET-Stuff and other options
> [...]
> exec.clean;
> 
> testjail {
>         host.hostname = "testjail.XXX.XXX.XXX";
>         path          = 
> "/jails/0536b986-5643-11e9-81db-4ccc6a0aa478/base/";
>         $epair        = "epair0";
> }
> 
> 
> If i use "exec.clean" inside my Jail-Definition, it doesn't work 
> either.
> 
> /etc/jail.conf:
> [...]
> Some VNET-Stuff and other options
> [...]
> 
> testjail {
>         host.hostname = "testjail.XXX.XXX.XXX";
>         path          = 
> "/jails/0536b986-5643-11e9-81db-4ccc6a0aa478/base/";
>         $epair        = "epair0";
> 	exec.clean;
> }
> 
> root@server1:~ # jexec testjail
> root@testjail:/ # printenv
> USER=root
> LOGNAME=root
> HOME=/root
> MAIL=/var/mail/root
> PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
> TERM=xterm-256color
> BLOCKSIZE=K
> SHELL=/bin/csh
> SSH_CLIENT=80.XXX.XXX.XXX 62416 40443
> SSH_CONNECTION=80.XXX.XXX.XXX 62416 194.XXX.XXX.XXX 40443
> SSH_TTY=/dev/pts/0
> HOSTTYPE=FreeBSD
> VENDOR=amd
> OSTYPE=FreeBSD
> MACHTYPE=x86_64
> SHLVL=2
> PWD=/
> GROUP=wheel
> HOST=testjail.XXX.XXX.XXX
> REMOTEHOST=XXXXXXXXX
> EDITOR=vim
> PAGER=less
> 
> 
> -----------------
> 
> If i use "jexec -l", it works fine.
> 
> root@server1:~ # jexec -l testjail
> root@testjail:~ # printenv
> SHELL=/bin/csh
> HOME=/root
> USER=root
> BLOCKSIZE=K
> MAIL=/var/mail/root
> PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
> TERM=xterm-256color
> HOSTTYPE=FreeBSD
> VENDOR=amd
> OSTYPE=FreeBSD
> MACHTYPE=x86_64
> SHLVL=1
> PWD=/root
> LOGNAME=root
> GROUP=wheel
> HOST=testjail.XXX.XXX.XXX
> EDITOR=vim
> PAGER=less
> 
> 
> Any suggestions?

This isn't a problem in exec.clean per se, but in jexec(8).  Nothing in 
the jail.conf file is even peeked at by jexec, which communicates only 
with the kernel.  So the "-l" is necessary to get the same effect that 
exec.clean gives on jail creation.

- Jamie



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