Mailing List Archive

Can some config files be automatically protected from etc-update?
Now that the (no)multilib problem in my latest update has been solved,
I have a somewhat minor complaint. Can I get etc-update to skip certain
files? My latest emerge world wanted to "update"...

1) /etc/hosts (1)
2) /etc/inittab (1)
3) /etc/mtab (1)
4) /etc/conf.d/consolefont (1)
5) /etc/conf.d/hwclock (1)
6) /etc/default/grub (1)
7) /etc/ssh/sshd_config (1)

...hosts is critical for networking. consolefont allows me tp use the
true text console with a readable font, etc, etc. I have my reasons
for making certain settings, and keeping them that way.

--
I've seen things, you people wouldn't believe; Gopher, Netscape with
frames, the first Browser Wars. Searching for pages with AltaVista,
pop-up windows self-replicating, trying to uninstall RealPlayer. All
those moments, will be lost in time like tears in rain... time to die.
Re: Can some config files be automatically protected from etc-update? [ In reply to ]
On Mon, Apr 17, 2023 at 11:26?AM Walter Dnes <waltdnes@waltdnes.org> wrote:
>
> Now that the (no)multilib problem in my latest update has been solved,
> I have a somewhat minor complaint. Can I get etc-update to skip certain
> files? My latest emerge world wanted to "update"...
>
> 1) /etc/hosts (1)
> 2) /etc/inittab (1)
> 3) /etc/mtab (1)
> 4) /etc/conf.d/consolefont (1)
> 5) /etc/conf.d/hwclock (1)
> 6) /etc/default/grub (1)
> 7) /etc/ssh/sshd_config (1)
>
> ...hosts is critical for networking. consolefont allows me tp use the
> true text console with a readable font, etc, etc. I have my reasons
> for making certain settings, and keeping them that way.
>
In my experience with all distros I go outside the distro for this
sort of issue. Put a copy somewhere, white a little script that
does a diff on the files you feel are important enough and run
a cron job hourly that looks for any differences.

HTH,
Mark
Re: Can some config files be automatically protected from etc-update? [ In reply to ]
Really, etc update has a facility for skipping whatever files you want.

Lee ????

On Mon, Apr 17, 2023, 12:28 PM Mark Knecht <markknecht@gmail.com> wrote:

>
>
> On Mon, Apr 17, 2023 at 11:26?AM Walter Dnes <waltdnes@waltdnes.org>
> wrote:
> >
> > Now that the (no)multilib problem in my latest update has been solved,
> > I have a somewhat minor complaint. Can I get etc-update to skip certain
> > files? My latest emerge world wanted to "update"...
> >
> > 1) /etc/hosts (1)
> > 2) /etc/inittab (1)
> > 3) /etc/mtab (1)
> > 4) /etc/conf.d/consolefont (1)
> > 5) /etc/conf.d/hwclock (1)
> > 6) /etc/default/grub (1)
> > 7) /etc/ssh/sshd_config (1)
> >
> > ...hosts is critical for networking. consolefont allows me tp use the
> > true text console with a readable font, etc, etc. I have my reasons
> > for making certain settings, and keeping them that way.
> >
> In my experience with all distros I go outside the distro for this
> sort of issue. Put a copy somewhere, white a little script that
> does a diff on the files you feel are important enough and run
> a cron job hourly that looks for any differences.
>
> HTH,
> Mark
>
Re: Can some config files be automatically protected from etc-update? [ In reply to ]
On Monday, 17 April 2023 20:28:01 BST Mark Knecht wrote:
> On Mon, Apr 17, 2023 at 11:26?AM Walter Dnes <waltdnes@waltdnes.org> wrote:
> > Now that the (no)multilib problem in my latest update has been solved,
> >
> > I have a somewhat minor complaint. Can I get etc-update to skip certain
> > files? My latest emerge world wanted to "update"...
> >
> > 1) /etc/hosts (1)
> > 2) /etc/inittab (1)
> > 3) /etc/mtab (1)
> > 4) /etc/conf.d/consolefont (1)
> > 5) /etc/conf.d/hwclock (1)
> > 6) /etc/default/grub (1)
> > 7) /etc/ssh/sshd_config (1)
> >
> > ...hosts is critical for networking. consolefont allows me tp use the
> > true text console with a readable font, etc, etc. I have my reasons
> > for making certain settings, and keeping them that way.
>
> In my experience with all distros I go outside the distro for this
> sort of issue. Put a copy somewhere, white a little script that
> does a diff on the files you feel are important enough and run
> a cron job hourly that looks for any differences.
>
> HTH,
> Mark

