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

Postinstall script to generate an info file #530

Merged
merged 7 commits into from
Oct 29, 2019

Conversation

directionless
Copy link
Contributor

We often want to understand what happened during installation. So the postinstall script should drop a config file onto disk with some basic info.

This is expected to be json, though on osx we additionally keep it as a plist.

To make this simpler, the postinstall templates have been extracted into the asset generation flow.

@directionless directionless marked this pull request as ready for review October 22, 2019 20:28
This moves the postinstall templates to go-asset, As these get more complicated, it's simpler to work with
I can't get the bash quoting right to pass spaces through the basename and heredoc. Instead, set a variable, and just use that.
@directionless
Copy link
Contributor Author

I've manually tested this on Mojave and Catalina.

Also on docker images for centos and ubuntu. These are a bit less precise -- they don't have systemd in place, so while the conf file is generated, the overall install fails.

@blaedj
Copy link
Contributor

blaedj commented Oct 29, 2019

... so while the conf file is generated, the overall install fails.

Does this mean that this PR will break installation on centos/ubuntu? Or just that installing in the docker container breaks, but that's fine because we use an image rather than installing into docker containers ?

@directionless
Copy link
Contributor Author

The existing packages won't work on minimal docker installs. This is because the postinst scripts try to invoke systemd. The overall install has always been broken there. (possibly we can make this more clever, but I don't want to try to get that logic into this PR)

AFAICT this is no change from status quo

@blaedj
Copy link
Contributor

blaedj commented Oct 29, 2019

Ok cool, that makes sense. I agree, the issue w/docker is not in-scope for this PR

Copy link
Contributor

@blaedj blaedj left a comment

Choose a reason for hiding this comment

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

lgtm

@directionless directionless merged commit 157f2c0 into kolide:master Oct 29, 2019
@directionless directionless deleted the seph/postinstall-scripts branch October 29, 2019 15:46
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