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

RPM packages are missing a /bin/sh dependency #244

Open
shawnbutts opened this issue Nov 29, 2022 · 4 comments
Open

RPM packages are missing a /bin/sh dependency #244

shawnbutts opened this issue Nov 29, 2022 · 4 comments
Labels
artifact:rpm Issues related to RPM packages bug Something isn't working help wanted Extra attention is needed

Comments

@shawnbutts
Copy link

/bin/sh is required for the postinstall.sh and other scripts.

Adding a Requires: for all dependencies needed during install is a common standard.

@jpkrohling
Copy link
Member

Can you give more details about it? Is this happening for specific versions of specific distributions? I believe I installed the RPM a few times, and I'm confident it worked on Fedora 36.

@shawnbutts
Copy link
Author

It most likely works in your testing because, the /bin/sh dependency is already in place. But, in an environment where it is not yet there (kickstart, etc) the install will fail in the PREIN step.

If there requirement is explicitly included, then RPM resolver can order the package installs correctly.

@jpkrohling
Copy link
Member

Makes total sense. Are you able to open a PR fixing it? It's very likely here:

return config.NFPM{
ID: dist,
Builds: []string{dist},
Formats: []string{"apk", "deb", "rpm"},
License: "Apache 2.0",
Description: fmt.Sprintf("OpenTelemetry Collector - %s", dist),
Maintainer: "The OpenTelemetry Collector maintainers <cncf-opentelemetry-maintainers@lists.cncf.io>",
NFPMOverridables: config.NFPMOverridables{
PackageName: dist,
Scripts: config.NFPMScripts{
PreInstall: path.Join("distributions", dist, "preinstall.sh"),
PostInstall: path.Join("distributions", dist, "postinstall.sh"),
PreRemove: path.Join("distributions", dist, "preremove.sh"),
},
Contents: files.Contents{
{
Source: path.Join("distributions", dist, fmt.Sprintf("%s.service", dist)),
Destination: path.Join("/lib", "systemd", "system", fmt.Sprintf("%s.service", dist)),
},
{
Source: path.Join("distributions", dist, fmt.Sprintf("%s.conf", dist)),
Destination: path.Join("/etc", dist, fmt.Sprintf("%s.conf", dist)),
Type: "config|noreplace",
},
{
Source: path.Join("configs", fmt.Sprintf("%s.yaml", dist)),
Destination: path.Join("/etc", dist, "config.yaml"),
Type: "config",
},
},
},
}

Here's the relevant documentation from goreleaser: https://goreleaser.com/customization/nfpm/

@shawnbutts
Copy link
Author

Sorry, I'm not familiar enough with the project or GoReleaser to do a PR at the moment.

@jpkrohling jpkrohling added help wanted Extra attention is needed bug Something isn't working labels Nov 29, 2022
@mx-psi mx-psi added the artifact:rpm Issues related to RPM packages label Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
artifact:rpm Issues related to RPM packages bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants