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

Deb package should not replace configs #113

Closed
janisz opened this issue Aug 30, 2016 · 6 comments
Closed

Deb package should not replace configs #113

janisz opened this issue Aug 30, 2016 · 6 comments
Assignees
Labels

Comments

@janisz
Copy link
Contributor

janisz commented Aug 30, 2016

When you install marathon-consul from deb it will overwrite /etc/marathon-consul.d/config.json. Instead user should be asked what should happen.

https://www.debian.org/doc/debian-policy/ch-files.html#s-config-files

@ojagodzinski
Copy link
Member

My idea is to change the name of default config created by .deb package to something like /etc/marathon-consul.d/config.json.template. Only downside is that new installations won't be as smooth as they are now.

@janisz
Copy link
Contributor Author

janisz commented Aug 30, 2016

I think adding this file to conffiles should be enough but can't verify it now :(

@ojagodzinski
Copy link
Member

ojagodzinski commented Aug 30, 2016

conffiles is also good idea but goxc doesn't support conffiles/postinst files. Fpm supports this but lacks Github features.

@janisz
Copy link
Contributor Author

janisz commented Aug 30, 2016

goxc #86 suggest using fpm for generating debs. I think we can go with template option. It won't change current behavior becouse deb config is generated from default values so there shouldn't be any change in deb installation behavior.
@ojagodzinski Would you like to prepare pull request for it?

@janisz
Copy link
Contributor Author

janisz commented Oct 8, 2016

Prepared PR for debber debber/debber-v0.3#2 (part of goxc used for creating debs). Once it's get merged we need to apply following patch

diff --git a/resources/debian/conffiles b/resources/debian/conffiles
new file mode 100644
index 0000000..834b1ae
--- /dev/null
+++ b/resources/debian/conffiles
@@ -0,0 +1,3 @@
+/etc/init/marathon-consul.conf
+/etc/marathon-consul.d/config.json
+/etc/systemd/system/marathon-consul.service

@janisz
Copy link
Contributor Author

janisz commented Oct 11, 2016

It looks like debber and goxc is no logner maintained and my fix is not enought. I'll try incorporate fpm.
Thanks @ojagodzinski for pointing out the problem and help with fpm

fpm --verbose -s dir -t deb \                                                          
        -n marathon-consul \
        -v 1.0.0-alpha7 \
        --url="https://github.com/allegro/marathon-consul" \
        --vendor=Allegro \
        --maintainer="Allegro Group <opensource@allegro.pl>" \
        --description "Marathon-consul service (performs Marathon Tasks registration as Consul Services for service discovery) Marathon-consul takes information provided by the Marathon event bus and forwards it to Consul agents. It also re-syncs all the information from Marathon to Consul on startup and repeats it with given interval." \
        --deb-priority optional \
        --workdir /tmp/ \
        --license "Apache License, version 2.0" \
        ./bin/marathon-consul=/usr/bin/marathon-consul \
        ./debian/marathon-consul.service=/etc/systemd/system/marathon-consul.service \
        ./debian/marathon-consul.upstart=/etc/init/marathon-consul.conf \
        ./debian/config.json=/etc/marathon-consul.d/config.json

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

No branches or pull requests

2 participants