[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ezjail] zfs datasets won't automount inside jail



On 22 avr. 2015, at 11:55, Vedad KAJTAZ <vedad AT kajtaz DOT net> wrote:

> Indeed, there is no alternative to making the jail startup script.
> Moreover, make sure it will run *before* /etc/rc, otherwise your daemons that might require data on a zfs dataset will fail to start.
> 
> Feel free to use the following scripts:
> 
> - One of the ezjail scripts:
> http://vedad.kajtaz.net/perso/ezjail/ned_infra_osilex_net
> 
> Note that ZFS_DATASETS may contain several, space separated, zfs datasets.
> 
> - rc.boot.zfs that launches rc.mount.zfs and returns success (so that ezjail-admin start returns immediately):
> 
> http://vedad.kajtaz.net/perso/ezjail/rc.boot.zfs
> 
> - rc.mount.zfs that waits for dataset(s) to appear in the jail, then launches /etc/rc:
> 
> http://vedad.kajtaz.net/perso/ezjail/rc.mount.zfs
> 
> - rc.shutdown.zfs that unmounts datasets on shutdown (otherwise they actually do remain mounted... this is only because I don't set zfs_enable="YES" in jails)
> 
> http://vedad.kajtaz.net/perso/ezjail/rc.shutdown.zfs
> 
> Note also that rc.boot.zfs explicitly attempts to unmount datasets before mounting them - otherwise the mount (if not properly unmounted during the previous shutdown) fails upon jail restart.


I've just tested it on my second jail, it works like a charm. I'll schedule a reboot for the host tomorrow morning to make a more comprehensive test.
Thanks a lot. 

Patrick