[opensuse-packaging] %tmpfiles_remove() macro?
Hi, we have a %tmpfiles_create() macro, but we have no macro and no rules in our packaging policy, to remove the tmpfiles at de-installation. That's why I would like to propose a %tmpfiles_remove() macro for the RPM %preun section: %tmpfiles_remove() \ test -n "$FIRST_ARG" || FIRST_ARG="$1" \ if [ "$FIRST_ARG" -eq 0 ]; then \ [ -z "${TRANSACTIONAL_UPDATE}" -a -x /usr/bin/systemd-tmpfiles ] && \ /usr/bin/systemd-tmpfiles --remove %{?*} || : \ fi \ %{nil} Any comments or objections? Thorsten -- Thorsten Kukuk, Distinguished Engineer, Senior Architect SLES & CaaSP SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Mon, Jul 2, 2018 at 6:57 AM Thorsten Kukuk
Hi,
we have a %tmpfiles_create() macro, but we have no macro and no rules in our packaging policy, to remove the tmpfiles at de-installation.
That's why I would like to propose a %tmpfiles_remove() macro for the RPM %preun section:
%tmpfiles_remove() \ test -n "$FIRST_ARG" || FIRST_ARG="$1" \ if [ "$FIRST_ARG" -eq 0 ]; then \ [ -z "${TRANSACTIONAL_UPDATE}" -a -x /usr/bin/systemd-tmpfiles ] && \ /usr/bin/systemd-tmpfiles --remove %{?*} || : \ fi \ %{nil}
Any comments or objections?
This is literally pointless, since tmpfiles are supposed to only be installed in /tmp for tmpfs. When the tmpfiles file is removed, then it won't regenerate the tempfiles on reboot. And if you're going to propose a macro like this, do it upstream and get upstream feedback. -- 真実はいつも一つ!/ Always, there's only one truth! -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Mon, Jul 02, Neal Gompa wrote:
This is literally pointless, since tmpfiles are supposed to only be installed in /tmp for tmpfs. When the tmpfiles file is removed, then it won't regenerate the tempfiles on reboot.
Could it be that you neither know the syntax of tmpfiles.d nor how systemd-tempfiles is working? At least your answer doesn't make any sense.
And if you're going to propose a macro like this, do it upstream and get upstream feedback.
??? This macros are openSUSE specific and have nothing to do with upstream. The support from upstream is already there (please read at first the manual pages and understand what the code is doing), we only ignore it until now and try to workaround it with %ghost entries, which have other problems. Thorsten -- Thorsten Kukuk, Distinguished Engineer, Senior Architect SLES & CaaSP SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Mon, Jul 2, 2018 at 8:49 AM Thorsten Kukuk
On Mon, Jul 02, Neal Gompa wrote:
This is literally pointless, since tmpfiles are supposed to only be installed in /tmp for tmpfs. When the tmpfiles file is removed, then it won't regenerate the tempfiles on reboot.
Could it be that you neither know the syntax of tmpfiles.d nor how systemd-tempfiles is working? At least your answer doesn't make any sense.
I do actually know how they work, thank you very much. But by policy, temp files shouldn't be installed in a location that is persistent. If they're not installed in a persistent location, there's no reason to call --remove.
And if you're going to propose a macro like this, do it upstream and get upstream feedback.
???
This macros are openSUSE specific and have nothing to do with upstream. The support from upstream is already there (please read at first the manual pages and understand what the code is doing), we only ignore it until now and try to workaround it with %ghost entries, which have other problems.
Why are you ghosting files in a location on tmpfs? -- 真実はいつも一つ!/ Always, there's only one truth! -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Mon, Jul 02, Neal Gompa wrote:
On Mon, Jul 2, 2018 at 8:49 AM Thorsten Kukuk
wrote: On Mon, Jul 02, Neal Gompa wrote:
This is literally pointless, since tmpfiles are supposed to only be installed in /tmp for tmpfs. When the tmpfiles file is removed, then it won't regenerate the tempfiles on reboot.
Could it be that you neither know the syntax of tmpfiles.d nor how systemd-tempfiles is working? At least your answer doesn't make any sense.
I do actually know how they work, thank you very much. But by policy, temp files shouldn't be installed in a location that is persistent. If they're not installed in a persistent location, there's no reason to call --remove.
Because it is not correct what you write. And if you think about the reason, why systemd-tmpfiles introduced the --remove option and the 'D', 'r' and 'R' flag, it should be pretty clear that your comment is outdated.
Why are you ghosting files in a location on tmpfs?
I'm not doing this, I even think it is plain wrong, but the openSUSE packaging policies and rpmlint checks suggests/requests/requires this. Please make yourself aware of the current usage of tools and policies. Thorsten -- Thorsten Kukuk, Distinguished Engineer, Senior Architect SLES & CaaSP SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Mon, Jul 2, 2018 at 8:57 AM Thorsten Kukuk
On Mon, Jul 02, Neal Gompa wrote:
On Mon, Jul 2, 2018 at 8:49 AM Thorsten Kukuk
wrote: On Mon, Jul 02, Neal Gompa wrote:
This is literally pointless, since tmpfiles are supposed to only be installed in /tmp for tmpfs. When the tmpfiles file is removed, then it won't regenerate the tempfiles on reboot.
Could it be that you neither know the syntax of tmpfiles.d nor how systemd-tempfiles is working? At least your answer doesn't make any sense.
I do actually know how they work, thank you very much. But by policy, temp files shouldn't be installed in a location that is persistent. If they're not installed in a persistent location, there's no reason to call --remove.
Because it is not correct what you write. And if you think about the reason, why systemd-tmpfiles introduced the --remove option and the 'D', 'r' and 'R' flag, it should be pretty clear that your comment is outdated.
Why are you ghosting files in a location on tmpfs?
I'm not doing this, I even think it is plain wrong, but the openSUSE packaging policies and rpmlint checks suggests/requests/requires this. Please make yourself aware of the current usage of tools and policies.
I guess if you ghost them, then it'd get deleted on rpm uninstall, but it's still weird. If you used %tmpfiles_remove, would we need to ghost tmpfiles? -- 真実はいつも一つ!/ Always, there's only one truth! -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Neal Gompa wrote:
On Mon, Jul 2, 2018 at 8:57 AM Thorsten Kukuk
wrote: On Mon, Jul 02, Neal Gompa wrote: [...]
Why are you ghosting files in a location on tmpfs?
I'm not doing this, I even think it is plain wrong, but the openSUSE packaging policies and rpmlint checks suggests/requests/requires this. Please make yourself aware of the current usage of tools and policies.
I guess if you ghost them, then it'd get deleted on rpm uninstall, but it's still weird. If you used %tmpfiles_remove, would we need to ghost tmpfiles?
Ghost files also make rpm -qf show something. The scope of tmpfiles has expanded over time and seems to be used for all kinds of things. So %ghost may be more useful for some entries than others. I wish the tmpfiles mechnism was more integrated into rpm or provided by rpm itself to avoid those scriptlets in the first place. Functional packaging ftw :-) cu Ludwig -- (o_ Ludwig Nussel //\ V_/_ http://www.suse.com/ SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Mon, Jul 02, Neal Gompa wrote:
I guess if you ghost them, then it'd get deleted on rpm uninstall, but it's still weird. If you used %tmpfiles_remove, would we need to ghost tmpfiles?
No, we would not need to %ghost them and it would solve quite some upgrade problems (moving files to ghost and back). Thorsten -- Thorsten Kukuk, Distinguished Engineer, Senior Architect SLES & CaaSP SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Dear Neal, On Montag, 2. Juli 2018 08:44:18 Neal Gompa wrote:
On Mon, Jul 2, 2018 at 6:57 AM Thorsten Kukuk
wrote: Hi,
we have a %tmpfiles_create() macro, but we have no macro and no rules in our packaging policy, to remove the tmpfiles at de-installation.
That's why I would like to propose a %tmpfiles_remove() macro for the RPM %preun section:
%tmpfiles_remove() \ test -n "$FIRST_ARG" || FIRST_ARG="$1" \ if [ "$FIRST_ARG" -eq 0 ]; then \
[ -z "${TRANSACTIONAL_UPDATE}" -a -x /usr/bin/systemd-tmpfiles ] && \
/usr/bin/systemd-tmpfiles --remove %{?*} || : \
fi \ %{nil}
Any comments or objections?
This is literally pointless, since tmpfiles are supposed to only be installed in /tmp for tmpfs. When the tmpfiles file is removed, then it won't regenerate the tempfiles on reboot.
And if you're going to propose a macro like this, do it upstream and get upstream feedback.
if you happen to have a LWN subscription, you might want to give this article a read: https://lwn.net/Articles/758363/ Alternatively, here's the lecture event, this article is about: https://www.youtube.com/watch?v=tzFWz5fiVKU&feature=youtu.be&t=2936 Thank you, Pete -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On 07/02/2018 12:57 PM, Thorsten Kukuk wrote:
%tmpfiles_remove() \ test -n "$FIRST_ARG" || FIRST_ARG="$1" \
don't you need a semicolon ';' here?
if [ "$FIRST_ARG" -eq 0 ]; then \ [ -z "${TRANSACTIONAL_UPDATE}" -a -x /usr/bin/systemd-tmpfiles ] && \ /usr/bin/systemd-tmpfiles --remove %{?*} || : \ fi \ %{nil}
I don't know much about RPM macros (especially the %-foo), but from shell-scripting perspective I find this overly hard to read, because of the mixture of if/then/fi versus "cmd1 && cmd2" versus the "[ cond1 -a cond2 ]" syntax. I like the "cmd1 && cmd2 || cmd3" syntax, so I'd end up with something like (untested!): %tmpfiles_remove() \ : ${FIRST_ARG:="$1"}; \ test "$FIRST_ARG" -eq 0 \ && test -z "${TRANSACTIONAL_UPDATE}" \ && test -x /usr/bin/systemd-tmpfiles \ && /usr/bin/systemd-tmpfiles --remove %{?*} \ || : \ %nil or %tmpfiles_remove() \ test "$FIRST_ARG" \ || FIRST_ARG="$1"; \ if [ "$FIRST_ARG" -eq 0 ] \ && [ -z "${TRANSACTIONAL_UPDATE}" ] \ && [ -x /usr/bin/systemd-tmpfiles ]; then \ /usr/bin/systemd-tmpfiles --remove %{?*} \ || : \ fi \ %nil Sorry for bike-shedding ... just adding another color to the discussion. ;-) Have a nice day, Berny -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (5)
-
Bernhard Voelker
-
Hans-Peter Jansen
-
Ludwig Nussel
-
Neal Gompa
-
Thorsten Kukuk