hostname/hostname-rh.patch

87 lines
2.7 KiB
Diff
Raw Normal View History

2010-02-02 10:47:27 +00:00
diff -up hostname/hostname.1.rh hostname/hostname.1
--- hostname/hostname.1.rh 2012-12-06 16:18:46.000000000 +0100
2013-03-26 11:43:15 +00:00
+++ hostname/hostname.1 2013-03-26 12:39:24.303468313 +0100
@@ -84,6 +84,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
+.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
@@ -109,8 +131,7 @@ command (see
.B "THE FQDN"
2009-12-08 08:20:09 +00:00
below).
.LP
-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
+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.
.IR /etc/hostname ).
2010-02-02 10:47:27 +00:00
diff -up hostname/Makefile.rh hostname/Makefile
2012-02-21 18:23:38 +00:00
--- hostname/Makefile.rh 2012-02-16 16:00:52.000000000 +0100
2013-03-26 11:43:15 +00:00
+++ hostname/Makefile 2013-03-26 12:39:24.303468313 +0100
@@ -3,30 +3,29 @@ CFLAGS+=-O2 -Wall
# uncomment the following line if you want to install to a different base dir.
#BASEDIR=/mnt/test
+BINDIR:=/bin
+
OBJS=hostname.o
2009-12-08 08:20:09 +00:00
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
2012-02-21 18:23:38 +00:00
#install -o root -g root -m 0644 hostname.1.fr ${BASEDIR}/usr/share/man/fr/man1/hostname.1
2009-12-08 08:20:09 +00:00
- install -d ${BASEDIR}/bin
2009-12-08 08:20:09 +00:00
- 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 -d ${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
+ ln -fs hostname ${BASEDIR}$(BINDIR)/ypdomainname
2009-12-08 08:20:09 +00:00
clean:
-rm -f $(OBJS) hostname dnsdomainname domainname nisdomainname ypdomainname