goreleaser / nfpm

nFPM is Not FPM - a simple deb, rpm, apk, ipk, and arch linux packager written in Go
https://nfpm.goreleaser.com/
MIT License
2.18k stars 159 forks source link

/etc/default for Debian vs /etc/sysconfig for RPM #879

Closed franchb closed 2 weeks ago

franchb commented 2 weeks ago

Is your feature request related to a problem? Please describe.

In both Debian and RPM-based systems, the directories /etc/default and /etc/sysconfig are used to store configuration files for system services, but there are some differences in their usage and conventions:

Debian (/etc/default)

Describe the solution you'd like

A method to provide environment variables to a service in a generic way for both Debian and RPM-based distributions.

Describe alternatives you've considered

Copy .env file to both locations

  - src: {{.Paths.EnvFile}}
    dst: /etc/default/{{.Name}} # for DEB-based
    type: config|noreplace

  - src: {{.Paths.EnvFile}}
    dst: /etc/sysconfig/{{.Name}}  # for RPM-based
    type: config|noreplace

Search

Code of Conduct

Additional context

No response

caarlos0 commented 2 weeks ago

hey!

you should be able to:


  - src: {{.Paths.EnvFile}}
    dst: /etc/default/{{.Name}} # for DEB-based
    type: config|noreplace
    packager: deb

  - src: {{.Paths.EnvFile}}
    dst: /etc/sysconfig/{{.Name}}  # for RPM-based
    type: config|noreplace
    packager: rpm

that would allow the to have the file in different places for each platform.

does that solve your issue?

franchb commented 2 weeks ago

Thank you, @caarlos0 ! Yes, this solved my issue.