1 | .TH GETCLUSTER 8 "3 July 1997" |
---|
2 | .SH NAME |
---|
3 | getcluster \- retrieve service cluster info from Hesiod as environment vars |
---|
4 | .SH SYNOPSIS |
---|
5 | .B getcluster |
---|
6 | [ |
---|
7 | .B \-b |
---|
8 | ] [ |
---|
9 | .B \-d |
---|
10 | ] [ |
---|
11 | .B -l local |
---|
12 | ] [ |
---|
13 | .B -f fallback |
---|
14 | ] hostname version |
---|
15 | .PP |
---|
16 | .SH DESCRIPTION |
---|
17 | .I Getcluster |
---|
18 | queries the Hesiod database for service cluster information associated |
---|
19 | with the workstation on which it is run. It writes a set of environment |
---|
20 | variable assignments on its standard output in a format acceptable |
---|
21 | to the C shell, or, if the |
---|
22 | .B \-b |
---|
23 | flag is present, in Bourne shell syntax. |
---|
24 | .I Getcluster |
---|
25 | returns an exit status of 2 if no cluster information is available, or |
---|
26 | 1 if any other error was encountered. |
---|
27 | .PP |
---|
28 | A cluster record contains between two and four fields: a |
---|
29 | variable name, a value, an optional version number, and an optional |
---|
30 | list of flags. The version number is a dotted pair giving the major |
---|
31 | and minor numbers of the Athena release to which the variable |
---|
32 | definition applies. Currently, the only defined flag is 't', |
---|
33 | indicating that the Athena release specified by the version is in |
---|
34 | testing. |
---|
35 | .PP |
---|
36 | If a fallback cluster information file is specified with the |
---|
37 | .B \-f |
---|
38 | flag, that file is read and the cluster records in it are considered |
---|
39 | lower priority than the Hesiod cluster records. For each variable |
---|
40 | name in the Hesiod cluster record, no record with the same variable |
---|
41 | name in the fallback file will be considered. Similarly, if a local |
---|
42 | cluster information file is specified with the |
---|
43 | .B \-l |
---|
44 | flag, that file is read and the cluster records in it are considered |
---|
45 | higher priority than the Hesiod cluster records and fallback cluster |
---|
46 | records. |
---|
47 | .PP |
---|
48 | .I Getcluster |
---|
49 | may discard a cluster record if it specifies a version which is |
---|
50 | higher than the current workstation version (as given by the |
---|
51 | .I version |
---|
52 | argument on the command line). A record with a new version is |
---|
53 | rejected if any of the following are true: |
---|
54 | .TP 3 |
---|
55 | 1. |
---|
56 | The environment variable |
---|
57 | .B AUTOUPDATE |
---|
58 | is not defined or has a value other than "true". |
---|
59 | .TP 3 |
---|
60 | 2. |
---|
61 | The record specifies the 't' flag. |
---|
62 | .TP 3 |
---|
63 | 3. |
---|
64 | The environment variable |
---|
65 | .B UPDATE_TIME |
---|
66 | is not defined or specifies a Unix time value greater than the current |
---|
67 | time. |
---|
68 | .PP |
---|
69 | After discarding records for the above reasons, |
---|
70 | .I getcluster |
---|
71 | outputs variable definitions for each of the variables mentioned in |
---|
72 | the remaining records. For each variable, |
---|
73 | .I getcluster |
---|
74 | selects the value given in the record with the highest version number, |
---|
75 | or uses a record with no version number if no records with version |
---|
76 | numbers are present. |
---|
77 | .PP |
---|
78 | .I Getcluster |
---|
79 | may also output three special variable definitions: |
---|
80 | .IP NEW_TESTING_RELEASE |
---|
81 | If any records were discarded because they contained the 't' flag and |
---|
82 | specified versions greater than the current workstation version, |
---|
83 | .B NEW_TESTING_RELEASE |
---|
84 | is set to the highest version number given in those records. |
---|
85 | .IP NEW_PRODUCTION_RELEASE |
---|
86 | If any records were discarded because they specified versions greater |
---|
87 | than the current workstation version and the |
---|
88 | .B AUTOUPDATE |
---|
89 | environment variable was not "true," |
---|
90 | .B NEW_PRODUCTION_RELEASE |
---|
91 | is set to the highest version number given in those records. |
---|
92 | .IP UPDATE_TIME |
---|
93 | If any records specified higher version numbers than the current |
---|
94 | workstation version and were not discarded for the first two reasons, |
---|
95 | .B UPDATE_TIME |
---|
96 | is set to a time at which the workstation should accept the new |
---|
97 | values. The value is taken from the current value in the environment |
---|
98 | if it is present; otherwise a random Unix time value between the |
---|
99 | current time and four hours in the future is chosen. The random |
---|
100 | number generator is seeded with the IP address given in the |
---|
101 | .B ADDR |
---|
102 | environment variable, or with a fixed value if none is specified. |
---|
103 | .PP |
---|
104 | If the |
---|
105 | .B \-d |
---|
106 | flag is present, |
---|
107 | .I getcluster |
---|
108 | will ignore the hostname argument and instead read lines from standard |
---|
109 | input, treating each line as if it were an entry in the Hesiod |
---|
110 | database for the host's cluster information. |
---|
111 | .PP |
---|
112 | .I Getcluster |
---|
113 | is usually invoked from |
---|
114 | .I save_cluster_info (8), |
---|
115 | which places its output in the files |
---|
116 | .I /var/athena/clusterinfo |
---|
117 | and |
---|
118 | .I /var/athena/clusterinfo.bsh |
---|
119 | to be accessed by the C shell in a user's .login file and the Bourne |
---|
120 | shell in a user's .profile, respectively. It may also be invoked |
---|
121 | directly by any user. |
---|
122 | .PP |
---|
123 | Getcluster uses the Hesiod type "cluster". |
---|
124 | .SH EXAMPLES |
---|
125 | # C shell example |
---|
126 | .br |
---|
127 | getcluster `hostname` 5.3 > file; source file |
---|
128 | .PP |
---|
129 | # Bourne shell example |
---|
130 | .br |
---|
131 | getcluster -b `hostname` 5.3 > file; . file |
---|
132 | .SH "SEE ALSO" |
---|
133 | `Hesiod - Project Athena Technical Plan -- Name Service', save_cluster_info(8) |
---|
134 | .SH AUTHOR |
---|
135 | Steve Dyer, IBM/Project Athena |
---|
136 | .br |
---|
137 | Greg Hudson, MIT Information Systems |
---|
138 | .br |
---|
139 | Copyright 1987, 1997, Massachusetts Institute of Technology |
---|
140 | .br |
---|
141 | .SH BUGS |
---|