Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New attribute to control pot stop #275

Merged
merged 3 commits into from Nov 18, 2023
Merged

Conversation

grembo
Copy link
Collaborator

@grembo grembo commented Nov 12, 2023

By setting exec_stop and stop_timeout (which correspond to
jail(8) attributes exec.stop and stop.timeout), the user
has better control over shutting down a pot.

For "fat" pots this could mean setting

pot set-attr -A exec_stop -V "/bin/sh /etc/rc.shutdown jail"

for light pots (like nomad controlled using tinirc), this could
point to a simple script that make sure the wrapped process is
stopped gracefully and, in case multiple processes are running
inseide of the pot, make sure they're terminated in the correct
order.

Also:

  • Fix a typo that made the nullfs attribute not work.
  • Make pot start use _save_params, which makes wrapping
    attributes safer and therefore allows to remove
    a shellcheck exemption.

By setting exec_stop and stop_timeout (which correspond to
jail(8) attributes exec.stop and stop.timeout), the user
has better control over shutting down a pot.

For "fat" pots this could mean setting

    pot set-attr -A exec_stop -V "/bin/sh /etc/rc.shutdown jail"

for light jails (like nomad controlled using tinirc), this could
point to a simple script that make sure the wrapped process is
stopped gracefully and, in case multiple processes are running
inseide of the pot, make sure they're terminated in the correct
order.

Also:
- Fix a typo that made the nullfs attribute not work.
- Make pot start use _save_params, which makes wrapping
  attributes safer and therefore allows to remove
  a shellcheck exemption.
@grembo
Copy link
Collaborator Author

grembo commented Nov 14, 2023

@bretton This might be interesting to you.

Copy link
Collaborator

@pizzamig pizzamig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me!

@grembo grembo merged commit 9a102e9 into bsdpot:master Nov 18, 2023
2 checks passed
@grembo
Copy link
Collaborator Author

grembo commented Nov 18, 2023

@pizzamig thanks for checking!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants