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)
Tue, Mar 26, 6:47 AM
Unknown Object (File)
Feb 4 2024, 11:08 AM
Unknown Object (File)
Jan 19 2024, 10:59 AM
Unknown Object (File)
Jan 19 2024, 8:48 AM
Unknown Object (File)
Jan 10 2024, 11:57 PM
Unknown Object (File)
Dec 20 2023, 4:55 PM
Unknown Object (File)
Dec 20 2023, 6:36 AM
Unknown Object (File)
Dec 16 2023, 1:38 PM

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

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?