The emerge specific solution is to set the list in your CONFIG_PROTECT
variable in /etc/make.conf, as per the example provided here:

https://wiki.gentoo.org/wiki/Handbook:AMD64/Working/EnvVar
Re: Can some config files be automatically protected from etc-update? [ In reply to ]
On Mon, Apr 17, 2023 at 02:26:40PM -0400, Walter Dnes wrote:
> Can I get etc-update to skip certain files?

I'm not sure about etc-update, but whenever an update triggers a config
file conflict, I just `dispatch-conf` to see the changes, and then
either merge, or 'zap new' (aka, delete the new version and use the old
one). This works pretty well to keep my changes to /etc.

Another thing that can help is keeping /etc under a vcs like git. You
can do that manually or using a helper tool like `etckeeper`, which
automates a lot of the git upkeeping for you.
Re: Can some config files be automatically protected from etc-update? [ In reply to ]
> The emerge specific solution is to set the list in your CONFIG_PROTECT
> variable in /etc/make.conf

Afaik CONFIG_PROTECT includes the whole of /etc by default (Unless you
poke holes in it with CONFIG_PROTECT_MASK, or overriting CONFIG_PROTECT).
Re: Can some config files be automatically protected from etc-update? [ In reply to ]
On Mon, Apr 17, 2023 at 12:40?PM Lee <ny6p01@gmail.com> wrote:
>
> Really, etc update has a facility for skipping whatever files you want.
>
> Lee
<SNIP>
>> In my experience with all distros I go outside the distro for this
>> sort of issue. Put a copy somewhere, white a little script that
>> does a diff on the files you feel are important enough and run
>> a cron job hourly that looks for any differences.
>>
>> HTH,
>> Mark

>
Absolutely really. It's not only about whether that option works today
but whether it keeps working in the future, assuming it really works
at all.

There's also the case of the machine going down, a disk corrupting,
etc. and how long it takes to find the notebook where supposedly
we had the notes about how we set things up.

And what about other machines using other distros?

I'm only offering what I do. I personally wouldn't run the cron job
but for all my machines part of my backups is a big list of config
files kept elsewhere on the network so that I don't have to
reconstruct that sort of config stuff. Add to Walter's list other
things like NFS exports and for old people like me it's just
easier to be prepared.

Just my POV.
Re: Can some config files be automatically protected from etc-update? [ In reply to ]
Am Mon, Apr 17, 2023 at 12:28:01PM -0700 schrieb Mark Knecht:
> On Mon, Apr 17, 2023 at 11:26?AM Walter Dnes <waltdnes@waltdnes.org> wrote:
> >
> > Now that the (no)multilib problem in my latest update has been solved,
> > I have a somewhat minor complaint. Can I get etc-update to skip certain
> > files? My latest emerge world wanted to "update"...
> >
> > 1) /etc/hosts (1)
> > 2) /etc/inittab (1)
> > 3) /etc/mtab (1)
> > 4) /etc/conf.d/consolefont (1)
> > 5) /etc/conf.d/hwclock (1)
> > 6) /etc/default/grub (1)
> > 7) /etc/ssh/sshd_config (1)
> >
> > ...hosts is critical for networking. consolefont allows me tp use the
> > true text console with a readable font, etc, etc. I have my reasons
> > for making certain settings, and keeping them that way.
> >
> In my experience with all distros I go outside the distro for this
> sort of issue. Put a copy somewhere, white a little script that
> does a diff on the files you feel are important enough and run
> a cron job hourly that looks for any differences.

Isn’t that exactly what etc-update does? IIRC (my last Gentoo update was a
few months ago), I select one of the files, and it lets me view a diff in
vim (configurable) of my old version and the new one from the update. Then I
can either merge the two files right in vim, or elect to keep the new or old
file entirely.

