On 2017-05-03 08:05, joris dedieu wrote:
Hi guys,
Is there a clean way to execute _zfs jail $jid $dataset_ at jail
startup ? I have tried with an exec.poststart script but it's too late
in start order. I also tried to use a prefixed jid and exec.prestart,
but zfs complains that jail does not exists.

Any idea ? Something I missed ?

It sounds like what you need is a hook for running host-level commands after the jail is created but before anything is run from exec.start. Unfortunately there is no such parameter - there probably should be. There probably also should be a simpler zfs option to jail(8). But those are future concerns.

A workaround is to have nothing in exec.start. exec.poststart would first run the "zfs jail" command, and then do the exec.start work. Something like:

  exec.poststart += "zfs jail $jid $dataset";
  exec.poststart += "jexec $jid sh /etc/rc";

It's not a particularly clean solution, but it should work.

- Jamie
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-jail
To unsubscribe, send any mail to "[email protected]"

Reply via email to