Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Schneider committed Aug 3, 2015
2 parents 9c3f174 + 20c9cc0 commit 8587365
Show file tree
Hide file tree
Showing 24 changed files with 1,208 additions and 648 deletions.
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
################################################################################
################################################################################

Peter Toth <[email protected]>
Peter Toth <[email protected]> (Original Author)
Brandon Schneider <[email protected]>
38 changes: 19 additions & 19 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
Copyright (c) 2014, pannon
Copyright (c) 2014-2015, iocage
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
modification, are permitted providing that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
27 changes: 12 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,28 @@
# Makefile
#

.include <bsd.own.mk>

PREFIX?= /usr/local

MAN=
BINOWN= root
BINGRP= wheel
BINMODE= 0555
BINDIR=$(PREFIX)/sbin
FILESDIR=$(PREFIX)/lib/iocage
RCDIR=$(PREFIX)/etc/rc.d
MANDIR=$(PREFIX)/man/man8
MKDIR=mkdir

PROG= iocage
MAN= $(PROG).8
SCRIPTS=iocage
SCRIPTSDIR=${PREFIX}/BINDIR
MAN= $(SCRIPTS).8

${SCRIPTS}:
@echo Nothing needs to be done for iocage.

install:
install:: all
$(MKDIR) -p $(BINDIR)
$(MKDIR) -p $(FILESDIR)
$(INSTALL) -m $(BINMODE) $(PROG) $(BINDIR)/
$(INSTALL) lib/* $(FILESDIR)/
$(INSTALL) rc.d/* $(RCDIR)/
rm -f $(MAN).gz
gzip -k $(MAN)
$(INSTALL) $(MAN).gz $(MANDIR)/
rm -f $(MAN).gz
$(INSTALL) -c -m $(BINMODE) ${.OBJDIR}/$(SCRIPTS) $(BINDIR)/
$(INSTALL) -c ${.OBJDIR}/lib/* $(FILESDIR)/
$(INSTALL) -c ${.OBJDIR}/rc.d/* $(RCDIR)/
$(INSTALL) -c $(MAN).gz $(MANDIR)/

.include <bsd.prog.mk>
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ Start the jail:

**USAGE:**
- iocage activate ZPOOL
- iocage fetch [release=RELEASE | ftphost=ftp.hostname.org]
- iocage fetch [release=RELEASE | ftphost=ftp.hostname.org | ftpdir=/dir/ | ftpfiles="base.txz doc.txz lib32.txz src.txz"]
- iocage create [-b|-c|-e] [release=RELEASE] [pkglist=file] [property=value]
- iocage clone UUID|TAG@snapshot [property=value]
- iocage destroy [-f] UUID|TAG|ALL
- iocage reset UUID|TAG|ALL
- iocage list [-t]
- iocage list [-t|-r]
- iocage start UUID|TAG
- iocage stop UUID|TAG
- iocage restart UUID|TAG
Expand All @@ -64,16 +64,15 @@ Start the jail:
- iocage chroot UUID|TAG [command]
- iocage df
- iocage show property
- iocage get property|all ] UUID|TAG
- iocage get property|all UUID|TAG
- iocage set property=value UUID|TAG
- iocage cap UUID|TAG
- iocage limits UUID|TAG
- iocage uncap UUID|TAG
- iocage inuse [UUID|TAG]
- iocage top UUID|TAG
- iocage snapshot UUID|TAG@snapshotname
- iocage snaplist UUID|TAG
- iocage snapremove UUID|TAG@snapshotname
- iocage snapremove UUID|TAG@snapshotname|ALL
- iocage rollback UUID|TAG@snapshotname
- iocage promote UUID|TAG
- iocage runtime UUID|TAG
Expand Down
21 changes: 21 additions & 0 deletions doc/source/ezjail-migration
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Migrating from ezjails to iocage
#jailname is the jail name on ezjails
pkg install iocage
iocage fetch
#(checked 10.1-RELEASE)
#re0 is the network adapter. 192.168.1.3/24 the ip of the jailname@ezjail
iocage create tag=jailname ip4_addr="lo1|127.0.1.1,re0|192.168.1.3/24"
#iocage list lists the newly created iocage jail and the old ezjail
iocage set hostname=jailname UUID/TAG
iocage set boot=on UUID/TAG
#had these options on /usr/local/etc/ezjail/jailname. If you are migrating from one box to another inside the archive there is a #prop* file which includes the jail configuration We can extract it
tar -xzvf jailname-201507062224.48.tar.gz -C /iocage/jails/UUID/root/ -s /ezjail// --include 'prop*'
#copying the directories from jailname on ezjail to the jail on iocage
#we have to stop the jail cause we dont shadow copy
#an iocage list will give us the UUID which is something like dda0b520-c500-11e4-9bc4-00259094119

#we extract all the directories except the /var/
pax -rznv -f jailname-201507062224.48.tar.gz -pop -s '=^ezjail/=/iocage/jails/UUID/root/=' ezjail/.profile ezjail/.cshrc ezjail/root ezjail/etc ezjail/tmp ezjail/home ezjail/usr/home ezjail/usr/local

#we extract all the contents from the /var/ except the /var/ports/. If you want the distfiles you change the ezjail/var/ports to #ezjail/var/ports/basejail
pax -rzvn -f jailname-201507062224.48.tar.gz -s '=^ezjail/=/iocage/jails/UUID/root/=' -pop -c ezjail/proc ezjail/basejail ezjail/dev ezjail/media ezjail/mnt ezjail/root ezjail/tmp ezjail/usr ezjail/var/ports ezjail/etc ezjail/libexec ezjail/sys ezjail/bin ezjail/lib ezjail/rescue ezjail/sbin ezjail/boot ezjail/.cshrc ezjail/.profile '*rnd*' ezjail/COPYRIGHT
21 changes: 20 additions & 1 deletion doc/source/known-issues.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ VNET/VIMAGE issues w/ ALTQ

As recent as FreeBSD 10.1-RELEASE-p10, there is some *interesting* interaction between VNET/VIMAGE and ALTQ,
which is an ALTernate Queueing system used by PF and other routing software. Should you compile a kernel, make
that you do not have any of the following lines in your kernconf (unless you want to disable VNET):
sure that you do not have any of the following lines in your kernconf (unless you want to disable VNET):

::

Expand All @@ -77,3 +77,22 @@ that you do not have any of the following lines in your kernconf (unless you wan

Otherwise, should you try to start a jail with VNET support enabled, your host system will more than likely crash.
You can read a little more at the mailing list post `here <http://lists.freebsd.org/pipermail/freebsd-jail/2014-July/002635.html>`_.

IPv6 host bind failures
-----------------------

In some cases a jail with an ip6 address may take too long adding the address
to the interface, and services defined to bind specifically to that address
may fail. In such cases, adding the following sysctl do disable DAD (duplicate
address detection) probe packets.

To set, ``sysctl net.inet6.ip6.dad_count=0``. To make it permanent, add the
setting to sysctl.conf.

::

# disable duplicated address detection probe packets for jails
net.inet6.ip6.dad_count=0

You can read a little more about this `here <https://github.com/iocage/iocage/issues/119>`_ and at the mailing list post `here <https://lists.freebsd.org/pipermail/freebsd-jail/2013-July/002347.html>`_.

24 changes: 13 additions & 11 deletions iocage
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
#-------------------------------------------------------------------------+
# Copyright (C) 2014 Peter Toth (pannon)
# All rights reserved
# Copyright (c) 2014-2015, iocage
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted providing that the following conditions
Expand Down Expand Up @@ -30,7 +30,7 @@ unset LANG
PATH=${PATH}:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin

if [ "${1}" = "--version" -o "${1}" = "version" ] ; then
echo "iocage 1.6.2 (2015/05/01)"
echo "iocage 1.7.0 (2015/07/27)"
exit 0
fi

Expand All @@ -47,27 +47,23 @@ if [ "$(uname -K)" -lt "903000" ]; then
fi

# Check if libs are available
if [ -e "/usr/local/lib/iocage" ] ; then
LIB="/usr/local/lib/iocage"
elif [ -e "./lib" ] ; then
if [ -e "./lib/ioc-common" ] ; then
LIB="./lib"
elif [ -e "/usr/local/lib/iocage" ] ; then
LIB="/usr/local/lib/iocage"
else
echo "ERROR: missing libraries"
exit 1
fi

if [ "$(whoami)" != "root" ] ; then
echo "* Only root can manage jails!"
exit 1
fi

# Source the libs needed to use the script
. "${LIB}/ioc-cmd"
. "${LIB}/ioc-globals"
. "${LIB}/ioc-info"
. "${LIB}/ioc-help"
. "${LIB}/ioc-common"
. "${LIB}/ioc-zfs"
. "${LIB}/ioc-send"
. "${LIB}/ioc-snapshot"
. "${LIB}/ioc-upgrade"
. "${LIB}/ioc-image"
Expand All @@ -77,6 +73,7 @@ fi
. "${LIB}/ioc-rctl"
. "${LIB}/ioc-configure"
. "${LIB}/ioc-hacks"
. "${LIB}/ioc-git"

if [ -z "$1" ] ; then
__usage
Expand All @@ -88,6 +85,11 @@ if [ "$1" == "help" ] ; then
exit 0
fi

if [ "$(whoami)" != "root" ] ; then
echo "* Only root can manage jails!"
exit 1
fi

# work around zpool activation chicken-egg problem
# (when activating a pool don't look for an existing one)
if [ "$1" != "activate" ] ; then
Expand Down
Loading

0 comments on commit 8587365

Please sign in to comment.