Page MenuHomeFreeBSD

jail exec.started hook
Needs ReviewPublic

Authored by stefan_gronke.net on May 6 2018, 9:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 21, 4:19 PM
Unknown Object (File)
Sat, Dec 21, 3:08 PM
Unknown Object (File)
Mon, Nov 25, 6:11 AM
Unknown Object (File)
Sun, Nov 24, 12:42 PM
Unknown Object (File)
Sun, Nov 24, 12:21 AM
Unknown Object (File)
Nov 23 2024, 1:14 PM
Unknown Object (File)
Nov 21 2024, 3:02 PM
Unknown Object (File)
Nov 21 2024, 11:48 AM

Details

Reviewers
allanjude
jamie
Summary

The existing jail start hooks are not sufficient to cover all edge cases. This changes introduce the exec.started hook that is executed on the host after jail start right before exec.start is run inside the jail.

A use-case scenario: A ZFS dataset can be shared with a jail only after it was already started. Without native integration of zfs jail into the jail command or a hook as proposed here, there is no way to make the dataset(s) available to the jail before its services are started. When it comes to non-persistent jails not even the exec.poststart hook can be used to delay the command execution until the ZFS shares are available.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Yes, this is a need that has gone unanswered for a while now.

I'm not crazy about the name - how about exec.created instead of exec.prestart? The "start" namespace seems a little full, and it's not intuitive that "started" would run before "start". I guess with this many steps, nothing is intuitive anymore.

jail(8) will need updating for this, in the same section where exec.prestart is mentioned.

The hook was renamed from exec.started to exec.created and documented in the jail commands man page.

OK, looks good with one last-minute nit: spaces in the jailp.h line where a tab should be

This revision is now accepted and ready to land.Aug 14 2018, 2:58 PM

Replaced whitespaces before IP_EXEC_CREATED comment in jailp.h with tabs.

Addresses https://reviews.freebsd.org/D15330#355209

This revision now requires review to proceed.Aug 14 2018, 4:22 PM

This seem to be committed and can be closed?