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

make install overwrites existing configuration files #516

Closed
paulusmack opened this issue Sep 12, 2024 · 7 comments · Fixed by #518
Closed

make install overwrites existing configuration files #516

paulusmack opened this issue Sep 12, 2024 · 7 comments · Fixed by #518

Comments

@paulusmack
Copy link
Collaborator

make install will currently overwrite files in <sysconfdir>/ppp with "sample" copies from etc.ppp (i.e., options, chap-secrets, pap-secrets, etc.). This seems like a bad idea to me. Is there some way we can tell autoconf/automake to generate Makefile code that will check for existing files and not overwrite them?

@enaess ?

@enaess
Copy link
Contributor

enaess commented Sep 12, 2024

sampledir = $(sysconfdir)/$(PACKAGE)
sample_DATA = \
    etc.ppp/options \
    etc.ppp/chap-secrets \
    etc.ppp/pap-secrets \
    etc.ppp/eaptls-server \
    etc.ppp/eaptls-client \
    etc.ppp/openssl.cnf

I agree, that is indeed a bad idea. Typically, one would install examples like /etc/ppp/options.example and it would be the packager's responsibility to setting up the /etc/ppp/options file according to the distribution's need. Most importantly, when we do run the make install command, it shouldn't overwrite existing configuration files (could overwrite the examples).

@paulusmack
Copy link
Collaborator Author

I agree, that is indeed a bad idea. Typically, one would install examples like /etc/ppp/options.example and it would be the packager's responsibility to setting up the /etc/ppp/options file according to the distribution's need. Most importantly, when we do run the make install command, it shouldn't overwrite existing configuration files (could overwrite the examples).

So the question is, how do you get autoconf/automake to generate a Makefile rule to do that (i.e. not overwrite an existing file)? I had a look in the documentation for both autoconf and automake and couldn't see anything relevant.

Is the best we can do simply putting ".example" on the end of the names of all the files in etc.ppp?

@enaess
Copy link
Contributor

enaess commented Sep 13, 2024

Glancing over the documentation, I think the way to do this would be to rename the files in git to add the .example suffix, and then install that.

Package maintainers may ignore these files and remove them from the distribution at their own preference, and provide a default config based on the sample.

Some of these sample files may even be installed under /use/share/ppp/docs or something similar instead of /etc/ppp

Since they already are installed under /etc/ppp, maybe leave them there. It's mostly for us developers to set the right config and muck with it..

@rfc1036 @yarda any opinion from you?

@enaess
Copy link
Contributor

enaess commented Sep 13, 2024

Glancing over the documentation, I think the way to do this would be to rename the files in git to add the .example suffix, and then install that.

Package maintainers may ignore these files and remove them from the distribution at their own preference, and provide a default config based on the sample.

Some of these sample files may even be installed under /use/share/ppp/docs or something similar instead of /etc/ppp

Since they already are installed under /etc/ppp, maybe leave them there. It's mostly for us developers to set the right config and muck with it..

@rfc1036 @yarda @floppym any opinion from you?

@rfc1036
Copy link
Contributor

rfc1036 commented Sep 13, 2024

Are people actually installing ppp using make install on real systems? Anyway, it does not matter for Debian.

@paulusmack paulusmack linked a pull request Sep 13, 2024 that will close this issue
@floppym
Copy link
Contributor

floppym commented Sep 13, 2024

Yeah, as a distro packager this really doesn't matter at all. The package manager will automatically prevent the config files from being overwritten without notifying the user.

@enaess
Copy link
Contributor

enaess commented Sep 13, 2024

@paulusmack so basically, make install is really a developer centric option anyways. Most people are going to use a .deb or .rpm to install the software so I think we are free to do whatever you think is necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

4 participants