--
Grüße | Greetings | Qapla’
Please do not share anything from, with or about me on any social network.

“I want to be free!” said the string puppet and cut its strings.
Re: Can some config files be automatically protected from etc-update? [ In reply to ]
On Mon, Apr 17, 2023 at 2:08?PM Frank Steinmetzger <Warp_7@gmx.de> wrote:
>
> Am Mon, Apr 17, 2023 at 12:28:01PM -0700 schrieb Mark Knecht:
> <SNIP>
> > In my experience with all distros I go outside the distro for this
> > sort of issue. Put a copy somewhere, white a little script that
> > does a diff on the files you feel are important enough and run
> > a cron job hourly that looks for any differences.
>
> Isn’t that exactly what etc-update does? IIRC (my last Gentoo update was a
> few months ago), I select one of the files, and it lets me view a diff in
> vim (configurable) of my old version and the new one from the update.
Then I
> can either merge the two files right in vim, or elect to keep the new or
old
> file entirely.
>

It might do most of that, if it's working. If no bugs have been introduced
since the last time you used it, if the user has their eyes open and
doesn't make a mistake.

I do not know if it has an option to keep a copy somewhere safe, and
again, I run multiple distros and like a solution that, for me, works on
all distros.

To each his own.

;-) (And shame on you for being 'a few months' behind on your updates) ;-)
Re: Can some config files be automatically protected from etc-update? [ In reply to ]
My guess is gentoo includes the chattr utility. Does emerge respect
chattr +i /etc/hosts?


--
Jude <jdashiel at panix dot com>
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo.
Please use in that order."
Ed Howdershelt 1940.

On Mon, 17 Apr 2023, Frank Steinmetzger wrote:

> Am Mon, Apr 17, 2023 at 12:28:01PM -0700 schrieb Mark Knecht:
> > On Mon, Apr 17, 2023 at 11:26?AM Walter Dnes <waltdnes@waltdnes.org> wrote:
> > >
> > > Now that the (no)multilib problem in my latest update has been solved,
> > > I have a somewhat minor complaint. Can I get etc-update to skip certain
> > > files? My latest emerge world wanted to "update"...
> > >
> > > 1) /etc/hosts (1)
> > > 2) /etc/inittab (1)
> > > 3) /etc/mtab (1)
> > > 4) /etc/conf.d/consolefont (1)
> > > 5) /etc/conf.d/hwclock (1)
> > > 6) /etc/default/grub (1)
> > > 7) /etc/ssh/sshd_config (1)
> > >
> > > ...hosts is critical for networking. consolefont allows me tp use the
> > > true text console with a readable font, etc, etc. I have my reasons
> > > for making certain settings, and keeping them that way.
> > >
> > In my experience with all distros I go outside the distro for this
> > sort of issue. Put a copy somewhere, white a little script that
> > does a diff on the files you feel are important enough and run
> > a cron job hourly that looks for any differences.
>
> Isn’t that exactly what etc-update does? IIRC (my last Gentoo update was a
> few months ago), I select one of the files, and it lets me view a diff in
> vim (configurable) of my old version and the new one from the update. Then I
> can either merge the two files right in vim, or elect to keep the new or old
> file entirely.
>
>
Re: Can some config files be automatically protected from etc-update? [ In reply to ]
If that works and I were to use chattr +i it might be useful to make a
list of what's now immuteable so later adjustments could be made when
appropriate.


-- Jude <jdashiel at panix dot com> "There are four boxes to be used in
defense of liberty: soap, ballot, jury, and ammo. Please use in that
order." Ed Howdershelt 1940.

On Mon, 17 Apr 2023, Frank Steinmetzger wrote:

