]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/patches/hostname-rh.patch
hostname: New package.
[people/teissler/ipfire-2.x.git] / src / patches / hostname-rh.patch
1 diff -up hostname/Makefile.rh hostname/Makefile
2 --- hostname/Makefile.rh 2013-11-04 10:12:59.670379153 +0100
3 +++ hostname/Makefile 2013-11-04 10:15:04.957314495 +0100
4 @@ -10,21 +10,17 @@ OBJS=hostname.o
5
6 hostname: $(OBJS)
7 $(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS) -lnsl
8 - ln -fs hostname dnsdomainname
9 - ln -fs hostname domainname
10 - ln -fs hostname ypdomainname
11 - ln -fs hostname nisdomainname
12
13 install: hostname
14 install -d ${BASEDIR}$(MANDIR)/man1
15 - install -o root -g root -m 0644 hostname.1 ${BASEDIR}$(MANDIR)/man1
16 + install -m 0644 hostname.1 ${BASEDIR}$(MANDIR)/man1
17 ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/dnsdomainname.1
18 ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/domainname.1
19 ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/ypdomainname.1
20 ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/nisdomainname.1
21
22 install -d ${BASEDIR}$(BINDIR)
23 - install -o root -g root -m 0755 hostname ${BASEDIR}$(BINDIR)
24 + install -m 0755 hostname ${BASEDIR}$(BINDIR)
25 ln -fs hostname ${BASEDIR}$(BINDIR)/dnsdomainname
26 ln -fs hostname ${BASEDIR}$(BINDIR)/domainname
27 ln -fs hostname ${BASEDIR}$(BINDIR)/nisdomainname
28 diff -up hostname/hostname.1.rh hostname/hostname.1
29 --- hostname/hostname.1.rh 2013-11-03 15:24:23.000000000 +0100
30 +++ hostname/hostname.1 2013-11-04 10:12:59.670379153 +0100
31 @@ -80,6 +80,28 @@ complete FQDN of the system is returned
32 .B "THE FQDN"
33 below).
34
35 +.LP
36 +The function
37 +.BR gethostname(2)
38 +is used to get the hostname. When the
39 +.BR "hostname \-a, \-d, \-f or \-i"
40 +is called will
41 +.BR gethostbyname(3)
42 +be called. The difference in
43 +.BR gethostname(2)
44 +and
45 +.BR gethostbyname(3)
46 +is that
47 +.BR gethostbyname(3)
48 +is network aware, so it consults
49 +.IR /etc/nsswitch.conf
50 +and
51 +.IR /etc/host.conf
52 +to decide whether to read information in
53 +.IR /etc/hostname
54 +or
55 +.IR /etc/hosts
56 +
57 .SS "SET NAME"
58 When called with one argument or with the
59 .B \-\-file
60 @@ -105,8 +127,7 @@ command (see
61 .B "THE FQDN"
62 below).
63 .LP
64 -The host name is usually set once at system startup in
65 -.I /etc/init.d/hostname.sh
66 +The host name is usually set once at system startup
67 (normally by reading the contents of a file which contains
68 the host name, e.g.
69 .IR /etc/hostname ).