Andrei Borzenkov <arvidjaar@gmail.com> writes:
On Wed, Aug 17, 2016 at 1:35 PM, Kristoffer Grönlund <kgronlund@suse.com> wrote:
The description of the problem is not quite right: We've dropped the hawk package in favor of the hawk2 package (they were co-existing at the same time for a while, but hawk 1 is outdated now). They both provide the hawk systemd service.
So a user upgrading will get moved to the hawk2 package, but if the hawk service was enabled before the upgrade, it is now disabled.
My best guess that this is done by *old* package which is now uninstalled, so it removes and disables services. pre|postun of removed package are executed after pre|post of new package. If this is true, you may try to define triggerpostun in on hawk in hawk2 - this /should/ be executed as last. %pre on hawk2 would then gather current service status and %triggerpostun on hawk in hawk2 would restore it.
Hi Andrei, Thank you for your help, enabling the hawk service in %triggerpostun does seem to run correctly, at least in my initial simple test. However, I haven't managed to implement the second part: Gathering the current status in %pre and only enabling it if it was enabled before. I've been digging through the RPM book and the net to find an example of how to keep state between scriptlets, but haven't figured it out. I tried writing a temporary file to %_tmppath, but then the rpmlint checks failed complaining about non-idempotent scriptlets. Do you have an example of how to do this? Cheers, Kristoffer -- // Kristoffer Grönlund // kgronlund@suse.com -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org