Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Aug 2016 11:15:09 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Rudy <crapsh@monkeybrains.net>
Cc:        freebsd-jail@freebsd.org
Subject:   Re: spontaneously exiting Jail -- jexec or ssh -- FreeBSD 10.3
Message-ID:  <20160805081509.GB83214@kib.kiev.ua>
In-Reply-To: <57A3A508.2020400@monkeybrains.net>
References:  <57A3A508.2020400@monkeybrains.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Aug 04, 2016 at 01:26:48PM -0700, Rudy wrote:
> 
> I have an odd issue, and I'm writing to see if anyone has seen the same 
> issue.
> 
> If I use "jexec 4 tcsh" or ssh into the jail, some sequences on the 
> command line kick me out (spontaneously exit) everytime.
> 
> For example, I run a couple of commands, then go to the /usr/local 
> folder, hit mv TAB (file name completion) realize I am in the wrong 
> folder, hit ^C, and the jail boots me.  I've set the 'prompt' to be HOST 
> and GUEST for the main install and jail.
> 
> HOST%jexec 4 tcsh
> GUEST%date
> Thu Aug  4 13:21:13 PDT 2016
> GUEST%ls
> .cshrc                     etc-lavash
> .profile                   home
> .rnd                       lib
> COPYRIGHT                  libexec
> Dec31.2012                 media
> Dec31.2013                 mnt
> Dec31.2014                 proc
> Dec31.2015                 rescue
> INSTALL-NOTES-MONKEYBRAINS root
> basejail                   sbin
> bin                        sys
> boot                       tmp
> data                       usr
> dev                        var
> etc                        www
> etc-injera
> GUEST%cd /usr/local/
> GUEST%mv [hit TAB for completion]
> bin/                        libdata/
> dcc/                        libexec/
> etc-BACKUP/                 man/
> etc-dist/                   openssl/
> etc-injera/                 sbin/
> etc-lavash/                 share/
> etc/                        tests/
> include/                    var/
> info/                       www/
> lib/                        x86_64-portbld-freebsd10.1/
> GUEST%mv {^C}HOST%
> 
> 
> Here is a TRUSS on the last command:
> 
> truss jexec 4 tcsh
> GUEST%mv write(17,"GUEST%mv ",9)				 = 9 (0x9)
> read(16,0x7fffffffe0d2,1)			 ERR#4 'Interrupted system call'
> SIGNAL 2 (SIGINT)
> sigprocmask(SIG_SETMASK,{ SIGINT },0x0)		 = 0 (0x0)
> process exit, rval = 1
> 
> Oddly, if I don't do a couple of seemingly arbitrary commands first (ls 
> and date in the example above), but go straight to the cd and then mv 
> command, the jail does exit with the ERR#4.

Jails has no concept of 'exiting with error code'.
Is your shell exits, instead ?

What is the version of the jailed userspace ?  Do you use nss ?

This smells like the issue fixed by r296416/r297673.



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