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

fix webhook generate type functionailty for non-root user #512

Merged
merged 1 commit into from
Mar 30, 2020

Conversation

vchepkov
Copy link
Contributor

Pull Request (PR) description

if webhook is running under unprivileged account it creates
.resource_types in it's home directory, instead of code directory
explicitly pass parameters to point to configured code location

This Pull Request (PR) fixes the following issues

Fixes #412

@vchepkov
Copy link
Contributor Author

I think tests are failing due to this recent change in systemd https://access.redhat.com/solutions/4420581

I am not sure how to address it yet, open for suggestions

@vchepkov vchepkov force-pushed the generate_types branch 2 times, most recently from 3022da2 to 09d1fea Compare March 29, 2020 14:22
@vchepkov
Copy link
Contributor Author

K, I fixed the systemd unit file, so tests don't fail on systems with new systemd
@bastelfreak , @alexjfisher , could you review, please?

@bastelfreak
Copy link
Member

looks good to me, but it would be nice if somebody else can review / test this locally.

EnvironmentFile=-/etc/sysconfig/webhook
RuntimeDirectory=webhook
User=<%= @user %>
PIDFile=/var/run/webhook/webhook.pid
Copy link
Member

Choose a reason for hiding this comment

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

I think this line was only a problem in CI in docker. On real systems it would be fine.

@@ -3,19 +3,16 @@ Description=R10K Webhook Service
After=syslog.target network.target

[Service]
Type=forking
Type=simple
Copy link
Member

Choose a reason for hiding this comment

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

To change this, wouldn't you also have to change the process such that it doesn't daemonise and create the pidfile?

Copy link
Member

Choose a reason for hiding this comment

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

Oh, ignore that, you have. Still not convinced we should mess around too much just because docker has an issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, not just docker, it affects regular installations as well
That RedHat article I linked above recommending not using Type=forking as a legacy method.

@vchepkov
Copy link
Contributor Author

Same does systemd project itself - https://www.freedesktop.org/software/systemd/man/systemd.service.html

It is generally recommended to use Type=simple for long-running services whenever possible, as it is the simplest and fastest option.

@vchepkov
Copy link
Contributor Author

#511 is proposing the same fix, btw

@alexjfisher
Copy link
Member

I've pulled out just the systemd change into its own PR. #513

if webhook is running under unprivileged account it creates
.resource_types in it's home directory, instead of code directory
explicitly pass parameters to point to configured code location

modified ordering of service components to restart service
when service scripts have been updated
@vchepkov
Copy link
Contributor Author

Rebased

@alexjfisher alexjfisher merged commit 548f106 into voxpupuli:master Mar 30, 2020
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.

generate types feature doesn't work under unprivileged user id
3 participants