Skip to content

Instantly share code, notes, and snippets.

@dch
Created June 23, 2018 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dch/64ea4d759fd21f52a35ed48764b3c00e to your computer and use it in GitHub Desktop.
Save dch/64ea4d759fd21f52a35ed48764b3c00e to your computer and use it in GitHub Desktop.
pushing jail hostname into jails

I tried the following jail.conf and everything works perfectly.

exec.start = "/bin/sh /etc/rc";
exec.poststart = "jail -m name=$name host.hostname=$name.`hostname`";
exec.stop = "/bin/sh /etc/rc.shutdown";
exec.clean;
mount.devfs;
db {
  host.hostname = "db";
  path = "/usr/local/jails/db";
  interface = "lo1";
  ip4.addr = 127.0.1.2;
  mount.fstab = "/usr/local/jails/db.fstab";
}

ldap {
  host.hostname = "ldap";
  path = "/usr/local/jails/ldap";
  interface = "lo1";
  ip4.addr = 127.0.1.3;
  mount.fstab = "/usr/local/jails/ldap.fstab";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment