Unix Technical Forum

emerge -C and entries in /etc

This is a discussion on emerge -C and entries in /etc within the Gentoo Linux Support forums, part of the Unix Operating Systems category; --> When I remove a pakage using 'emerge -C' why does it leave entires in /etc? For example I was ...


Go Back   Unix Technical Forum > Unix Operating Systems > Gentoo Linux Support

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-21-2008, 11:03 AM
BinaryFrost
 
Posts: n/a
Default emerge -C and entries in /etc

When I remove a pakage using 'emerge -C' why does it leave entires in
/etc?

For example I was trying to remove apache so ran 'emerge -C apache',
but later on I've found /etc/init.d/apache2, /etc/conf.d/apache2 and
not to mention /etc/apache2/ still exist.

Any ideas?

TIA.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-21-2008, 11:03 AM
Peter Jensen
 
Posts: n/a
Default Re: emerge -C and entries in /etc

BinaryFrost wrote:

> When I remove a pakage using 'emerge -C' why does it leave entires in
> /etc?
>
> For example I was trying to remove apache so ran 'emerge -C apache',
> but later on I've found /etc/init.d/apache2, /etc/conf.d/apache2 and
> not to mention /etc/apache2/ still exist.
>
> Any ideas?


Short answer: It's designed that way.

Longer answer: Portage automatically protects configuration files during
merging of updates and unmerges. Usually these files contain changes
made by the user, so removing them might destroy some work that one
wants to keep. I think it was supposed to remove files with that were
not changed, so I'm curious as to why /etc/init.d/apache2 remains. Did
you make some changes to it, or perhaps merge it with an older version
in the wrong way?

--
PeKaJe

Microsoft products are easy to administrate. Anyone can do it!
Even if you don't want them to ... -- Jim Richardson, in COLA
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-21-2008, 11:03 AM
Johan Lindquist
 
Posts: n/a
Default Re: emerge -C and entries in /etc

So anyway, it was like, 12:21 CET Feb 04 2006, you know? Oh, and, yeah,
Peter Jensen was all like, "Dude,
> BinaryFrost wrote:


[random snippage]

>> When I remove a pakage using 'emerge -C' why does it leave entires
>> in /etc?


> Short answer: It's designed that way.


Alternative short answer: 'man make.conf', 'emerge --help config'

> Longer answer: Portage automatically protects configuration files
> during merging of updates and unmerges.


What controls this behaviour is the flag CONFIG_PROTECT, which is set
by default (at least) in /etc/make.globals, likely to just /etc. No
files in that directory will then be deleted when unmerging a package,
however (as far as I know) unchanged files will be overwritten when
merging a package.

To "unprotect" a directory (for example /etc/init.d, which you might
wish to keep clean), add it to the CONFIG_PROTECT_MASK flag.

--
Time flies like an arrow, fruit flies like a banana. Perth ---> *
12:37:57 up 87 days, 19:11, 2 users, load average: 1.14, 0.88, 0.38
Linux 2.6.14 x86_64 GNU/Linux Registered Linux user #261729
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-21-2008, 11:03 AM
Arthur Hagen
 
Posts: n/a
Default Re: emerge -C and entries in /etc

BinaryFrost <binaryfrost@gmail.com> wrote:
> When I remove a pakage using 'emerge -C' why does it leave entires in
> /etc?
>
> For example I was trying to remove apache so ran 'emerge -C apache',
> but later on I've found /etc/init.d/apache2, /etc/conf.d/apache2 and
> not to mention /etc/apache2/ still exist.
>
> Any ideas?


The idea is to protect configuration files, in case you had to uninstall
and then reinstall, e.g. in order to solve a conflict where there's a
new dependency. In that case, you'd be none to happy if all your
customized configuration files were gone.

However, the implementation is ill thought out, as it leaves files that
aren't configuration files (in the /etc/X11 tree, there's even binaries
that get left behind!), plus temporary and intermediate files created by
an app (which would be recreated if installing), while zapping config
files that happen to reside elsewhere.

IMO, this should really be on a per-package basis, where the package
maintainer would designate whether a file, directory or tree was
deletable upon uninstalling, plus special commands to run when deleting
the last instance of a package (e.g. to lock /etc/passwd entries for
accounts no longer used). However, that would require that the package
maintainers actually /understood/ their packages -- a rather tall order
these days.

As Johan said, your best bet is to edit the CONFIG_PROTECT and
CONFIG_PROTECT_MASK flags, and do some manual housekeeping.

Regards,
--
*Art

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-21-2008, 11:03 AM
Codo
 
Posts: n/a
Default Re: emerge -C and entries in /etc

Johan Lindquist wrote:
> To "unprotect" a directory (for example /etc/init.d, which you might
> wish to keep clean), add it to the CONFIG_PROTECT_MASK flag.


That's a great tip! Thanks.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:35 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com