> Am Mon, Apr 17, 2023 at 12:28:01PM -0700 schrieb Mark Knecht:
> > On Mon, Apr 17, 2023 at 11:26?AM Walter Dnes <waltdnes@waltdnes.org> wrote:
> > >
> > > Now that the (no)multilib problem in my latest update has been solved,
> > > I have a somewhat minor complaint. Can I get etc-update to skip certain
> > > files? My latest emerge world wanted to "update"...
> > >
> > > 1) /etc/hosts (1)
> > > 2) /etc/inittab (1)
> > > 3) /etc/mtab (1)
> > > 4) /etc/conf.d/consolefont (1)
> > > 5) /etc/conf.d/hwclock (1)
> > > 6) /etc/default/grub (1)
> > > 7) /etc/ssh/sshd_config (1)
> > >
> > > ...hosts is critical for networking. consolefont allows me tp use the
> > > true text console with a readable font, etc, etc. I have my reasons
> > > for making certain settings, and keeping them that way.
> > >
> > In my experience with all distros I go outside the distro for this
> > sort of issue. Put a copy somewhere, white a little script that
> > does a diff on the files you feel are important enough and run
> > a cron job hourly that looks for any differences.
>
> Isn’t that exactly what etc-update does? IIRC (my last Gentoo update was a
> few months ago), I select one of the files, and it lets me view a diff in
> vim (configurable) of my old version and the new one from the update. Then I
> can either merge the two files right in vim, or elect to keep the new or old
> file entirely.
>
>
Re: Can some config files be automatically protected from etc-update? [ In reply to ]
Am Mon, Apr 17, 2023 at 02:27:53PM -0700 schrieb Mark Knecht:

> ;-) (And shame on you for being 'a few months' behind on your updates) ;-)

It’s my NAS (basically my media library), which only runs every few months
due to its server hardware’s high power draw.

--
Grüße | Greetings | Qapla’
Please do not share anything from, with or about me on any social network.

My computer waits faster!
Re: Can some config files be automatically protected from etc-update? [ In reply to ]
On 17/04/2023 19:26, Walter Dnes wrote:
> Now that the (no)multilib problem in my latest update has been solved,
> I have a somewhat minor complaint. Can I get etc-update to skip certain
> files? My latest emerge world wanted to "update"...
>
> 1) /etc/hosts (1)
> 2) /etc/inittab (1)
> 3) /etc/mtab (1)
> 4) /etc/conf.d/consolefont (1)
> 5) /etc/conf.d/hwclock (1)
> 6) /etc/default/grub (1)
> 7) /etc/ssh/sshd_config (1)
>
> ...hosts is critical for networking. consolefont allows me tp use the
> true text console with a readable font, etc, etc. I have my reasons
> for making certain settings, and keeping them that way.
>
I had it want to update grub. Which would have utterly borked my system
the moment I updated my kernel.

Okay, the problem is where you mix user and system config in the same
file, but this would have deleted lvm and mdadm from my boot config,
rendering any kernel unbootable. :-(

Like it tried to update postfix many moons ago and would have destroued
my mail config ...

Surely there's some way of fixing this ...

Cheers,
Wol
Re: Can some config files be automatically protected from etc-update? [ In reply to ]
On Tue, 18 Apr 2023 05:55:49 +0100, Wols Lists wrote:

> On 17/04/2023 19:26, Walter Dnes wrote:
> > Now that the (no)multilib problem in my latest update has been
> > solved, I have a somewhat minor complaint. Can I get etc-update to
> > skip certain files? My latest emerge world wanted to "update"...
> >
> > 1) /etc/hosts (1)
> > 2) /etc/inittab (1)
> > 3) /etc/mtab (1)
> > 4) /etc/conf.d/consolefont (1)
> > 5) /etc/conf.d/hwclock (1)
> > 6) /etc/default/grub (1)
> > 7) /etc/ssh/sshd_config (1)
> >
> > ...hosts is critical for networking. consolefont allows me tp use the
> > true text console with a readable font, etc, etc. I have my reasons
> > for making certain settings, and keeping them that way.
> >
> I had it want to update grub. Which would have utterly borked my system
> the moment I updated my kernel.
>
> Okay, the problem is where you mix user and system config in the same
> file, but this would have deleted lvm and mdadm from my boot config,
> rendering any kernel unbootable. :-(
>
> Like it tried to update postfix many moons ago and would have destroued
> my mail config ...
>
> Surely there's some way of fixing this ...

You could have a post-install hook in /etc/portage/env/$CAT/$PKG for each
of the affected files, something like

post_pkg_postinst() {
rm -f /etc/._cfg0000_hosts
}

You'll need to check the syntax as it's a while since I've used this.


--
Neil Bothwick

Life's a cache, and then you flush...