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

Fixes #23134 - support for plugin hooks #79

Merged
merged 1 commit into from Jun 1, 2018

Conversation

lzap
Copy link
Member

@lzap lzap commented Apr 5, 2018

We need to allow to katello-selinux to hook onto foreman-selinux-enable (disable, relabel) scripts easily.

This can be done via /usr/libexec/foreman-selinux/enable.d/*.after.sh (and before.sh) scripts executed before or after scripts.

Packaging PR will follow once this is merged to get that directory created.

Copy link
Contributor

@adamruzicka adamruzicka left a comment

Choose a reason for hiding this comment

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

Looks good under the assumption there can't be spaces in $LIBEXEC_DIR or in hook names

@lzap
Copy link
Member Author

lzap commented May 30, 2018

You want me to workaround it? I'd be very surprised there was a libexec executable with space, this is not MacOS :-)

@adamruzicka
Copy link
Contributor

Working around it should be quite easy and I'd rather stay on the safe side, just to be sure.

@lzap
Copy link
Member Author

lzap commented May 30, 2018

Ok done.

@@ -8,4 +15,9 @@
/var/log/foreman-proxy \
/var/run/foreman-proxy

# Run hooks
for HOOK in "$LIBEXEC_DIR/*-after-relabel.sh"; do
Copy link
Contributor

Choose a reason for hiding this comment

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

The escaping needs to be done in a slightly different way, see here

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmmm good catch, I have tested this incorrectly.

@lzap
Copy link
Member Author

lzap commented May 31, 2018

I actually could not get your example work, but found different solution via find, no shell involved.

Copy link
Contributor

@adamruzicka adamruzicka left a comment

Choose a reason for hiding this comment

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

Looks good to me

@lzap lzap merged commit 6d3fbe8 into theforeman:develop Jun 1, 2018
@lzap lzap deleted the libexec-23134 branch June 6, 2018 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants