While I don’t know of any way to explicitly configure sysconfig files to not be modified, my two suggestions would be: 1) chattr +i to set them immutable - a bit drastic. Or 2) Use a simple version control tool like rcs to keep check in your current versions, and if needed easily recover them. (Or you could just put everything in sysconfig, or even /etc into a git repo, etc.)
Both options would certainly work. Agreed re: “a bit drastic”. Not really workable for wider roll-out.
It’s not ideal that any system action touches your config customizations at all. Most other apps/packages seem to ‘know better’. Ideally, a ‘flag’ to prevent that – as one can for example set IN /etc/sysconfig/bootloader so as to NOT touch/overwrite /boot/grub/menu.lst – would work best.
I do not know if I understand fully what you want. For Apache the configuration is in /etc/apache2. I use default-server.conf and files in* conf.d* there and never found them overwritten. But /etc/sysconfig/apache2 may be usefull for something different
Also other changes in e.g. /etc/sysconfig/network I do manualy or via YaST are normaly not written over by e.g. a security update.
Can you specify more precise when what is written over?
> Can you specify more precise when what is written over?
Once I modify a config file – whether format/organization, comments, or settings – I don’t want it touched/modified/written/overwritten by anything, unless I explcitly give it permission to do so.
In this example, ‘some’ system action adds a whole bunch of comment lines,
Type: …
Default: …
ServiceRestart: …
repeatedly through my /etc/sysconfig/apache2 file.
It seems to add all three lines, repeatedly, for most (but not all) existing options in the file.
In doing so, it definitely screws up my formatting and comment, sometimes interleaving those comment lines with what I’ve written, resulting in garbage.
Doesn’t really matter WHAT it writes to the file – My point is simply that I’d like the option to NOT have ANYTHING written. (e.g., having the word “PROTECT” in line#1 of the file, or some such thing)
I agree with that sentiment. I find the way “/etc/csh.cshrc” and “/etc/bash.bashrc” are handled to be particularly annoying. In my way of looking at things, those files are local system admin files, and the distro should not touch them, other than perhaps provide a sample version on original install.
In any case, what I do is use “rcs” to keep track of changes. My “/etc/RCS” is actually a symlink to “/home/RCS.etc”. That way, as long as I preserve the home partition, I can get to my revision history. Similarly, if I needed “/etc/sysconfig/RCS”, I would make that a symlink to “/etc/RCS/RCS.sysconfig” (or, really, to "…/RCS/RCS.sysconfig) so that the real RCS directories are all in the “/home/RCS.etc” tree.
On 09/02/2011 11:06 PM, nrickert wrote:
>
> “/etc/bash.bashrc”
have you not discovered written within /etc/bash.bashrc:
# PLEASE DO NOT CHANGE /etc/bash.bashrc There are chances that your changes
# will be lost during system upgrades. Instead use /etc/bash.bashrc.local
# for your local settings, favourite global aliases, VISUAL and EDITOR
# variables, etc ...
and, i guess there are ways to protect all configs (i just keep a
backup) but you must realize that stuff changes in new releases and new
version…and, when it does the old config may no longer work…while
the one which come with the new app/system does…AND, if things are
done right the new mans will adequately explain how to fit the new
requirements of the app into your system’s configs…
the apache problem, i have no idea but guess what is being seen is NOT
normal…something is broken in the setup…(just a guess)
I can only repeat that “/etc/bash.bashrc” is supposed to be a local system administrator’s file. It should not be cluttered with all sorts of distro-related stuff.
Sure, stuff changes. The shell startup files are the wrong places to handle those changes.
If the desktop needs additional environment variables, then those should be defined in the desktop startup scripts, and not in the shell startup scripts.
> I can only repeat that “/etc/bash.bashrc” is supposed to be a local
> system administrator’s file. It should not be cluttered with all sorts
> of distro-related stuff.
ok, now i understand (i think) that the question in the subject (how to
prevent overwrite) is about this distribution’s philosophy of how
config files are designed for use vs the way other distro’s use
their /etc/config (and therefore ‘prevent overwrite’)…
ok2, you know how to preserve local admin desired stuff in
/etc/bash.bashrc.local but you want the same feature for all configs
in /etc, or some other philosophical change in how 1) the system and
2) the administrator customize those files during use
so, as i see it you have a few courses of action to choose from:
try to change this distro’s basic philosophy on how configs in /etc
are used–and, you can not do that here because you must interact with
the developers, and they are NOT here…this is a help forum of users
helping users and NOT a place where developers and system design
decision makers hang out; they are easy to find on IRC and/or mail list,
see here http://en.opensuse.org/openSUSE:Communication_channels
alternatively you could ask for a new feature be implemented (like
maybe a /etc/sysconfig/apache2.local), that too needs to get to the
devs–in this distro’s universe that is done via FATE, here: https://features.opensuse.org/
you could use what works for you…that is, you don’t like the
current (and afaik, long standing) openSUSE way of doing this, so use
the distro which works for you…and if you still want to try to change
this distro’s way, go ahead and do that, but not in this help
forum…if you impact the design philosophy you can come back, if not:
it is a big ocean of distributions and enough variance to make most
anyone happy…
finally, i’ll say again: the apache problem [seen by ip15], i have no
idea but guess what is being seen is NOT normal…something is broken
in the setup…(just a guess)…and suggest if you want to try to fix
that then lets focus on that here, and you can try to change the distro
with the devs, and not here…
From Yast , System, /etc/sysconfig Editor:
→ System
--------> SuSEconfig
------------------> ENABLE_SUSECONFIG: no.
Be sure you read the warning and understand the implications of disabling SuSEconfig:
Some people don’t want SuSEconfig to modify the system. With this
entry you can disable SuSEconfig completely.
Please don’t contact our support if you have trouble configuring your
system after having disabled SuSEconfig. (yes/no)
Perhaps I am missing something here, but is part of this issue that Suse (perhaps) sometimes employs .rpmnew and .rpmsave files when updating packages, but is not uniform in this? Or that the /etc/sysconfig/apache2 file is incorrectly not associated with the apache2 package?
Running this on my system:
find /etc/ -print | egrep "rpmnew$|rpmsave$"
Shows the following config files (including one in /sysconfig) have .rpmnew or .rpmsave files from previous updates:
Could this really just be a case of the Apache packages not creating .rpmnew files when updating? If so, the package maintainer could be contacted and asked to not to clobber the /sysconfig (and other) files?
Also, I find this a bit odd:
rpm -qf /etc/sysconfig/apache2
file /etc/sysconfig/apache2 is not owned by any package
Why is this not associated with the Apache2 rpm? If it were, and were later updated, the old version (should) be kept in place and the new version installed as /etc/sysconfig/apache2.rpmnew (provided it were specified so in the package)?
On 09/06/2011 08:26 PM, LewsTherinTelemon wrote:
>
> is part of this issue that
> Suse (perhaps) sometimes employs .rpmnew and .rpmsave files when
> updating packages, but is not uniform in this?
i guess that question as well as this whole thread should all go to the
developers/pagkagers, i gave the how-to talk to them in post #11.
–
DD Caveat
openSUSE®, the “German Automobiles” of operating systems
On 2011-09-06 20:26, LewsTherinTelemon wrote:
> Running this on my system:
>
>
> Code:
> --------------------
> find /etc/ -print | egrep “rpmnew$|rpmsave$”
> --------------------
>
>
> Shows the following config files (including one in /sysconfig) have
> rpmnew or .rpmsave files from previous updates:
Run “rcrpmconfigcheck” instead.
–
Cheers / Saludos,
Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)
On 2011-09-02 22:06, ip15 wrote:
> Doesn’t really matter WHAT it writes to the file – My point is simply
> that I’d like the option to NOT have ANYTHING written. (e.g., having the
> word “PROTECT” in line#1 of the file, or some such thing)
Not possible, as it is happening by design.
You can, however, write a bugzilla, giving the exact file before and after
the update of which exact rpm.
–
Cheers / Saludos,
Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)