Bug 32445

Summary: incorrect installation of localhost's domain causes long resolving when running programs
Product: Regular Reporter: Ivan Zakharyaschev <imz>
Component: wmakerAssignee: Michael Shigorin <mike>
Status: NEW --- QA Contact: Andrey Cherepanov <cas>
Severity: major    
Priority: P3 CC: sem
Version: не указана   
Hardware: all   
OS: Linux   

Description Ivan Zakharyaschev 2016-08-28 16:38:31 MSK
basealt-p8-wmaker-20160612-x86_64.iso
emacs24-nox-24.5-alt16

I've noticed that after the installation of the system, some programs have a very long startup time. (For example, emacs24-nox starts almost eternally; I suspect that the long startup of syslogd may be also related.)

The reason was that it tried to resolve the host's FQDN sending the queries many times.

The reason is:

$ cat etc/sysconfig/network 
# When set to no, this may cause most daemons' initscripts skip starting.
NETWORKING=yes

# Used by hotplug/pcmcia/ifplugd scripts to detect current network config
# subsystem.
CONFMETHOD=etcnet

# Used by rc.sysinit to setup system hostname at boot.
HOSTNAME=comp-sempron-processor-266d91
DOMAINNAME=localdomain

# This is used by ALTLinux ppp-common to decide if we want to install
# nameserver lines into /etc/resolv.conf or not.
RESOLV_MODS=yes
$ 

Actually, f we want to install
# nameserver lines into /etc/resolv.conf or not.
RESOLV_MODS=yes
$ 

Actually, DOMAINNAMEinto /etc/resolv.conf or not.
RESOLV_MODS=yes
$ 

Actually, f we want to install
# nameserver lines into /etc/resolv.conf or not.
RESOLV_MODS=yes
$ 

Actually, DOMAINNAME is not used.

[user@test ~]$ fgrep DOMAINNAME -r /etc/rc.d /etc/net
[user@test ~]$ fgrep HOSTNAME -r /etc/rc.d /etc/net
/etc/rc.d/init.d/local: echo "Welcome to $HOSTNAME" >/etc/issue.net
/etc/rc.d/rc.sysinit:HOSTNAME=`hostname`
/etc/rc.d/rc.sysinit:if [ -x "$RESOLVE_HOSTNAME_COMMAND" ]; then
/etc/rc.d/rc.sysinit:   HOSTNAME="$("$RESOLVE_HOSTNAME_COMMAND")"
/etc/rc.d/rc.sysinit:if [ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" ]; then
/etc/rc.d/rc.sysinit:   HOSTNAME=localhost
/etc/rc.d/rc.sysinit:action "Setting hostname $HOSTNAME:" hostname "$HOSTNAME"
/etc/rc.d/rc.sysinit:   [ "$(readlink /etc/HOSTNAME)" = /proc/sys/kernel/hostname ] ||
/etc/rc.d/rc.sysinit:           ln -snf /proc/sys/kernel/hostname /etc/HOSTNAME
/etc/net/scripts/functions-ip:                  if [ -n "$DHCP_HOSTNAME" ]; then
/etc/net/scripts/functions-ip:                          case "$DHCP_HOSTNAME" in
/etc/net/scripts/functions-ip:                                          print_warning "AUTO in DHCP_HOSTNAME is no longer supported."
/etc/net/scripts/functions-ip:                                          [ -n "$HOSTNAME" -a "$HOSTNAME" != "localhost" -a "$HOSTNAME" != "localhost.localdomain" ] && \
/etc/net/scripts/functions-ip:                                          H="-h $HOSTNAME"
/etc/net/scripts/functions-ip:                                          H="-h $DHCP_HOSTNAME"
/etc/net/scripts/functions-ip:                  if [ -n "$DHCP_HOSTNAME" ]; then
/etc/net/scripts/functions-ip:                          case "$DHCP_HOSTNAME" in
/etc/net/scripts/functions-ip:                                          [ -n "$HOSTNAME" -a "$HOSTNAME" != "localhost" -a "$HOSTNAME" != "localhost.localdomain" ] && \
/etc/net/scripts/functions-ip:                                          H="-F $HOSTNAME"
/etc/net/scripts/functions-ip:                                          H="-H $DHCP_HOSTNAME"
/etc/net/scripts/functions:     elif [ -s "$HOSTTAB" ] && grep "^$HOSTNAME " $HOSTTAB; then
/etc/net/scripts/functions:             NETHOST=`$DENOISE $HOSTTAB | trim | grep -m 1 "^$HOSTNAME " | cut -d' ' -f2`
/etc/net/scripts/functions:             NETHOST=$HOSTNAME
/etc/net/options.d/50-ALTLinux-server:DHCP_HOSTNAME=localhost
[user@test ~]$ 

Then, I ran alterator, and changed the hostname there. The correct way to configure it is as by alterator:

$ cat /etc/sysconfig/network 
# When set to no, this may cause most daemons' initscripts skip starting.
NETWORKING=yes

# Used by hotplug/pcmcia/ifplugd scripts to detect current network config
# subsystem.
CONFMETHOD=etcnet

# Used by rc.sysinit to setup system hostname at boot.
HOSTNAME=test.localdomain

# This is used by ALTLinux ppp-common to decide if we want to install
# nameserver lines into /etc/resolv.conf or not.
RESOLV_MODS=yes
[user@test ~]$ 

(Now, emacs starts quickly.)
Comment 1 Ivan Zakharyaschev 2016-08-30 16:21:53 MSK
BTW, initially, the packaged file is good:


$ rpmpeek /ALT/Sisyphus/noarch/RPMS.classic/etcnet-0.9.10-alt18.noarch.rpm cat etc/sysconfig/network
# When set to no, this may cause most daemons' initscripts skip starting.
NETWORKING=yes

# Used by hotplug/pcmcia/ifplugd scripts to detect current network config
# subsystem.
CONFMETHOD=etcnet

# Used by rc.sysinit to setup system hostname at boot.
HOSTNAME=localhost.localdomain
DOMAINNAME=localdomain

# This is used by ALTLinux ppp-common to decide if we want to install
# nameserver lines into /etc/resolv.conf or not.
RESOLV_MODS=yes

But somehow after installer's work, the domain is lost from HOSTNAME.