From bf59d8ce3b485acce381c7a1a4596b9124e3cb25 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 09 2020 16:10:36 +0000 Subject: Apply patch hostname-rh.patch patch_name: hostname-rh.patch present_in_specfile: true --- diff --git a/Makefile b/Makefile index c473641..1b7ee77 100644 --- a/Makefile +++ b/Makefile @@ -17,14 +17,14 @@ hostname: $(OBJS) install: hostname install -d ${BASEDIR}$(MANDIR)/man1 - install -o root -g root -m 0644 hostname.1 ${BASEDIR}$(MANDIR)/man1 + install -m 0644 hostname.1 ${BASEDIR}$(MANDIR)/man1 ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/dnsdomainname.1 ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/domainname.1 ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/ypdomainname.1 ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/nisdomainname.1 install -d ${BASEDIR}$(BINDIR) - install -o root -g root -m 0755 hostname ${BASEDIR}$(BINDIR) + install -m 0755 hostname ${BASEDIR}$(BINDIR) ln -fs hostname ${BASEDIR}$(BINDIR)/dnsdomainname ln -fs hostname ${BASEDIR}$(BINDIR)/domainname ln -fs hostname ${BASEDIR}$(BINDIR)/nisdomainname diff --git a/hostname.1 b/hostname.1 index 5e345e7..86c7a3f 100644 --- a/hostname.1 +++ b/hostname.1 @@ -80,6 +80,28 @@ complete FQDN of the system is returned with .B "THE FQDN" below). +.LP +The function +.BR gethostname(2) +is used to get the hostname. When the +.BR "hostname \-a, \-d, \-f or \-i" +is called will +.BR gethostbyname(3) +be called. The difference in +.BR gethostname(2) +and +.BR gethostbyname(3) +is that +.BR gethostbyname(3) +is network aware, so it consults +.IR /etc/nsswitch.conf +and +.IR /etc/host.conf +to decide whether to read information in +.IR /etc/hostname +or +.IR /etc/hosts + .SS "SET NAME" When called with one argument or with the .B \-\-file @@ -105,8 +127,7 @@ command (see .B "THE FQDN" below). .LP -The host name is usually set once at system startup in -.I /etc/init.d/hostname.sh +The host name is usually set once at system startup (normally by reading the contents of a file which contains the host name, e.g. .IR /etc/hostname ).