Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Oct 2015 08:48:39 -0500
From:      Mark Felder <feld@FreeBSD.org>
To:        krad <kraduk@gmail.com>, galtsev@kicp.uchicago.edu
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: /etc/jail.conf documentation?
Message-ID:  <1446126519.3886654.423612921.572AA6CD@webmail.messagingengine.com>
In-Reply-To: <CALfReycwGJfBsx1JB_HOpwRXj2BPt9JTDAFPZHHC4HA=-fiisw@mail.gmail.com>
References:  <49230.128.135.52.6.1446047977.squirrel@cosmo.uchicago.edu> <1446064085.1148620.422968569.0E47599D@webmail.messagingengine.com> <20953.128.135.52.6.1446065026.squirrel@cosmo.uchicago.edu> <CALfReycwGJfBsx1JB_HOpwRXj2BPt9JTDAFPZHHC4HA=-fiisw@mail.gmail.com>

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


On Thu, Oct 29, 2015, at 07:17, krad wrote:
> here is an extract from one of my jail configs which shows a few other
> things to play with. Remember vnet and pf dont play at present.
> 
> 
>      # Typical static defaults:
>      # Use the rc scripts to start and stop jails.  Mount jail's /dev.
>      exec.start = "/bin/sh /etc/rc";
>      exec.stop = "/bin/sh /etc/rc.shutdown";
>      exec.clean;
>      mount.devfs;
> 
> 
>      # Dynamic wildcard parameter:
>      # Base the path off the jail name.
>      path = "/jails/$name";
> 
> 
>      emby {
>              host.hostname = "emby.intranet";
>              vnet.interface = emby_a;
>              vnet;
>              exec.prestart  = "ifconfig emby_a destroy || true ";
>              exec.prestart  += "ifconfig emby_b destroy || true";
>              exec.prestart  += "ifconfig epair8 create up";
>              exec.prestart  += "ifconfig epair8a name emby_a";
>              exec.prestart  += "ifconfig epair8b name emby_b";
>              exec.prestart  += "ifconfig emby_b up";
>              exec.prestart  += "ifconfig bridge0 addm emby_b";
>              exec.prestart  += "ifconfig emby_a ether 02:ff:25:fc:05:da";
>              exec.prestart  += " df | grep -q  /jails/emby/videos || 
>              mount
> -t nullfs -o rw /videos /jails/emby/videos/";
>              exec.poststop  = "ifconfig emby_a destroy";
>              exec.poststop  += "ifconfig emby_b destroy";
>              exec.poststop += "/sbin/umount /jails/emby/videos || true ";
>              exec.start += "/sbin/dhclient emby_a";
>              exec.start += "ifconfig emby_a inet6 accept_rtadv";
>              exec.start += "/etc/rc.d/rtsold start";
>         }
> 

You don't need to handle mounting filesystems this way. Just define

      mount.fstab = /etc/fstab.$name;

and then create /etc/fstab.emby

Put your fstab entries in that file and it will do the right thing for
you automatically.


-- 
  Mark Felder
  ports-secteam member
  feld@FreeBSD.org



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