Jail fails to unmount a directory

list+org.freebsd.jail at io7m.com list+org.freebsd.jail at io7m.com
Mon Oct 31 18:50:42 UTC 2016


On 2016-10-31T18:45:31 +0000
list+org.freebsd.jail at io7m.com wrote:

> On 2016-10-31T14:07:16 -0400
> Ernie Luzar <luzar722 at gmail.com> wrote:
> > 
> > The correct way to stop the jail is to issue this command from the host 
> > command line
> > 
> > host# jail -v -f com.example.service0.conf -r com_example_service0  
> 
> Hello.
> 
> The problem with this is that jails can end up in this broken, undead
> state. It seems rather nasty that the created process could crash,
> leaving a nonexistent jail with no processes that nevertheless can't be
> restarted without first "destroying" it, even though it appears to have
> already gone! How is an administrator even supposed to know that a jail
> that doesn't appear in the output of `jls` must be destroyed before it
> can be started?
> 
> M
> 

And, in fact, having just tried it, it doesn't work:

host# jail -v -f com.example.service0.conf -c com_example_service0
com_example_service0: run command: /sbin/ifconfig em0 inet 127.0.0.2 netmask 255.255.255.255 alias
com_example_service0: run command: /sbin/mount -t nullfs -o ro,noauto /usr/jail/base /usr/jail/com.example.service0/base
com_example_service0: jail_set(JAIL_CREATE) persist name=com_example_service0 host.hostname=com.example.service0 ip4.addr=127.0.0.2 path=/usr/jail/com.example.service0
com_example_service0: created
com_example_service0: run command in jail: /bin/sh
# exit
com_example_service0: jail_set(JAIL_UPDATE) jid=14 nopersist

host# jail -v -f com.example.service0.conf -r com_example_service0
jail: "com_example_service0" not found

host# jail -v -f com.example.service0.conf -c com_example_service0
com_example_service0: run command: /sbin/ifconfig em0 inet 127.0.0.2 netmask 255.255.255.255 alias
com_example_service0: run command: /sbin/mount -t nullfs -o ro,noauto /usr/jail/base /usr/jail/com.example.service0/base
mount_nullfs: /usr/jail/com.example.service0/base: Resource deadlock avoided
jail: com_example_service0: /sbin/mount -t nullfs -o ro,noauto /usr/jail/base /usr/jail/com.example.service0/base: failed
com_example_service0: run command: /sbin/ifconfig em0 inet 127.0.0.2 netmask 255.255.255.255 -alias

host#
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 821 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-jail/attachments/20161031/674bf2bd/attachment.sig>


More information about the freebsd-jail mailing list