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

Directly use the embedded sv instead of the init symlinks. #54

Closed
wants to merge 1 commit into from
Closed

Directly use the embedded sv instead of the init symlinks. #54

wants to merge 1 commit into from

Conversation

matthiasr
Copy link

The symlinks in init/ are created by the runit cookbook, and on Debian
it creates a wrapper script instead of simple symlinks. This wrapper
script encodes /usr/bin/sv as the control binary.

Instead of relying on the symlinks being as expected, directly use the
binary that is embedded anyway.

Fixes #53. Fixes running chef-server on Debian.

@matthiasr
Copy link
Author

I verified that this works by cloning this repository, installing chef-server-core and then installing the gem into it:

dpkg -i chef-server*.deb
/opt/opscode/embedded/bin/gem install omnibus-ctl-0.5.0.gem
chef-server-ctl reconfigure
chef-server-ctl status

on a fresh Debian Jessie VM.

The symlinks in init/ are created by the runit cookbook, and on Debian
it creates a wrapper script instead of simple symlinks. This wrapper
script encodes `/usr/bin/sv` as the control binary.

Instead of relying on the symlinks being as expected, directly use the
binary that is embedded anyway.

Fixes #53. Fixes running chef-server on Debian.

Signed-off-by: Matthias Rampke <[email protected]>
srenatus
srenatus previously approved these changes Mar 28, 2017
Copy link
Contributor

@srenatus srenatus left a comment

Choose a reason for hiding this comment

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

I don't see any reason it should do anything but this.

👍 thanks.

@srenatus srenatus dismissed their stale review March 28, 2017 08:14

more information -- retracting my review

@srenatus
Copy link
Contributor

From sv(8):

sv exits 0, if the command was successfully sent to all services, and, if it was told to wait, the command has taken effect to all services.

If sv is called with a base name other than sv: it exits 1 on timeout or trouble sending the command; if the command is status, it exits 3 if the service is down, and 4 if the status is unknown; it exits 2 on wrong usage, and 151 on error.

This means calling sv directly will always return 0 (unless stuff is terribly wrong) -- this would break the expectation of omnibus-ctl. It seems like we would either have to change the basename or parse the output. Both seems rather brittle compared to the what was the behaviour before.

@matthiasr
Copy link
Author

Damn, that's unfortunate. I know why I don't like switching on $0 …

@matthiasr matthiasr closed this Mar 28, 2017
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.

2 participants