hostname/hostname-rh.patch

123 lines
4.0 KiB
Diff
Raw Normal View History

2010-02-02 10:47:27 +00:00
diff -up hostname/hostname.1.rh hostname/hostname.1
2011-12-29 11:21:33 +00:00
--- hostname/hostname.1.rh 2011-12-28 15:13:29.000000000 +0100
2012-01-18 08:42:23 +00:00
+++ hostname/hostname.1 2012-01-18 09:31:41.331071688 +0100
@@ -98,6 +98,33 @@ 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
+.IR /etc/sysconfig/network
+or
+.IR /etc/hosts
+
+To add another dimension to this,
+the
+.B hostname
+is also set when the network interface is brought up.
+
.SS "SET NAME"
When called with one argument or with the
.B \-\-file
2010-02-02 10:47:27 +00:00
@@ -113,7 +140,7 @@ and
use
2009-12-08 08:20:09 +00:00
.BR setdomainname (2).
2010-02-02 10:47:27 +00:00
Note, that this is effective only until the next reboot.
2009-12-08 08:20:09 +00:00
-Edit /etc/hostname for permanent change.
+After reboot original names from \fI/etc/hosts\fR are used again.
.LP
Note, that only the super-user can change the names.
.LP
2010-02-02 10:47:27 +00:00
@@ -124,10 +151,10 @@ command (see
2009-12-08 08:20:09 +00:00
below).
.LP
The host name is usually set once at system startup in
-.I /etc/init.d/hostname.sh
+.I /etc/rc.d/rc.sysinit
(normally by reading the contents of a file which contains
the host name, e.g.
-.IR /etc/hostname ).
+.IR /etc/sysconfig/network ).
.SS THE FQDN
You can't change the FQDN (as returned by
2011-12-29 11:21:33 +00:00
@@ -221,7 +248,7 @@ order of the output.
Display the short host name. This is the host name cut at the first dot.
2009-12-08 08:20:09 +00:00
.TP
.I "\-v, \-\-verbose"
-Be verbose and tell what's going on.
+Verbose output was removed.
.TP
2011-12-29 11:21:33 +00:00
.I "\-V, \-\-version"
Print version information on standard output and exit successfully.
2011-12-24 08:21:52 +00:00
@@ -246,9 +273,7 @@ option in
2009-12-08 08:20:09 +00:00
.SH FILES
.B /etc/hosts
2010-02-02 10:47:27 +00:00
2009-12-08 08:20:09 +00:00
-.B /etc/hostname
2011-12-24 08:21:52 +00:00
-Historically this file was supposed to only contain the hostname and not the
-full canonical FQDN. Nowadays most software is able to cope with a full FQDN here.
2009-12-08 08:20:09 +00:00
+.B /etc/sysconfig/network
.SH AUTHORS
Peter Tobias, <tobias@et-inf.fho-emden.de>
.br
2010-02-02 10:47:27 +00:00
diff -up hostname/Makefile.rh hostname/Makefile
2012-01-18 08:42:23 +00:00
--- hostname/Makefile.rh 2012-01-15 13:50:32.000000000 +0100
+++ hostname/Makefile 2012-01-18 09:33:28.244735083 +0100
2009-12-08 08:20:09 +00:00
@@ -7,26 +7,28 @@ OBJS=hostname.o
hostname: $(OBJS)
2012-01-18 08:42:23 +00:00
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS) -lnsl
2009-12-08 08:20:09 +00:00
- ln -fs hostname dnsdomainname
- ln -fs hostname domainname
- ln -fs hostname ypdomainname
- ln -fs hostname nisdomainname
install: hostname
install -d ${BASEDIR}/usr/share/man/man1
- install -o root -g root -m 0644 hostname.1 ${BASEDIR}/usr/share/man/man1
+ install -m 0644 hostname.1 ${BASEDIR}/usr/share/man/man1
2012-01-18 08:42:23 +00:00
+
2009-12-08 08:20:09 +00:00
ln -fs hostname.1 ${BASEDIR}/usr/share/man/man1/dnsdomainname.1
ln -fs hostname.1 ${BASEDIR}/usr/share/man/man1/domainname.1
ln -fs hostname.1 ${BASEDIR}/usr/share/man/man1/ypdomainname.1
ln -fs hostname.1 ${BASEDIR}/usr/share/man/man1/nisdomainname.1
- install -o root -g root -m 0644 hostname.1.fr ${BASEDIR}/usr/share/man/fr/man1/hostname.1
+ install -d ${BASEDIR}/usr/share/man/fr/man1
+ install -m 0644 hostname.1.fr ${BASEDIR}/usr/share/man/fr/man1/hostname.1
+ ln -fs hostname.1 ${BASEDIR}/usr/share/man/fr/man1/dnsdomainname.1
+ ln -fs hostname.1 ${BASEDIR}/usr/share/man/fr/man1/domainname.1
+ ln -fs hostname.1 ${BASEDIR}/usr/share/man/fr/man1/ypdomainname.1
+ ln -fs hostname.1 ${BASEDIR}/usr/share/man/fr/man1/nisdomainname.1
install -d ${BASEDIR}/bin
- install -o root -g root -m 0755 hostname ${BASEDIR}/bin
- ln -f hostname ${BASEDIR}/bin/dnsdomainname
- ln -f hostname ${BASEDIR}/bin/domainname
- ln -f hostname ${BASEDIR}/bin/nisdomainname
- ln -f hostname ${BASEDIR}/bin/ypdomainname
+ install -m 0755 hostname ${BASEDIR}/bin
+ ln -fs hostname ${BASEDIR}/bin/dnsdomainname
+ ln -fs hostname ${BASEDIR}/bin/domainname
+ ln -fs hostname ${BASEDIR}/bin/nisdomainname
+ ln -fs hostname ${BASEDIR}/bin/ypdomainname
clean:
-rm -f $(OBJS) hostname dnsdomainname domainname nisdomainname ypdomainname