2013-11-04 09:22:52 +00:00
|
|
|
diff -up hostname/Makefile.rh hostname/Makefile
|
|
|
|
--- hostname/Makefile.rh 2013-11-04 10:12:59.670379153 +0100
|
|
|
|
+++ hostname/Makefile 2013-11-04 10:15:04.957314495 +0100
|
|
|
|
@@ -10,21 +10,17 @@ OBJS=hostname.o
|
|
|
|
|
|
|
|
hostname: $(OBJS)
|
|
|
|
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS) -lnsl
|
|
|
|
- ln -fs hostname dnsdomainname
|
|
|
|
- ln -fs hostname domainname
|
|
|
|
- ln -fs hostname ypdomainname
|
|
|
|
- ln -fs hostname nisdomainname
|
|
|
|
|
|
|
|
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
|
2010-02-02 10:47:27 +00:00
|
|
|
diff -up hostname/hostname.1.rh hostname/hostname.1
|
2013-11-04 09:22:52 +00:00
|
|
|
--- hostname/hostname.1.rh 2013-11-03 15:24:23.000000000 +0100
|
|
|
|
+++ hostname/hostname.1 2013-11-04 10:12:59.670379153 +0100
|
2013-09-08 18:08:35 +00:00
|
|
|
@@ -80,6 +80,28 @@ complete FQDN of the system is returned
|
2010-02-02 10:47:27 +00:00
|
|
|
.B "THE FQDN"
|
|
|
|
below).
|
2009-12-08 08:20:09 +00:00
|
|
|
|
|
|
|
+.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
|
2012-11-30 09:57:23 +00:00
|
|
|
+.IR /etc/hostname
|
2009-12-08 08:20:09 +00:00
|
|
|
+or
|
|
|
|
+.IR /etc/hosts
|
|
|
|
+
|
|
|
|
.SS "SET NAME"
|
|
|
|
When called with one argument or with the
|
|
|
|
.B \-\-file
|
2013-09-08 18:08:35 +00:00
|
|
|
@@ -105,8 +127,7 @@ command (see
|
2012-11-30 09:57:23 +00:00
|
|
|
.B "THE FQDN"
|
2009-12-08 08:20:09 +00:00
|
|
|
below).
|
|
|
|
.LP
|
2012-11-30 09:57:23 +00:00
|
|
|
-The host name is usually set once at system startup in
|
2009-12-08 08:20:09 +00:00
|
|
|
-.I /etc/init.d/hostname.sh
|
2012-11-30 09:57:23 +00:00
|
|
|
+The host name is usually set once at system startup
|
2009-12-08 08:20:09 +00:00
|
|
|
(normally by reading the contents of a file which contains
|
|
|
|
the host name, e.g.
|
2012-11-30 09:57:23 +00:00
|
|
|
.IR /etc/hostname ).
|