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