Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 217848 - upgrade to sys-apps/openrc deletes /etc/conf.d/net without warning
Summary: upgrade to sys-apps/openrc deletes /etc/conf.d/net without warning
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High major with 1 vote (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: InVCS
: 217879 218725 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-04-15 20:04 UTC by Graham Murray
Modified: 2008-04-21 18:19 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
make the baselayout-2.0.0 ebuild protect config fiels in /etc/conf.d (workaround_remap_dns_vars.patch,955 bytes, patch)
2008-04-17 17:15 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Graham Murray 2008-04-15 20:04:39 UTC
Following the upgrade to baselayout-2.0/openrc, /etc/conf.d/net was replaced by a skeleton rather than being migrated. dispatch-conf did not show this change and it was not mentioned in the upgrade guide.
Comment 1 Neil 2008-04-15 20:48:20 UTC
Same problem here on ~x86
Comment 2 Doug Goldstein (RETIRED) gentoo-dev 2008-04-15 20:51:01 UTC
It will affect all arches. We are currently discussing this as this looks like it's a potential Portage issue.
Comment 3 Bob Raitz 2008-04-15 20:53:45 UTC
Same problem here. I fixed it by recreating the link to net.eth0 in /etc/init.d. Unfortunately, I am left without the ability to rename my network interfaces at boot time. This happened with both ~x86 and ~amd64.

Color me unimpressed.

Blessed be!
Pappy
Comment 5 Neil 2008-04-15 20:57:03 UTC
Should have said that its not too hard to resolve, by recreating a symlink for the interface and modifying the now blank /etc/conf.d/net configuration filebut it doesn't seem to be read during initialisation

********** Start ***********
$ ln -s /etc/init.d/net.lo /etc/init.d/net.eth0
$ more /etc/conf.d/net
# This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d.  To create a more complete configuration,
# please review /usr/share/doc/openrc/net.example and save your configuration
# in /etc/conf.d/net (this file :]!).
modules=( "ifconfig" )
modules_eth0=( "dhcpcd" )

# /etc/init.d/net.eth0 restart
 * Bringing down interface eth0
 *   Stopping dhcpcd on eth0 ...                                          [ ok ]
 * Bringing up interface eth0
 *   No configuration specified; defaulting to DHCP
 *   dhcp ...
 *     Running dhcpcd ...                                                 [ ok ]
 *     received address 192.168.1.100/24                                  [ ok ]
 *   Waiting for IPv6 addresses ...                                       [ ok 
# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500  metric 1
        inet 192.168.1.100  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::20c:76ff:fe12:9d40  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:76:12:9d:40  txqueuelen 1000  (Ethernet)
        RX packets 72235  bytes 53425799 (50.9 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 100046  bytes 94590003 (90.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  base 0xce00  

*********** End ***********

Has the configuration file moved to a different location?
Comment 6 Doug Goldstein (RETIRED) gentoo-dev 2008-04-15 21:10:45 UTC
(In reply to comment #5)

> ********** Start ***********
> $ ln -s /etc/init.d/net.lo /etc/init.d/net.eth0
> $ more /etc/conf.d/net
> # This blank configuration will automatically use DHCP for any net.*
> # scripts in /etc/init.d.  To create a more complete configuration,
> # please review /usr/share/doc/openrc/net.example and save your configuration
> # in /etc/conf.d/net (this file :]!).
> modules=( "ifconfig" )
> modules_eth0=( "dhcpcd" )
>

Please review /usr/share/doc/openrc/net.example for how to set this file up.

> 
> Has the configuration file moved to a different location?
> 

No.
Comment 7 Neil 2008-04-15 21:22:30 UTC
(In reply to comment #6)
> (In reply to comment #5)
> 
> > ********** Start ***********
> > $ ln -s /etc/init.d/net.lo /etc/init.d/net.eth0
> > $ more /etc/conf.d/net
> > # This blank configuration will automatically use DHCP for any net.*
> > # scripts in /etc/init.d.  To create a more complete configuration,
> > # please review /usr/share/doc/openrc/net.example and save your configuration
> > # in /etc/conf.d/net (this file :]!).
> > modules=( "ifconfig" )
> > modules_eth0=( "dhcpcd" )
> >
> 
> Please review /usr/share/doc/openrc/net.example for how to set this file up.
> 
> > 
> > Has the configuration file moved to a different location?
> > 
> 
> No.
> 

Thanks for the pointer Doug, didn't even occur to look in there for the net.example file.  Doesn't a copy normally reside in /etc/conf.d/net.example ?
Comment 8 Doug Goldstein (RETIRED) gentoo-dev 2008-04-15 21:46:21 UTC
(In reply to comment #7)
> 
> Thanks for the pointer Doug, didn't even occur to look in there for the
> net.example file.  Doesn't a copy normally reside in /etc/conf.d/net.example ?
> 

I've added a note to the migration guide to check this out. /etc/conf.d/net.example was deprecated since it clutters up /etc/conf.d. The file has since moved to /usr/share/doc/openrc/net.example
Comment 9 SpanKY gentoo-dev 2008-04-15 22:40:58 UTC
simply deleting the line still makes for etc-update hell

you also dont want to go adding /etc/conf.d/net to the default CONTENTS as it may contain passwords which can make it into a binpkg

http://sources.gentoo.org/sys-apps/openrc/openrc-0.2.1-r2.ebuild?r1=1.5&r2=1.6
http://sources.gentoo.org/sys-apps/openrc/openrc-0.2.2.ebuild?r1=1.3&r2=1.4
http://sources.gentoo.org/sys-apps/openrc/openrc-9999.ebuild?r1=1.30&r2=1.31
Comment 10 Doug Goldstein (RETIRED) gentoo-dev 2008-04-15 22:52:59 UTC
This bug isn't fixed because there appears to still be a bug in Portage wrt to deleting unmerged-orphans when it should not. This was confirmed by zmedico and is being researched.
Comment 11 Doug Goldstein (RETIRED) gentoo-dev 2008-04-15 23:07:47 UTC
*** Bug 217879 has been marked as a duplicate of this bug. ***
Comment 12 Zac Medico gentoo-dev 2008-04-15 23:08:14 UTC
(In reply to comment #10)
> This bug isn't fixed because there appears to still be a bug in Portage wrt to
> deleting unmerged-orphans when it should not. This was confirmed by zmedico and
> is being researched.

I've traced the issue back to the remap_dns_vars() function inside baselayout-1.12.12.ebuild. It copies your configs into ${D} so then portage sees all those configs as defaults when they actually contain whatever local modifications you've made to them.

So unmerged-orphans is working by design. It's just the baselayout-1.12.12 ebuild is doing things to make your real configs appear to be the default ones.
Comment 13 Doug Goldstein (RETIRED) gentoo-dev 2008-04-15 23:17:40 UTC
I guess this is back over to us. Too much hackery in these ebuilds..
Comment 14 Chris Smith 2008-04-16 13:17:35 UTC
(In reply to comment #3)
> Same problem here. I fixed it by recreating the link to net.eth0 in
> /etc/init.d.

Different problem: /etc/init.d/net.eth0 != /etc/conf.d/net
Comment 15 Preston Crow 2008-04-17 15:54:31 UTC
This is a very serious problem.  On my laptop, I had fairly complex configurations in /etc/conf.d/net to configure either the ethernet or wireless for different environments, set up /etc/hosts based on location, launch ssh tunnels, and such.  I lost all of that and had to recreate everything from scratch.  Sure, for most users, it's not a big deal, but when using preup()/postup() and such, losing the file is a nightmare.

Could openrc be masked until this is fixed?
Comment 16 Jon Portnoy 2008-04-17 16:43:32 UTC
Regarding comment #15: This is indeed an annoying bug, but masking would be rather counterproductive at this point. I would suggest, though, that the OpenRC migration guide may want to mention keeping a copy of /etc/conf.d backed up for reference purposes when migrating, especially until this bug is fixed...
Comment 17 Zac Medico gentoo-dev 2008-04-17 17:00:37 UTC
(In reply to comment #15)
> Could openrc be masked until this is fixed?

Due to the effects of the remap_dns_vars() function, all users who currently have baselayout-1.12.12 installed are in danger of losing any config files in /etc/conf.d that haven't changed since it was installed.

One possible solution is to add `touch "${ROOT}"/etc/conf.d/*` the pkg_preinst() function of the baselayout-2 ebuild. This will protect those files from being unmerged with the rest of the baselayout-1.12.12 contents, effectively undoing the damage that was initially done by the remap_dns_vars() function.
Comment 18 Zac Medico gentoo-dev 2008-04-17 17:15:10 UTC
Created attachment 150090 [details, diff]
make the baselayout-2.0.0 ebuild protect config fiels in /etc/conf.d
Comment 19 Zac Medico gentoo-dev 2008-04-17 17:45:31 UTC
(In reply to comment #18)
> Created an attachment (id=150090) [edit]
> make the baselayout-2.0.0 ebuild protect config fiels in /etc/conf.d

That's in cvs now, so users are protected. I'm not sure if you guys want to do anything about the remap_dns_vars() in the old ebuilds or just let it go since the workaround now in the baselayout-2.0.0 ebuild makes it relatively harmless.
Comment 20 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2008-04-17 18:47:41 UTC
(In reply to comment #18)
> Created an attachment (id=150090) [edit]
> make the baselayout-2.0.0 ebuild protect config fiels in /etc/conf.d

I think this should go to openrc not baselayout, as openrc is now owner of the files there? And last time I checked, a different workaround for /etc/conf.d/net workaround was already there.
Comment 21 Zac Medico gentoo-dev 2008-04-17 19:33:10 UTC
(In reply to comment #20)
> I think this should go to openrc not baselayout, as openrc is now owner of the
> files there?

Is has to go in the baselayout-2.0.0 ebuild it is when upgrading to that ebuild (and then unmerging baselayout-1.x) that the user's configs get lost.
Comment 22 SpanKY gentoo-dev 2008-04-21 18:19:44 UTC
*** Bug 218725 has been marked as a duplicate of this bug. ***