openSUSE / containers-systemd

Systemd service files to run various openSUSE containers by systemd and podman
MIT License
13 stars 4 forks source link

do not store default values in sysconfig files #1

Closed lnussel closed 4 years ago

lnussel commented 4 years ago

Default values in sysconfig files are a problem in case they ever need to change. Please leave those variables empty and store the default values elsewhere in a read only location (like /usr/etc). That is the only way to know whether a value is the way it is because the admin wants it that way.

thkukuk commented 4 years ago

An empty variable from a sysconfig file could mean two things:

  1. The customer wants to use the default
  2. The customer wants to remove the default and set it to an empty one

So how should that work? systemd did the ugly way that you need to specify the variable twice in this case, to delete the default and to set a new default. But this is not working with a shell script and sourcing a sysconfig file.

All you can do is to revamp the sysconfig concept completly: /usr/etc/sysconfig contains the defaults, and /etc/sysconfig contains only the overrides. So fillup wouldn't be needed anymore. But that's a bigger, intrusive change for openSUSE and SLE.

lnussel commented 4 years ago

yeah sure, that doesn't work with values that can actually be empy but looks like you mostly have paths and download locations. So they don't seem to make sense when emtpy.

thkukuk commented 4 years ago

But still empty values in /etc/sysconfig will override the default ones from /usr/etc/sysconfig.

Independent of that, I don't see a variable were we can change the default later without breaking the customer system. So it does not matter at all if we can find out if the admin changes something or not, if he started the container once, every change from our side will break his setup.

thkukuk commented 4 years ago

We use now default files.