View previous topic :: View next topic |
Author |
Message |
ccgllc n00b
Joined: 21 Jul 2018 Posts: 27 Location: NE Missouri
|
Posted: Wed Oct 31, 2018 6:51 pm Post subject: # Generated by net-scripts for interface lo - but static ip! |
|
|
Hi all -
Have a weird thing happening on a fairly newly installed box (about 30 days ago, lite usage).
Every time I reboot, my resolv.conf is being re-written. I understand this is normal behavior if I was running a dhcp client, but I'm not!
Code: | avalon ~ # cat /etc/conf.d/net
dns_domain_lo="slan.carpenter-farms.us"
config_eth0="172.16.4.15 netmask 255.255.252.0"
routes_eth0="default via 172.16.4.1" |
Code: | avalon /etc/init.d # ls
agetty hostname mysql-s6 root
apache2 hwclock mysql-supervise rsyncd
binfmt iptables net-online runsvdir
bootmisc keymaps net.eth0 s6-svscan
busybox-ntpd killprocs net.lo savecache
busybox-watchdog kmod-static-nodes netmount sshd
cgroups local nullmailer swap
consolefont localmount numlock swclock
cronie loopback opentmpfiles-dev sysctl
devfs lvm opentmpfiles-setup sysfs
device-mapper lvm-monitoring osclock sysklogd
dmesg lvmetad procfs termencoding
dmeventd modules pydoc-2.7 udev
fsck mount-ro pydoc-3.6 udev-settle
functions.sh mtab redis udev-trigger
git-daemon mysql redis-sentinel urandom
|
Code: | avalon /etc/runlevels/default # ls
apache2 local mysql net.eth0 netmount redis rsyncd sshd sysklogd
|
Note the system boots just fine and assigns the static address.
I know I'm getting old, but what am I missing? Been using Gentoo since at least the 2.2 kernel, first time I've seen this.
System is about 35 days out of sync, fixing that now. _________________ Linux since 0.96 kernel on a 4 floppy slackware distribution |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9679 Location: almost Mile High in the USA
|
Posted: Wed Oct 31, 2018 8:23 pm Post subject: |
|
|
Yeah I think openrc will muck with your resolv.conf on startup, because you can specify your dns servers in /etc/conf.d/net by setting
Code: | dns_servers_YOURINTERFACE="8.8.8.8" |
Is there something you wish not to be removed? Perhaps we can find a way to make openrc generate the right resolv.conf each reboot. _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
ccgllc n00b
Joined: 21 Jul 2018 Posts: 27 Location: NE Missouri
|
Posted: Wed Oct 31, 2018 8:38 pm Post subject: |
|
|
eccerr0r wrote: | Yeah I think openrc will muck with your resolv.conf on startup, because you can specify your dns servers in /etc/conf.d/net by setting
Code: | dns_servers_YOURINTERFACE="8.8.8.8" |
Is there something you wish not to be removed? Perhaps we can find a way to make openrc generate the right resolv.conf each reboot. |
Since the box is statically linked, I'd prefer if it didn't remove anything, which is the way it worked for years.
Otherwise, I'll need a way to set not just the dns_servers, but other resolve.conf records such as "search". End result will hopefully look like:
Code: |
domain slan.carpenter-farms.us
search lan.carpenter-farms.us carpenter-farms.us
nameserver 172.16.4.2
nameserver 8.8.8.8
nameserver 8.8.4.4
|
I have dozens of gentoo based servers (and dozens more created over the years), this is the only one I'm seeing this behavior with.
Thanks! _________________ Linux since 0.96 kernel on a 4 floppy slackware distribution |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9679 Location: almost Mile High in the USA
|
Posted: Wed Oct 31, 2018 8:59 pm Post subject: |
|
|
Something like this should do, though you may need to add interface name...
Code: | dns_servers="172.16.4.2 8.8.8.8 8.8.4.4"
dns_search="lan.carpenter-farms.us carpenter-farms.us"
dns_domain="slan.carpenter-farms.us" |
_________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
ccgllc n00b
Joined: 21 Jul 2018 Posts: 27 Location: NE Missouri
|
Posted: Wed Oct 31, 2018 9:47 pm Post subject: |
|
|
This worked, but honestly seems completely redundant with just leaving the original file alone and letting DHCPD modify it if its running. I'm struggling to think of anything else that modifies configuration files in /etc at boot time.
Code: | dns_domain_lo="slan.carpenter-farms.us"
dns_servers_lo="172.16.4.2 8.8.8.8 8.8.4.4"
dns_search_lo="lan.carpenter-farms.us carpenter-farms.us"
config_eth0="172.16.4.15 netmask 255.255.252.0"
routes_eth0="default via 172.16.4.1"
|
In any case, thanks for your help! _________________ Linux since 0.96 kernel on a 4 floppy slackware distribution |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9679 Location: almost Mile High in the USA
|
Posted: Wed Oct 31, 2018 11:09 pm Post subject: |
|
|
Well, have to go with the flow or fight it, but if you choose the latter, you're on your own... Some people start using workarounds (/etc/resolve.conf.head, /etc/resolv.conf.tail) to get around it, and yet others esoteric methods to prevent it (immutable flag.)
I wouldn't call it totally "redundant" but rather keeping all configuration in one spot. Advantages and disadvantages to everything as usual. _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21633
|
Posted: Thu Nov 01, 2018 1:04 am Post subject: |
|
|
According to the documentation, you caused this by defining DNS parameters for interface lo. If you remove all DNS related parameters from /etc/conf.d/net, it should cease rewriting /etc/resolv.conf. net.example.bz2: | # System
# For configuring system specifics such as domain, dns, ntp and nis servers
# It's rare that you would need todo this, but you can anyway.
# If you omit the _eth0 suffix, then it applies to all interfaces unless
# overridden by the interface suffix.
#dns_domain_eth0="your.domain"
#dns_servers_eth0="192.168.0.2 192.168.0.3"
#dns_search_eth0="this.domain that.domain"
#dns_options_eth0="timeout:1 rotate"
#dns_sortlist_eth0="130.155.160.0/255.255.240.0 130.155.0.0"
# See the man page for resolv.conf for details about the options and sortlist
# directives
# NOTE: Setting any of these will stamp on the files in question. So if you
# don't specify dns_servers but you do specify dns_domain then no nameservers
# will be listed in /etc/resolv.conf even if there were any there to start
# with. |
|
|
Back to top |
|
|
ccgllc n00b
Joined: 21 Jul 2018 Posts: 27 Location: NE Missouri
|
Posted: Thu Nov 01, 2018 12:14 pm Post subject: |
|
|
Fair enough, just find it odd that this is behaving this way on only one of my dozen Gentoo systems.
Creating the dns_domain_lo record is part of the Gentoo AMD Handbook, which I always follow:
Code: | root #nano -w /etc/conf.d/net
# Set the dns_domain_lo variable to the selected domain name
dns_domain_lo="homenetwork" |
If this is standard behavior, I'd expect the DNS server setting should be added to the handbook.
Regarding keeping all configurations in one place... that is what /etc is for. We don't configure NTP in /etc/conf.d, we don't configure Rsync in /etc/conf.d, we don't configure Bind in /etc/conf.d, we don't configure fstab in /etc/conf.d... _________________ Linux since 0.96 kernel on a 4 floppy slackware distribution |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9679 Location: almost Mile High in the USA
|
Posted: Thu Nov 01, 2018 1:46 pm Post subject: |
|
|
However this is all network related... It is frustrating that you configure the IP address and the networking still doesn't work because no resolutions go through. Come to think of it, the default route is typically set up with a different command, and in the olden days usually a different file... and now openrc tries to consolidate that.
Dang,.. I've forgotten what file default routes used to be stored in. Now I only remember how to actually override it by command line... _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
ccgllc n00b
Joined: 21 Jul 2018 Posts: 27 Location: NE Missouri
|
Posted: Thu Nov 01, 2018 1:56 pm Post subject: |
|
|
eccerr0r wrote: | However this is all network related... It is frustrating that you configure the IP address and the networking still doesn't work because no resolutions go through. Come to think of it, the default route is typically set up with a different command, and in the olden days usually a different file... and now openrc tries to consolidate that.
Dang,.. I've forgotten what file default routes used to be stored in. Now I only remember how to actually override it by command line... |
That has been in /etc/conf.d/net for several years now. _________________ Linux since 0.96 kernel on a 4 floppy slackware distribution |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9679 Location: almost Mile High in the USA
|
Posted: Thu Nov 01, 2018 2:02 pm Post subject: |
|
|
But ask about other distributions...it's not consistent. They have historically been placed in different files. OpenRC got a better solution IMHO. _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21633
|
Posted: Fri Nov 02, 2018 1:54 am Post subject: |
|
|
ccgllc wrote: | Fair enough, just find it odd that this is behaving this way on only one of my dozen Gentoo systems. | Are all those systems statically addressed? If dhcp is also in use on those other systems, it would replace the forced entries with information from the DHCP server. |
|
Back to top |
|
|
|