Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Mar 2008 12:02:50 GMT
From:      Hiroto Kagotani <hiroto.kagotani@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/121827: sysutils/ezjail: config-attached image jail can not be detached
Message-ID:  <200803181202.m2IC2oql012989@www.freebsd.org>
Resent-Message-ID: <200803181210.m2ICA3rM068719@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         121827
>Category:       ports
>Synopsis:       sysutils/ezjail: config-attached image jail can not be detached
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 18 12:10:03 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Hiroto Kagotani
>Release:        7.0-RELEASE
>Organization:
Okayama Univ.
>Environment:
FreeBSD myhost.mydomain 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24 10:35:36 UTC 2008     root@driscoll.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
I created an image jail using ezjail-admin with create -i option and
attempted to configure the jail by attaching it successfully.
However when I attempted to detach the image jail, ezjail-admin
showed an error and couldn't detach it.

This is caused by mounting /dev/md* directly instead of mounting
*.device symlink when ezjail-admin is invoked with config -i attach option.
>How-To-Repeat:
# ezjail-admin update
# ezjail-admin create -i -s 10m foo.example.com 192.168.0.1
# ezjail-admin config -i attach foo.example.com
# ezjail-admin config -i detach foo.example.com
Error: Jail image file foo.example.com is not attached
>Fix:
--- ezjail-admin.orig   2008-03-18 20:51:41.000000000 +0900
+++ ezjail-admin        2008-03-18 20:54:21.000000000 +0900
@@ -782,10 +782,11 @@
       # Clean image
       fsck -t ufs -p -B /dev/${ezjail_device}

-      mount /dev/${ezjail_device} ${ezjail_rootdir} || detach_images keep || exerr "Error: Could not mount /dev/${ezjail_device} to ${ezjail_rootdir}."
       # relink image device
       ln -s /dev/${ezjail_device} ${ezjail_rootdir}.device

+      mount ${ezjail_rootdir}.device ${ezjail_rootdir} || detach_images keep || exerr "Error: Could not mount ${ezjail_rootdir}.device to ${ezjail_rootdir}."
+
       ;;
     detach)
       # Check, if image really attached or running


>Release-Note:
>Audit-Trail:
>Unformatted:



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