Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Preventing openrc "fixing" /etc/init.d/net.* files
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
haven
Tux's lil' helper
Tux's lil' helper


Joined: 19 Nov 2003
Posts: 141
Location: Belfast, Uk

PostPosted: Thu Jan 26, 2012 8:59 am    Post subject: [Solved] Preventing openrc "fixing" /etc/init.d/ne Reply with quote

Hi All,

I've taken a look and cant' find this covered anywhere so apologies if it already has been.

Whenever the openrc package is updated it replaces any custom /etc/init.d/net.* files with symlinks to net.lo.

Given I have some net devices that I do not want to provide net as a service I keep having to remove these symlinks and copy net.lo back in place and repeat my edits.

What is the best way to prevent openrc from replacing these files automatically ? (I've tried CONFIG_PROTECT in /etc/make.conf and that has not helped unfortunately)

Thanks.


Last edited by haven on Wed Feb 01, 2012 1:36 pm; edited 1 time in total
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9527
Location: beyond the rim

PostPosted: Thu Jan 26, 2012 11:38 am    Post subject: Reply with quote

Two possible workarounds:
- if /etc is on a ext[234] filesystem use chattr +i to make the files immutable so no process can modify/delete them anymore, including root, without explicitly resetting the flag first. At the moment the openrc ebuild ignores errors when trying to replace the files, so this should work, but in the future the ebuild might check for errors and abort the merge process.
- when the openrc ebuild replaces the files with links it creates a backup first (see elog messages), so a simple post_pkg_preinst hook in /etc/portage/bashrc could restore them
Back to top
View user's profile Send private message
Christian99
Veteran
Veteran


Joined: 28 May 2009
Posts: 1668

PostPosted: Thu Jan 26, 2012 12:07 pm    Post subject: Reply with quote

what about "/etc/rc.conf"? Something like
Code:
rc_net_eth0_provide="!net"
could do the trick
Back to top
View user's profile Send private message
haven
Tux's lil' helper
Tux's lil' helper


Joined: 19 Nov 2003
Posts: 141
Location: Belfast, Uk

PostPosted: Thu Jan 26, 2012 2:10 pm    Post subject: Reply with quote

Thanks Guys,

I'll give Christian99's option a go and see how well that works on a reboot.

Regards
Back to top
View user's profile Send private message
haven
Tux's lil' helper
Tux's lil' helper


Joined: 19 Nov 2003
Posts: 141
Location: Belfast, Uk

PostPosted: Wed Feb 01, 2012 1:36 pm    Post subject: Reply with quote

That worked a treat thanks. I'll update this to solved.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum