|
|
5eaf7c |
diff -up hostname/Makefile.rh hostname/Makefile
|
|
|
5eaf7c |
--- hostname/Makefile.rh 2013-11-04 10:12:59.670379153 +0100
|
|
|
5eaf7c |
+++ hostname/Makefile 2013-11-04 10:15:04.957314495 +0100
|
|
|
5eaf7c |
@@ -17,14 +17,14 @@ OBJS=hostname.o
|
|
|
5eaf7c |
|
|
|
5eaf7c |
install: hostname
|
|
|
5eaf7c |
install -d ${BASEDIR}$(MANDIR)/man1
|
|
|
5eaf7c |
- install -o root -g root -m 0644 hostname.1 ${BASEDIR}$(MANDIR)/man1
|
|
|
5eaf7c |
+ install -m 0644 hostname.1 ${BASEDIR}$(MANDIR)/man1
|
|
|
5eaf7c |
ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/dnsdomainname.1
|
|
|
5eaf7c |
ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/domainname.1
|
|
|
5eaf7c |
ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/ypdomainname.1
|
|
|
5eaf7c |
ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/nisdomainname.1
|
|
|
5eaf7c |
|
|
|
5eaf7c |
install -d ${BASEDIR}$(BINDIR)
|
|
|
5eaf7c |
- install -o root -g root -m 0755 hostname ${BASEDIR}$(BINDIR)
|
|
|
5eaf7c |
+ install -m 0755 hostname ${BASEDIR}$(BINDIR)
|
|
|
5eaf7c |
ln -fs hostname ${BASEDIR}$(BINDIR)/dnsdomainname
|
|
|
5eaf7c |
ln -fs hostname ${BASEDIR}$(BINDIR)/domainname
|
|
|
5eaf7c |
ln -fs hostname ${BASEDIR}$(BINDIR)/nisdomainname
|
|
|
5eaf7c |
diff -up hostname/hostname.1.rh hostname/hostname.1
|
|
|
5eaf7c |
--- hostname/hostname.1.rh 2013-11-03 15:24:23.000000000 +0100
|
|
|
5eaf7c |
+++ hostname/hostname.1 2013-11-04 10:12:59.670379153 +0100
|
|
|
5eaf7c |
@@ -80,6 +80,28 @@ complete FQDN of the system is returned
|
|
|
5eaf7c |
.B THE FQDN
|
|
|
5eaf7c |
below).
|
|
|
5eaf7c |
|
|
|
5eaf7c |
+.LP
|
|
|
5eaf7c |
+The function
|
|
|
5eaf7c |
+.BR gethostname(2)
|
|
|
5eaf7c |
+is used to get the hostname. When the
|
|
|
5eaf7c |
+.BR "hostname \-a, \-d, \-f or \-i"
|
|
|
5eaf7c |
+is called will
|
|
|
5eaf7c |
+.BR gethostbyname(3)
|
|
|
5eaf7c |
+be called. The difference in
|
|
|
5eaf7c |
+.BR gethostname(2)
|
|
|
5eaf7c |
+and
|
|
|
5eaf7c |
+.BR gethostbyname(3)
|
|
|
5eaf7c |
+is that
|
|
|
5eaf7c |
+.BR gethostbyname(5)
|
|
|
5eaf7c |
+is network aware, so it consults
|
|
|
5eaf7c |
+.IR /etc/nsswitch.conf
|
|
|
5eaf7c |
+and
|
|
|
5eaf7c |
+.IR /etc/host.conf
|
|
|
5eaf7c |
+to decide whether to read information in
|
|
|
5eaf7c |
+.IR /etc/hostname
|
|
|
5eaf7c |
+or
|
|
|
5eaf7c |
+.IR /etc/hosts
|
|
|
5eaf7c |
+
|
|
|
5eaf7c |
.SS "SET NAME"
|
|
|
5eaf7c |
When called with one argument or with the
|
|
|
5eaf7c |
.B \-\-file
|
|
|
5eaf7c |
@@ -105,8 +127,7 @@ command (see
|
|
|
5eaf7c |
.B THE FQDN
|
|
|
5eaf7c |
below).
|
|
|
5eaf7c |
.LP
|
|
|
5eaf7c |
-The host name is usually set once at system startup in
|
|
|
5eaf7c |
-.I /etc/init.d/hostname.sh
|
|
|
5eaf7c |
+The host name is usually set once at system startup
|
|
|
5eaf7c |
(normally by reading the contents of a file which contains
|
|
|
5eaf7c |
the host name, e.g.
|
|
|
5eaf7c |
.IR /etc/hostname ).
|