How do I stop updates from reverting my /etc files. Specifically Imagemagick

Hi,
on my system running zypper dup regularly reverts my /etc/IM-7/policy.xml file to defaults. Presumably whenever IM updates, but I haven’t been paying close enough attention. I notice when IM refuses to process a file, due to IM’s low default limits.

How do I prevent zypper from reverting this specific file? And is there a way to find out which files in my /etc will get silently reverted to default when I run “zypper dup”?

IMHO those files shouldn’t be overwritten. But it looks like ImageMagick has its own idea how to handle this:

You can create your own policy.xml in your own directory, which will not change. See ImageMagick | Resources

Locations can be:

$MAGICK_CONFIGURE_PATH
$PREFIX/etc/ImageMagick-7 
$PREFIX/share/ImageMagick-7 
$XDG_CACHE_HOME/ImageMagick
$HOME/.config/ImageMagick
<client path>/etc/ImageMagick

These days, the package should probably be changed to use /usr/etc/IM-7 as the system-wide directory and let the local admin override the files with /etc/IM-7.

1 Like

I remember reading the discussion in the first thread. Especially the part where they specifically say that your recommendation does NOT work. Are you really sure that that is fixed, I hadn’t heard about it.
The second link you posted is dead, so I can’t check if it also specifically say that your solution does not work.

I will try setting the settings from my home-dir again. Maybe it finally works.

I just tested setting the settings in my home dir. And just like your first link explains, it does not work.

I am not sure of anything; I just wanted to help. The link works for me.

But anyway, the problem is upstream in ImageMagick, not in the openSUSE distro.

The fact that Imagemagick ignores the settings in the home dir is a bug with upstream I agree. Though they have been consistently saying it is actually a feature since at least 2023.

The fact that zypper overwrites the main config file in /etc without asking is a but in the openSUSE distro. The link you linked even has someone noting that his distro keeps asking if he wants to overwrite the file instead of just doing it.
The fact that there isn’t any visible documentation about which files get overwritten by zypper is also a bug in opensuse.
Even the fact that opensuse makes it unusually hard to work around that longstanding but is a bug with opensuse. At least in the sense that the original one is a bug.

Sorry, but you are barking upon the wrong tree.

zypper does not do this. It installs the RPM. And the RPM “does” this. And the RPM is created by the ImageMagick developers. And, as mentioned above, they should not overwrite an existing /etc/ configuration file of their product with a new one. At the most they should create one when not present (at first installation of ImageMagick).

There are conventions on how to handle this (create a default confguration file in /usr/share/, give the system manager the opportunity to make changes that survive updates in /etc/ and give, when it is an end-user application, the user the chance to make config adaptions in ~/.local.
And of course the products software should walk down all these files (when they exist) to set and overrule what they find there in sequence.

But the comments above try to tell you that the ImageMagick people do not follow any of those conventions.

Most products do. And thus you should in general not be afraid that configurations in /etc/ are overwritten when a product update is done.

Ah, I did not know that that behaviour came from the RPM. Opensuse is the only rpm based distro that I regularly use, so I didn’t notice that the problem is somewhere else.

You are splitting the hairs.

No, it is not. It is created by the ImageMagick packagers. Packagers may be also developers, but most often they are not.

Anyway, to the original problem. @victualsquid The /etc/IM-7/policy.xml is provided by one of the ImageMagic-config-7-* packages. The default package ImageMagick-config-7-SUSE overwrites policy file. I assume it is SUSE policy (pun unintended). You can install any other alternative configuration package to get different behavior. E.g. ImageMagick-config-7-upstream-open marks the /etc/IM-7/policy.xml as %config(noreplace) meaning its content will be preserved on updates. I presume these packages differ in the initial content of the policy.xml, but I am not really interested in making detail comparison.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.