Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 06 Jul 2016 12:13:37 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-jail@FreeBSD.org
Subject:   [Bug 209112] /usr/sbin/jail jails fail to launch with possible race when jails mount common dir with nullfs
Message-ID:  <bug-209112-9824-wWooAWbppG@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-209112-9824@https.bugs.freebsd.org/bugzilla/>
References:  <bug-209112-9824@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D209112

djn@araxis.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |djn@araxis.com

--- Comment #4 from djn@araxis.com ---
I am also seeing this issue with FreeBSD 10.3-Release-p4 =E2=80=93 I have s=
ix jails,
and only two or three start on boot (two fail due to a dependency on another
jail that fails to start). I encounter no problems when starting the jails
post-boot.

I added logging to /etc/rc.d/jail in a similar manner to the original poste=
r,
and see this output:

----
mount_nullfs: /jails/pgsql/data: mount_nullfs: /jails/hg/data: Operation not
supported by device
Operation not supported by device
jail: pgsql: /sbin/mount -t nullfs -o rw /data/pgsql /jails/pgsql/data: fai=
led
jail: hg: /sbin/mount -t nullfs -o rw /data/hg /jails/hg/data: failed
jail: support: skipped
jail: logic: skipped
www-bhs-0: created
backup-bhs-0: created

...
----

Here is my jail.conf:

----
# START BLOCK: Araxis jail defaults -- DO NOT EDIT
exec.start =3D "/bin/sh /etc/rc";
exec.stop =3D "/bin/sh /etc/rc.shutdown";
exec.clean;
mount.devfs;
mount.fdescfs;
allow.noset_hostname;
host =3D new;

# temporarily allow during development/testing
allow.raw_sockets;
# END BLOCK: Araxis jail defaults
# START BLOCK: Araxis jail settings for jail www-bhs-0.araxis.net -- DO NOT
EDIT
www-bhs-0 {
  mount.fstab =3D "/jails/.fstabs/www-bhs-0";
  path =3D "/jails/www-bhs-0";
  host.hostname =3D www-bhs-0.araxis.net;
  ip4.addr =3D "lo1|10.11.11.2/32";
  ip6.addr =3D "ix0|2607:5300:60:9b9c::2/64";
}
# END BLOCK: Araxis jail settings for jail www-bhs-0.araxis.net
# START BLOCK: Araxis jail settings for jail backup-bhs-0.araxis.net -- DO =
NOT
EDIT
backup-bhs-0 {
  mount.fstab =3D "/jails/.fstabs/backup-bhs-0";
  path =3D "/jails/backup-bhs-0";
  host.hostname =3D backup-bhs-0.araxis.net;
  ip4.addr =3D "lo2|10.12.12.8/32";
  enforce_statfs =3D 1;
  allow.mount;
  allow.mount.zfs;
  exec.poststart =3D "/sbin/zfs set jailed=3Don zroot/bkup && /sbin/zfs jail
${name} zroot/bkup && jexec ${name} /sbin/zfs mount -a";
  exec.prestop =3D "/sbin/zfs unjail ${name} zroot/bkup && /sbin/zfs set
jailed=3Doff zroot/bkup";
}
# END BLOCK: Araxis jail settings for jail backup-bhs-0.araxis.net
# START BLOCK: Araxis jail settings for jail pgsql.araxis.net -- DO NOT EDIT
pgsql {
  mount.fstab =3D "/jails/.fstabs/pgsql";
  path =3D "/jails/pgsql";
  host.hostname =3D pgsql.araxis.net;
  ip4.addr =3D "lo2|10.12.12.4/32";
  allow.sysvipc;
}
# END BLOCK: Araxis jail settings for jail pgsql.araxis.net
# START BLOCK: Araxis jail settings for jail support.araxis.net -- DO NOT E=
DIT
support {
  mount.fstab =3D "/jails/.fstabs/support";
  path =3D "/jails/support";
  host.hostname =3D support.araxis.net;
  ip4.addr =3D "lo2|10.12.12.5/32";
  depend =3D pgsql;
}
# END BLOCK: Araxis jail settings for jail support.araxis.net
# START BLOCK: Araxis jail settings for jail logic.araxis.com -- DO NOT EDIT
logic {
  mount.fstab =3D "/jails/.fstabs/logic";
  path =3D "/jails/logic";
  host.hostname =3D logic.araxis.com;
  ip4.addr =3D "lo2|10.12.12.6/32";
  depend =3D pgsql;
}
# END BLOCK: Araxis jail settings for jail logic.araxis.com
# START BLOCK: Araxis jail settings for jail hg.araxis.net -- DO NOT EDIT
hg {
  mount.fstab =3D "/jails/.fstabs/hg";
  path =3D "/jails/hg";
  host.hostname =3D hg.araxis.net;
  ip4.addr =3D "lo2|10.12.12.3/32";
}
# END BLOCK: Araxis jail settings for jail hg.araxis.net
----

The various fstab files are nearly identical. Here=E2=80=99s the one
(/jails/.fstabs/pgsql) for the pgsql jail, which always fails to start on b=
oot:

----
# Device    Mountpoint    FStype    Options   Dump    Pass#
/data/pgsql   /jails/pgsql/data    nullfs    rw    0   0
----

--=20
You are receiving this mail because:
You are the assignee for the bug.=



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