[opensuse-packaging] Status update /usr/etc move
Hi, If you haven't seen or heard much about the /usr/etc proposal, that's because we had to wait that the necessary basic changes were accepted in Factory. With today, we got two important packages released: - filesystem contains /usr/etc - rpmlint accepts /usr/etc We are still missing rpm-config-SUSE for the %_distconfdir define. I did also setup a wiki for best practices and the changes we make, please see: https://en.opensuse.org/openSUSE:Packaging_UsrEtc Improvements, corrections, better ideas, etc. are always welcome! And if you adjust your package, please document this in this list, too. So that users have one place to find out what we changed, where to find the configuration files today and what they need to modify. I created a home project with first adjusted packages, too: https://build.opensuse.org/project/show/home:kukuk:etc All packages are tested on openSUSE MicroOS. Thorsten -- Thorsten Kukuk, Distinguished Engineer, Senior Architect SLES & MicroOS SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany Managing Director: Felix Imendoerffer (HRB 247165, AG München) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Hey, On 9/9/19 2:28 PM, Thorsten Kukuk wrote: [...]
I did also setup a wiki for best practices and the changes we make, please see: https://en.opensuse.org/openSUSE:Packaging_UsrEtc
Improvements, corrections, better ideas, etc. are always welcome!
The "variant 1"[1] contains a list of files/dirs that a application should read config files from: 1) /usr/etc/example.conf 2) /etc/example.conf 3) /etc/example.conf.d/*.conf I think the list should also contain a /usr/etc/example.conf.d/ (at pos 2) because there are cases where package1 has a config file (in /usr/etc) and package2 wants to adjust parameters and needs to adjust the config. So adding a snippet to /usr/etc/example.conf.d/ would be the way to go for package2. Cheers, Tom [1] https://en.opensuse.org/openSUSE:Packaging_UsrEtc#Variant_1_.28ideal_case.29 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Tue, Sep 10, Thomas Bechtold wrote:
Hey,
On 9/9/19 2:28 PM, Thorsten Kukuk wrote:
[...]
I did also setup a wiki for best practices and the changes we make, please see: https://en.opensuse.org/openSUSE:Packaging_UsrEtc
Improvements, corrections, better ideas, etc. are always welcome!
The "variant 1"[1] contains a list of files/dirs that a application should read config files from:
1) /usr/etc/example.conf 2) /etc/example.conf 3) /etc/example.conf.d/*.conf
I think the list should also contain a /usr/etc/example.conf.d/ (at pos 2) because there are cases where package1 has a config file (in /usr/etc) and package2 wants to adjust parameters and needs to adjust the config. So adding a snippet to /usr/etc/example.conf.d/ would be the way to go for package2.
That's what we implemented already, I adjusted the wiki now. Thorsten -- Thorsten Kukuk, Distinguished Engineer, Senior Architect SLES & MicroOS SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany Managing Director: Felix Imendoerffer (HRB 247165, AG München) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Am 2019-09-09 14:28, schrieb Thorsten Kukuk:
Hi,
If you haven't seen or heard much about the /usr/etc proposal, that's because we had to wait that the necessary basic changes were accepted in Factory.
With today, we got two important packages released: - filesystem contains /usr/etc - rpmlint accepts /usr/etc
We are still missing rpm-config-SUSE for the %_distconfdir define.
I did also setup a wiki for best practices and the changes we make, please see: https://en.opensuse.org/openSUSE:Packaging_UsrEtc
I have read the wiki and have a question. You write a administrator must change the config under /etc But you write in example: %posttrans # Migration to /usr/etc. for i in securetty pam.d/other pam.d/common-account pam.d/common-auth pam.d/common-password pam.d/common-session ; do test -f /etc/${i}.rpmsave && mv -v /etc/${i}.rpmsave /etc/${i} ||: done When i'm not stupid this would override the changes from administrator in /etc. Error or my mistake? -- Regards Eric -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Hi, On Wed, Sep 11, Eric Schirra wrote:
I have read the wiki and have a question. You write a administrator must change the config under /etc
But you write in example:
%posttrans # Migration to /usr/etc. for i in securetty pam.d/other pam.d/common-account pam.d/common-auth pam.d/common-password pam.d/common-session ; do test -f /etc/${i}.rpmsave && mv -v /etc/${i}.rpmsave /etc/${i} ||: done
When i'm not stupid this would override the changes from administrator in /etc.
Error or my mistake?
What happens if I migrate to the new layout is: First update: 1. In %pre we make sure there are no obsolete *.rpmsave files 2. We update the RPM. This will delete the files in /etc/pam.d, if they are modified rpm will create *.rpmsave files. After this step, the new config is in /usr/etc/pam.d and /etc/pam.d contains an *.rpmsave file, but no /etc/pam.d/config file! 3. If there is a /etc/pam.d/config.rpmsave file, we rename that to /etc/pam.d/config, to get the same behavior as before the update Now we make the second update: 1. %pre cannot find an /etc/pam.d/*.rpmsave file 2. We update the RPM content. No /etc/pam.d/*.rpmsave can be created, as there was no file of this RPM marked as %config anymore. 3. Since there cannot be a *.rpmsave file, the %posttrans cannot rename/overwrite anything. I hope this explains why this should work. Modulo any other hacks packages have in %pre/%post, in this case, the suggestion how to handle this needs adjustements for this package. Thorsten -- Thorsten Kukuk, Distinguished Engineer, Senior Architect SLES & MicroOS SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany Managing Director: Felix Imendoerffer (HRB 247165, AG München) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Wed, 2019-09-11 at 11:21 +0200, Thorsten Kukuk wrote:
What happens if I migrate to the new layout is:
First update:
1. In %pre we make sure there are no obsolete *.rpmsave files 2. We update the RPM. This will delete the files in /etc/pam.d, if they are modified rpm will create *.rpmsave files. After this step, the new config is in /usr/etc/pam.d and /etc/pam.d contains an *.rpmsave file, but no /etc/pam.d/config file! 3. If there is a /etc/pam.d/config.rpmsave file, we rename that to /etc/pam.d/config, to get the same behavior as before the update
Now we make the second update: 1. %pre cannot find an /etc/pam.d/*.rpmsave file 2. We update the RPM content. No /etc/pam.d/*.rpmsave can be created, as there was no file of this RPM marked as %config anymore. 3. Since there cannot be a *.rpmsave file, the %posttrans cannot rename/overwrite anything.
I hope this explains why this should work.
Perhaps this needs a more verbose comment than "Migration to /usr/etc.", at least on the Wiki page. Martin
Am 2019-09-09 14:28, schrieb Thorsten Kukuk:
Hi,
If you haven't seen or heard much about the /usr/etc proposal, that's because we had to wait that the necessary basic changes were accepted in Factory.
With today, we got two important packages released: - filesystem contains /usr/etc - rpmlint accepts /usr/etc
We are still missing rpm-config-SUSE for the %_distconfdir define.
I did also setup a wiki for best practices and the changes we make, please see: https://en.opensuse.org/openSUSE:Packaging_UsrEtc
Sorry. Something forgotten. You also write: If configuration files marked as %config(noreplace) are moved from /etc to /usr/etc, and the admin did modify them, RPM will save the modified configuration files as *.rpmsave files at the end of the update process. But under https://github.com/thkukuk/atomic-updates_and_etc/blob/master/README.md stands: files not marked: an update would replace the file and all changes are lost files marked as %config: modified files are moved away as *.rpmsave files marked as %config(noreplace): modified files stay, new files are written as *.rpmnew So. config(noreplace) will not "generate" an *.rpmsave? -- Regards Eric -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Wed, Sep 11, Eric Schirra wrote:
Sorry. Something forgotten. You also write: If configuration files marked as %config(noreplace) are moved from /etc to /usr/etc, and the admin did modify them, RPM will save the modified configuration files as *.rpmsave files at the end of the update process.
__moved__
But under https://github.com/thkukuk/atomic-updates_and_etc/blob/master/README.md stands:
files not marked: an update would replace the file and all changes are lost
__update__
So. config(noreplace) will not "generate" an *.rpmsave?
Removing files and updating files marked as config(noreplace) are two complete different things. Thorsten -- Thorsten Kukuk, Distinguished Engineer, Senior Architect SLES & MicroOS SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany Managing Director: Felix Imendoerffer (HRB 247165, AG München) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (4)
-
Eric Schirra
-
Martin Wilck
-
Thomas Bechtold
-
Thorsten Kukuk