1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
|
#!/bin/csh -f
#
# SYSINFO -- Display IRAF system diagnostic and configuration information.
#
# The intent of this program is to provide a means for IRAF site managers
# to troubleshoot their IRAF installations by running numerous verification
# tests on the iraf directory structure, networking setup, external package
# installations, tape configurations, etc. Failed tests are not always
# fatal but may indicate a problem in the way something was installed or
# configured.
#
# Usage: sysinfo [ -G | -V | -N | -P | -D | -T | -h ]
#
# where: -G Print General Info only"
# -V Do Verification tests only"
# -N Do Networking tests only"
# -P Do Extern Package tests only"
# -D Do Display tests only"
# -T Do Tape Device tests only"
# -h Print this message"
#
# ----------------------------------------------------------------------------
unset noclobber
unalias cd cp cmp echo ln mv rm sed set grep ls chmod chown pwd touch sort
unalias uniq head sed tr which
set path = ($path /sbin /usr/sbin /bin /usr/bin /usr/ucb /etc /usr/etc /usr/openwin/bin /usr/X11R6/bin /usr/X11/bin)
onintr sysinfo_cleanup
##############################################################################
# START OF MACHDEP DEFINITIONS.
##############################################################################
# MACHDEP definitions which may be reset below.
set hmach = "INDEF"
set pciraf = 0
set suniraf = 0
set do_tapecaps = 0
set hilite = 0
# Utility aliases.
alias BOLD_ON "(if ($hilite) tput bold)"
alias BOLD_OFF "(if ($hilite) tput sgr0)"
alias SO_ON "(if ($hilite) tput smso)"
alias SO_OFF "(if ($hilite) tput rms0)"
alias DO_OK "(echo -n '[ '; BOLD_ON; echo -n ' OK '; BOLD_OFF; echo ' ]')"
alias DO_WARN "(echo -n '[ '; BOLD_ON; echo -n 'WARN'; BOLD_OFF; echo ' ]')"
alias DO_FAIL "(echo -n '[ '; SO_ON; echo -n 'FAIL'; SO_OFF; echo ' ]')"
alias MSG "(echo -n ' ';BOLD_ON;echo -n '*** ';BOLD_OFF; echo \!*)"
alias MSGN "(echo -n ' ';BOLD_ON;echo -n '*** ';BOLD_OFF; echo -n \!*)"
alias MSGB "(echo -n ' ';BOLD_ON;echo -n '*** ';echo \!*; BOLD_OFF)"
alias MSGBN "(echo -n ' ';BOLD_ON;echo -n '*** ';echo -n \!*;BOLD_OFF)"
alias ERRMSG "(echo -n ' ';BOLD_ON;echo -n 'ERROR: ';BOLD_OFF; echo \!*)"
alias WARNING "(echo -n ' ';BOLD_ON;echo -n 'WARNING: ';BOLD_OFF; echo \!*)"
alias NEWLINE "(echo '')"
alias RM "rm -rf"
# Determine platform architecture.
set UNAME=""
if (-e /usr/bin/uname) then
set uname_cmd = /usr/bin/uname
set UNAME=`/usr/bin/uname | tr '[A-Z]' '[a-z]'`
else if (-e /bin/uname) then
set uname_cmd = /bin/uname
set UNAME=`/bin/uname | tr '[A-Z]' '[a-z]'`
else
WARNING "No 'uname' command found to determine architecture."
exit 1
endif
set pciraf = 0
set hmach = "INDEF"
switch ($UNAME)
case sunos:
if (`$uname_cmd -m | cut -c2-` != "86pc") then
setenv OSVERSION `uname -r | cut -c1`
if ($OSVERSION == 5) then # Sparc Solaris
set mach = "ssun"
set hmach = "ssol"
set TAPES = "/dev/rmt/[0-9]*"
set shlib = "no"
set LIBFILES = ""
set LS = "/usr/ucb/ls -s"
set LSDF = "-lLtg"
else # Sparc SunOS 4.x
set mach = "sparc"
set hmach = "sparc"
set TAPES = "/dev/*st[0-7]*"
set shlib = "no"
set LIBFILES = ""
set LS = "/bin/ls -s"
set LSDF = "-lLtg"
endif
else
set mach = "sunos" # Intel Solaris
set hmach = "sunos"
set TAPES = "/dev/*st[0-7]*"
set shlib = "no"
set LIBFILES = ""
set LS = "/bin/ls -s"
set LSDF = "-lLt"
set pciraf = 1
endif
breaksw
case linux:
if (`$uname_cmd -m` == "x86_64") then # Linux64
set mach = "linux64"
set hmach = "linux64"
set TAPES = "/dev/*st[0-7]"
set shlib = "no"
set LIBFILES = ""
set LS = "/bin/ls -s"
set LSDF = "-lLt"
else if (`$uname_cmd -m` == "ppc") then # LinuxPPC
set mach = "linuxppc"
set hmach = "linuxppc"
set TAPES = "/dev/*st[0-7]"
set shlib = "no"
set LIBFILES = ""
set LS = "/bin/ls -s"
set LSDF = "-lLt"
else
if (-f /etc/redhat-release) then # RedHat Linux
set mach = "redhat"
set hmach = "redhat"
set TAPES = "/dev/*st[0-7]"
set shlib = "no"
set LIBFILES = ""
set LS = "/bin/ls -s"
set LSDF = "-lLtg"
else # Other Linux
set mach = "linux"
set hmach = "linux"
set TAPES = "/dev/*st[0-7]"
set shlib = "no"
set LIBFILES = ""
set LS = "/bin/ls -s"
set LSDF = "-lLtg"
endif
endif
set pciraf = 1
breaksw
case darwin: # Mac OS X
case macosx:
case macintel:
if (`$uname_cmd -m` == "x86_64") then # 64-bit
set mach = "macintel"
set hmach = "macintel"
else
set mach = "macosx" # 32-bit
set hmach = "macosx"
endif
set TAPES = "/dev/*sa[0-7]"
set shlib = "no"
set LIBFILES = ""
set LS = "/bin/ls -s"
set LSDF = "-lLtg"
set pciraf = 1
breaksw
case freebsd: # FreeBSD
set mach = "freebsd"
set hmach = "freebsd"
set TAPES = "/dev/*sa[0-7]"
set shlib = "no"
set LIBFILES = ""
set LS = "/bin/ls -s"
set LSDF = "-lLtg"
set pciraf = 1
breaksw
case hp-ux: # HP/UX 10.20
set mach = "hp700"
set hmach = "hp700"
set TAPES = "/dev/rmt/[0-7]*"
set shlib = "no"
set LIBFILES = ""
set LS = "/bin/ls -s"
set LSDF = "-lLt"
breaksw
case irix: # SGI IRIX 6.5
case irix64:
set mach = "irix"
set hmach = "irix"
set TAPES = "/dev/tps[0-7]*"
set shlib = "no"
set LIBFILES = ""
set LS = "/bin/ls -s"
set LSDF = "-lLt"
breaksw
case aix: # IBM AIX V4
set mach = "rs6000"
set hmach = "rs6000"
set TAPES = "/dev/rmt[0-7]*"
set shlib = "no"
set LIBFILES = ""
set LS = "/bin/ls -s"
set LSDF = "-lLtg"
breaksw
case osf1: # Alpha Tru64
set mach = "alpha"
set hmach = "alpha"
set TAPES = "/dev/nrmt[0-7]* /dev/rmt[0-7]*"
set shlib = "yes"
set LIBFILES = "libiraf.so"
set LS = "/bin/ls -s"
set LSDF = "-lLtg"
breaksw
case ultrix: # DEC Ultrix
set mach = "ultrix"
set hmach = "ultrix"
set TAPES = "/dev/[n]rmt[0-7]*"
set shlib = "no"
set LIBFILES = ""
set LS = "/bin/ls -s"
set LSDF = "-lLtg"
breaksw
default:
# We don't want to be limited by the CYGWIN version numbering so
# look for a truncated match here before punting.
set os_mach = `echo $UNAME | cut -c1-6`
if ("$os_mach" == "cygwin") then
set mach = "cygwin"
set hmach = "cygwin"
set shlib = "no"
set LIBFILES = ""
set TAPES = "" # no tape support
set do_tapecaps = 0
set do_tapes = 0
set do_pipes = 0
breaksw
else
ERRMSG "Unable to determine platform architecture. Please"
ERRMSG "contact the forums at http://forums.iraf.net"
NEWLINE
exit 1
else
endsw
###################### END OF MACHDEP DEFINITIONS. ########################
#=============================================================================
# Initializations.
#=============================================================================
set errstat = 0 # initialize status counters
set ok_count = 0
set err_count = 0
set warn_count = 0
set defstat = " OK "
#=============================================================================
# Process any command line arguments.
#=============================================================================
set early_exit = 0
set general = 0
set severe = 0
while ("$1" != "")
switch ("$1")
case -G: # Output General Info only
set general = 1
set early_exit = 1
goto General
breaksw
case -V: # Verification Test Only
set early_exit = 1
breaksw
case -N: # Test Networking Only
set early_exit = 1
goto Networking
breaksw
case -P: # Test Packages Only
set early_exit = 1
goto External_Packages
breaksw
case -D: # Test Display Only
set early_exit = 1
goto Image_Display
breaksw
case -T: # Test Tapes Only
set early_exit = 1
goto Tape_Device
breaksw
case -hl: # disable highlighting
NEWLINE
echo "WARNING: Highlighting is not permitted by this script, ignoring."
NEWLINE
breaksw
case +hl: # enable highlighting
NEWLINE
echo "WARNING: Highlighting is not permitted by this script, ignoring."
NEWLINE
breaksw
case -help:
case -h:
goto Usage
default:
ERRMSG "SYSINFO: unknown argument $1"
goto Usage
endsw
if ("$2" == "") then
break
else
shift
endif
end
#=============================================================================
# General Information
#=============================================================================
General:
NEWLINE
BOLD_ON
echo " General Information"
echo " ==================="
BOLD_OFF
NEWLINE
# Document the system information.
echo "Host name: "`hostname`
echo "Operating System: "`uname -a`
echo "Architecture: "$mach
echo "HSI architecture: "$hmach
if ($pciraf && -e /etc/issue) then
set issue = `cat /etc/issue`
NEWLINE
echo "PC Issue: " $issue
endif
NEWLINE
# Check the iraf root directory stuff
echo -n "IRAF environment path: "
if ($?iraf == 1) then
set env_iraf = $iraf
echo "$iraf"
else
set env_iraf = ""
echo "<undefined>"
endif
echo -n "Checking for <iraf.h> "
if (-e /usr/include/iraf.h) then
NEWLINE
echo -n " IRAF path: "
set ip = `grep "^#define IRAF" /usr/include/iraf.h | sed -e 's/\"//g'`
if ("$ip" != "") then
echo $ip[3]
set irafh_iraf = $ip[3]
else
echo "not found"
endif
echo -n " HOST path: "
set ip = `grep "^#define HOST" /usr/include/iraf.h | sed -e 's/\"//g'`
if ("$ip" != "") then
echo $ip[3]
else
echo "not found"
endif
echo -n " TMP path: "
set ip = `grep "^#define TMP" /usr/include/iraf.h | sed -e 's/\"//g'`
if ("$ip" != "") then
echo $ip[3]
else
echo "not found"
endif
else
echo " not found"
NEWLINE
echo " *** The file /usr/include/iraf.h was not found on this system"
echo " *** which means the install script was not run on this machine."
if ("$env_iraf" != "") then
echo " *** Using environment definition: $env_iraf"
endif
NEWLINE
set irafh_iraf = ""
endif
if ("$env_iraf" != "" && "$irafh_iraf" != "") then
if ("$env_iraf" != "$irafh_iraf") then
NEWLINE
echo "WARNING: iraf environment and <iraf.h> root directories differ."
# First make sure we have a valid path.
if ( !(-e $env_iraf/unix/hlib/zzsetenv.def)) then
MSG "Environment definition looks incorrect."
MSG "Using <iraf.h> definition '$irafh_iraf'"
# Strip off any trailing '/'.
set iraf = `echo $irafh_iraf | sed -e 's+/\(["]*\)$+\1+'`
else if ( !(-e $irafh_iraf/unix/hlib/zzsetenv.def)) then
MSG "<iraf.h> definition looks incorrect."
MSG "Using environment definition '$env_iraf'"
# Strip off any trailing '/'.
set iraf = `echo $env_iraf | sed -e 's+/\(["]*\)$+\1+'`
endif
NEWLINE
else
if ("$env_iraf" != "") then
set iraf = `echo $env_iraf | sed -e 's+/\(["]*\)$+\1+'`
else
set iraf = `echo $irafh_iraf | sed -e 's+/\(["]*\)$+\1+'`
endif
endif
else if ("$env_iraf" == "" && "$irafh_iraf" == "") then
NEWLINE
MSG "No 'iraf' defined in the environment and there is no <iraf.h>"
MSG "file on this machine. Please specify an iraf path in the"
MSG "environment or run the install script to proceed."
NEWLINE
exit 1
else if ("$env_iraf" == "") then
# Strip off any trailing '/'.
set iraf = `echo $irafh_iraf | sed -e 's+/\(["]*\)$+\1+'`
else if ("$irafh_iraf" == "") then
# Strip off any trailing '/'.
set iraf = `echo $env_iraf | sed -e 's+/\(["]*\)$+\1+'`
endif
NEWLINE
echo "Using iraf root path: $iraf"
NEWLINE
# Initialize for files we'll be checking later.
set tapecap_file = "$iraf/dev/tapecap"
set termcap_file = "$iraf/dev/termcap"
set graphcap_file = "$iraf/dev/graphcap"
# Get the motd header string.
echo -n 'IRAF version: '
if (-e $iraf/unix/hlib/motd) then
set motd = "$iraf/unix/hlib/motd"
set ver = `head -1 $motd | sed -e 's/NOAO//g' -e 's/EXPORT//g'`
echo $ver
else
echo "<unknown>"
endif
NEWLINE
# Get the last time the hlib$utime (install) was updated.
echo -n "Install script last run: "
if (-e $iraf/unix/hlib/utime) then
set dat = `$LS $LSDF $iraf/unix/hlib/utime | head -2 | tail -1`
set utime = `echo -n $dat | awk '{printf ("%3s %2s %-5s\t", $7, $8, $9)}'`
echo $utime
else
echo "<unknown>"
endif
# Look around for the local iraf commands directory.
echo -n "IRAF command directories: "
set clpath = `which cl`
set lbins = ""
if ("`echo $clpath | grep 'Command not found'`" == "") then
set d_lbin = $clpath:h
foreach p ($path)
if (-d $p && -e $p/cl) then
set lbin = $p
set lbins = `echo $lbins $p`
if ("$lbins" == "$lbin") then
echo $p
else
echo " $p"
endif
endif
end
if ("$lbin" == "") then
echo "not found"
endif
else
echo "not found"
endif
# If we use a shared library see if it's in the path someplace.
if ("$shlib" == "yes") then
echo -n "IRAF shared lib directory: "
set llib = ""
set llibs = ""
# Look around and come up with a likely candidate directory.
set sysp = "/usr/local/lib /local/lib /usr/lib /var/shlib /lib"
if ($?LD_LIBRARY_PATH) then
set userp = `echo $LD_LIBRARY_PATH | sed -e 's/:/ /g'`
else
set userp = ""
endif
foreach p ($sysp $userp)
if (-d $p) then
foreach l ($LIBFILES)
if (-e $p/$l) then
set llib = $p
set llibs = `echo $llibs $p`
if ("$llibs" == "$llib") then
echo $p
else
echo " $p"
endif
endif
end
endif
end
if ("$llib" == "") then
echo "not found"
endif
endif
# Get the default imdir from the mkiraf.csh
echo -n "Default image storage dir: "
set hlib = $iraf/unix/hlib/
if (-e $hlib/mkiraf.csh) then
set p = `grep "^set imdir" $hlib/mkiraf.csh | sed -e 's/\"//g'`
if ("$p" != "") then
echo $p[4]
set imdir = $p[4]
else
echo "not found"
endif
else
echo "<unknown>"
endif
# Print some interesting default system settings from hlib$zzsetenv.def.
set WS = '[ ]'
set ZZDEFS = "printer stdplot editor imtype stdimage cmbuflen min_lenuserarea graphcap termcap tapecap"
NEWLINE
echo 'Default settings in the hlib$zzsetenv.def file:'
if (-e $hlib/zzsetenv.def) then
foreach i ($ZZDEFS)
set p = `grep "^set$WS$i" $hlib/zzsetenv.def | sed -e 's/\"//g'`
if ("$p" != "") then
set $i = '$p[4]'
echo ${i}: $p[4] | awk '{ printf (" %-12s\t %s\n", $1, $2)}'
# Save the *cap file for later use.
if ("$i" == "termcap" && "$p[4]" != 'dev$termcap') then
set termcap_file = $p[4]
else if ("$i" == "graphcap" && "$p[4]" != 'dev$graphcap') then
set graphcap_file = $p[4]
else if ("$i" == "tapecap" && "$p[4]" != 'dev$tapecap') then
set tapecap_file = $p[4]
endif
else
echo ${i}: | awk '{ printf (" %-12s\tnot found\n", $1, $2)}'
endif
end
else
MSG 'hlib$zzsetenv.def file not found'
set severe = 1
endif
NEWLINE
if ($pciraf) then
NEWLINE
echo "X Server Version information:"
echo " "`X -version |& egrep "^XFree86"`
echo " "`X -version |& egrep "^Release"`
echo " "`X -version |& egrep "Operating"`
endif
NEWLINE
echo "Compilers and Development Tools Available:"
echo " (NOTE: duplicates are possible due to the search path"
echo " used and symbolic links for commands.)"
NEWLINE
set found = 0
foreach d ($path)
foreach i (cc gcc acc c89 f77 g77 f90 fort f2c yacc bison lex flex)
if (-e $d/$i) then
echo " "$d/$i
set found = 1
endif
end
end
if ($found == 0) then
echo " None Found"
NEWLINE
endif
if ($severe == 1) then
NEWLINE
NEWLINE
BOLD_ON
echo "======================================================================"
echo "SYSINFO: Aborting due to severe errors."
echo "======================================================================"
BOLD_OFF
NEWLINE
exit 1
else if ($general == 1) then
goto exit_early
endif
#=============================================================================
# Installation Verification
#=============================================================================
Verification:
echo; NEWLINE
echo "======================= Verifying Installation ======================="
NEWLINE
##############################################################################
#
# Step 1: VERIFICATION
#
# Run some simple checks to be sure the system was unpacked correctly
# and the settings used are correct. Verification tests include:
#
# o Verify the machine type and document settings.
# o Check iraf root directory looks correct.
# o Check iraf root and imdir aren't the same
# o Check iraf user exists in passwd file.
# o Check iraf user login path in passwd file is iraf$local.
# o Check iraf tree for proper structure.
# o Check iraf tree is owned by 'iraf'
# o Check binary dirs are both populated correctly.
# o Check that the local bin directory exists.
# o Check that the local lib directory exists.
#
# An error at this stage will cause the script to exit so we can reset and
# try again.
#
##############################################################################
# ============================================
# The following is partially system dependent.
# ============================================
# Set the BINDIRS pathnames - directories where the HSI executables go.
set host = "$iraf/unix"
set hbin = "$iraf/unix/bin.$hmach"
set hlib = "$iraf/unix/hlib"
set fbin = "$iraf/bin"
# Replace any // by /.
set host = `echo $host | sed -e "s+//+/+g"`
set hbin = `echo $hbin | sed -e "s+//+/+g"`
set fbin = `echo $fbin | sed -e "s+//+/+g"`
set hlib = `echo $hlib | sed -e "s+//+/+g"`
# Strip any trailing /.
set host = `echo $host | sed -e 's+/\(["]*\)$+\1+'`
set hbin = `echo $hbin | sed -e 's+/\(["]*\)$+\1+'`
set fbin = `echo $fbin | sed -e 's+/\(["]*\)$+\1+'`
set hlib = `echo $hlib | sed -e 's+/\(["]*\)$+\1+'`
set BINDIRS = "$hbin $hlib $fbin $host"
# The following file lists are partially system dependent.
set PATHFILES = "mkiraf.csh libc/iraf.h cl.csh ../../local/.login"
set MODEFILES = "cl.csh fc.csh mkiraf.csh mkfloat.csh mkmlist.csh $host/reboot generic.e mkpkg.e rmbin.e rmfiles.e rpp.e rtar.e wtar.e xc.e xpp.e xyacc.e sgidispatch.e $hbin/sgi2*.e"
set LINKFILES = "cl.e mkiraf.csh mkmlist.csh generic.e mkpkg.e rmbin.e rmfiles.e rtar.e sgidispatch.e wtar.e rpp.e xpp.e xyacc.e xc.e"
set CMDLINKS = "cl mkiraf mkmlist generic mkpkg rmbin rmfiles rtar sgidispatch wtar rpp xpp xyacc xc"
# ------------------------------------------
# Check for <iraf.h> file.
echo -n "Checking for <iraf.h> file ... "
if (! (-e /usr/include/iraf.h)) then
DO_FAIL ; set errstat = 1 ; set iraf_root_ok = 0
NEWLINE
MSG "The file /usr/include/iraf.h was not found which means"
MSG "the install script was not run on this machine."
NEWLINE
set err_count = `expr $err_count + 1`
else
DO_OK ; set iraf_root_ok = 1
set ok_count = `expr $ok_count + 1`
endif
# Check $iraf path in PATHFILES
echo -n "Checking iraf path in system files ... "
set err_seen = 0
foreach i ($PATHFILES)
if (-e $iraf/unix/hlib/$i) then
grep $iraf $iraf/unix/hlib/$i >& /dev/null
endif
if ($status == 1 || (! (-e $iraf/unix/hlib/$i))) then
if ("$err_seen" == 0) then
DO_FAIL
set err_seen = 1 ; set err_count = `expr $err_count + 1`
endif
if (! -e $i) then
MSG "File $i not found."
else
MSG "File $i contains the wrong iraf path"
endif
endif
end
if ("$err_seen" == 0) then
BOLD_ON
echo "[ $defstat ]"
BOLD_OFF
endif
# Check that the specified local bin directory exists.
echo -n "Checking that local command bin directory exists ... "
if ("$lbin" == "") then
DO_FAIL ; set errstat = 1
NEWLINE
MSG "No local bin directory found on this machine which"
MSG "implies that either your path does not include the"
MSG "local bin dir or else the install script was not run"
MSG "on this machine."
NEWLINE
set err_count = `expr $err_count + 1`
else
if (-d "$lbin") then
DO_OK
set ok_count = `expr $ok_count + 1`
else
DO_FAIL ; set errstat = 1
NEWLINE
MSG "The specified local bin directory does not exist. This"
MSG "directory should be a common local bin directory which "
MSG "is found in all user's paths, e.g. /usr/local/bin."
MSG "Please create the directory or else reset and try again."
NEWLINE
set err_count = `expr $err_count + 1`
endif
endif
# Check that the specified local lib directory exists.
if ("$shlib" == "yes") then
echo -n "Checking that local lib directory exists ... "
if (-d "$llib") then
DO_OK
set ok_count = `expr $ok_count + 1`
else
DO_FAIL ; set errstat = 1
NEWLINE
MSG "The specified local lib directory does not exist. This"
MSG "directory should be a common local lib directory which "
MSG "is found in all user's paths, e.g. /usr/local/lib."
MSG "This directory is required for the iraf shared library."
MSG "Please create the directory or else reset and try again."
NEWLINE
set err_count = `expr $err_count + 1`
endif
endif
# Check mode on MODEFILES
echo -n "Checking iraf file permissions ... "
set err_seen = 0
foreach i ($MODEFILES)
set file = $i
if (! -e $file) then
foreach j ($BINDIRS)
if (-e $j/$i) then
set file = $j/$i
break
endif
end
endif
if (-e $file) then
if ("`$LS -l $file | grep '.rwxr.xr.x'`" == "") then
if ("$err_seen" == 0) then
DO_WARN
set err_seen = 1 ; set err_count = `expr $err_count + 1`
endif
MSG "File $file:t not mode 0755."
endif
else
if ("$err_seen" == 0) then
DO_FAIL
set err_seen = 1 ; set err_count = `expr $err_count + 1`
endif
MSG "File $file:t not found."
endif
end
if ("$err_seen" == 0) then
BOLD_ON
echo "[ $defstat ]"
BOLD_OFF
endif
# Check valid links on CMDLINKS
echo "Checking iraf command links ..."
set err_seen = 0
foreach p ($lbins)
echo -n " Checking command dir $p ... "
foreach cmd ($CMDLINKS)
# Locate the file to be linked to.
set file1 = $cmd:r
foreach j ($BINDIRS)
set file2 = $j/$file1.csh
if (-e $file2) then
break
endif
set file2 = $j/$cmd.e
if (-e $file2) then
break
endif
end
# See first if it exists directly, or as a link to some other
# valid file.
if (! (-e $p/$cmd) && ! (-e $file2) ) then
if ("$err_seen" == 0) then
DO_FAIL
set err_seen = 1 ; set err_count = `expr $err_count + 1`
endif
echo -n " " ; MSG "File $p/$cmd not found."
# Then check that the link is correct
else if ("`$LS -l $p/$file1 | grep $file2`" == "") then
if ("$err_seen" == 0) then
DO_FAIL
set err_seen = 1 ; set err_count = `expr $err_count + 1`
endif
echo -n " " ; MSG "Link $p/$cmd is invalid."
endif
end
if ("$err_seen" == 0) then
BOLD_ON
echo "[ $defstat ]"
BOLD_OFF
endif
end
if ($err_seen == 1) then
NEWLINE
MSG "1) A 'not found' error means that one or more of the commands"
MSG " normally installed by the install script was not found."
MSG " This may indicate a non-standard installation."
MSG "2) A 'link is invalid' message means that the command link"
MSG " was found but either points to a nonexistent file or to"
MSG " the wrong file for this platform (e.g. the HSI bin.sparc"
MSG " directory instead of bin.ssol)."
MSG "3) Multiple local bin directories are not strictly an error"
MSG " but may confuse users. Unneeded links should be removed."
MSG ""
MSG "The command links should be checked in either cases and the"
MSG "install script rerun to clear the error."
NEWLINE
endif
# Check iraf root directory looks correct.
NEWLINE
echo -n "Checking contents of iraf root directory ... "
if (! ((-d $iraf/dev) && (-d $iraf/pkg) && (-d $iraf/noao))) then
DO_FAIL ; set errstat = 1 ; set iraf_root_ok = 0
NEWLINE
MSG "The definition of '$iraf' looks incorrect. The iraf root"
MSG "directory is the place where the AS distribution was unpacked,"
MSG "it contains subdirectories such as 'dev', 'local', 'noao', and"
MSG "'pkg' and the binary directory links."
NEWLINE
set err_count = `expr $err_count + 1`
else
DO_OK ; set iraf_root_ok = 1
set ok_count = `expr $ok_count + 1`
endif
# Cannot have iraf and imdir the same.
echo -n "Checking iraf root and imdir directory ... "
if ($iraf == $imdir) then
DO_FAIL ; set errstat = 1
NEWLINE
MSG "'imdir' should not be the same as the iraf root directory."
NEWLINE
set err_count = `expr $err_count + 1`
else
DO_OK
set ok_count = `expr $ok_count + 1`
endif
# Check iraf user.
echo -n "Checking for iraf user account ... "
set pass = ""
if ($pciraf && ($mach == "macosx" || $mach == "macintel")) then
# Special-case user info check for OS X and systems where the /etc/passwd
# file may not contain the user info.
if (`id iraf |& grep -i 'no such user'` != "") then
DO_FAIL ; set errstat = 1
NEWLINE
MSG "No 'iraf' user was found on the system. The iraf user should"
MSG "be created before installing the system to ensure all files"
MSG "are owned by the iraf user, and the have the proper environment"
MSG "defined for installation and maintanence."
NEWLINE
else
DO_OK
set ok_count = `expr $ok_count + 1`
# Check iraf user login path and shell
echo -n "Checking iraf user login directory ... "
set v = `finger iraf |& egrep "^Directory"`
set ihome = `echo $v[2] | sed -e 's+/\(["]*\)$+\1+'`
set shel = `echo $v[4] | sed -e 's+/\(["]*\)$+\1+' | grep csh`
if ("$ihome" != "$iraf/local" || $shel == "") then
DO_FAIL ; set errstat = 1
NEWLINE
MSG "The iraf user login info appears to be incorrect. For the"
MSG "given iraf root this path should be '$iraf/local',"
MSG "please run the 'chpass' command to change this. The iraf"
MSG "user account should also be defined to use a C-shell."
if ("$iraf_root_ok" == 0) then
MSG "(This error may be related to the incorrect definition of"
MSG "the iraf root directory seen above.)"
endif
NEWLINE
else
DO_OK
set ok_count = `expr $ok_count + 1`
endif
endif
else if (!(-r /etc/passwd)) then
DO_FAIL ; set errstat = 1
NEWLINE
MSG "The /etc/passwd file is not readable so I can't check for"
MSG "and iraf user. This may also cause problems with IRAF
MSG "networking when connecting to this machine."
NEWLINE
else
set pass = `grep ^iraf: /etc/passwd`
if ("$pass" == "") then
DO_FAIL ; set errstat = 1
NEWLINE
MSG "No 'iraf' user was found in the /etc/passwd file. The iraf"
MSG "user should be created before installing the system to ensure"
MSG "all files are owned by the iraf user, and the have the proper"
MSG "environment defined for installation and maintanence."
NEWLINE
else
DO_OK
set ok_count = `expr $ok_count + 1`
# Check iraf user login path in passwd file is iraf$local.
echo -n "Checking iraf user login directory ... "
set pass = `grep ^iraf: /etc/passwd | sed -e 's/[ \*]/_/g'|sed -e 's/:/ /g'`
set c = `echo $pass | wc -w`
set indx = `expr $c - 1`
set ihome = `echo $pass[$indx] | sed -e 's+/\(["]*\)$+\1+'`
set shel = `echo $pass[$c] | sed -e 's+/\(["]*\)$+\1+' | grep csh`
if ("$ihome" != "$iraf/local" || $shel == "") then
DO_FAIL ; set errstat = 1
NEWLINE
MSG "The iraf user login directory appears to be incorrect."
MSG "For the given iraf root this path should be '$iraf/local',"
MSG "please edit the /etc/passwd file to change this. The iraf"
MSG "user account should also be defined to use a C-shell."
if ("$iraf_root_ok" == 0) then
MSG "(This error may be related to the incorrect definition of"
MSG "the iraf root directory seen above.)"
endif
NEWLINE
else
DO_OK
set ok_count = `expr $ok_count + 1`
endif
endif
endif
# Check iraf tree for proper structure.
set iraf_r = $iraf # iraf root directory
set iraf_p = $iraf_r:h # iraf parent directory
set iraf_b = $iraf_p/irafbin # irafbin directory
set iraf_ib = $iraf_b/bin.$mach # irafbin IB directory
set iraf_nb = $iraf_b/noao.bin.$mach # irafbin NB directory
set iraf_tree_ok = 1
echo "Checking for proper iraf tree structure in $iraf_p ..."
echo -n " Checking for 'iraf' subdir ... "
if (-d "$iraf_p/iraf") then
DO_OK
set ok_count = `expr $ok_count + 1`
else
DO_FAIL ; set errstat = 1 ; set iraf_tree_ok = 0
set err_count = `expr $err_count + 1`
endif
echo -n " Checking for 'irafbin' subdir ... "
if (-d "$iraf_p/irafbin") then
DO_OK ; set ok_count = `expr $ok_count + 1`
else
set zztemp = $iraf_tree_ok
echo " " ; set errstat = 1 ; set iraf_tree_ok = 0
# Look for a fallback to recover ...
echo -n " Checking for fallback tree structure ... "
set iraf_p = $iraf/../
set iraf_b = $iraf_p/irafbin # irafbin directory
set iraf_ib = $iraf_b/bin.$mach # irafbin IB directory
set iraf_nb = $iraf_b/noao.bin.$mach # irafbin NB directory
if (-d "$iraf_p/irafbin") then
DO_OK ; set errstat = 0 ; set iraf_tree_ok = $zztemp
set ok_count = `expr $ok_count + 1`
else
DO_FAIL ; set errstat = 1 ; set iraf_tree_ok = 0
set err_count = `expr $err_count + 1`
endif
endif
echo -n " Checking for 'irafbin/bin.$mach' subdir ... "
if (-d "$iraf_p/irafbin/bin.$mach") then
DO_OK
set ok_count = `expr $ok_count + 1`
else
DO_FAIL ; set errstat = 1 ; set iraf_tree_ok = 0
set err_count = `expr $err_count + 1`
endif
echo -n " Checking for 'irafbin/noao.bin.$mach' subdir ... "
if (-d "$iraf_p/irafbin/noao.bin.$mach") then
DO_OK
set ok_count = `expr $ok_count + 1`
else
DO_FAIL ; set errstat = 1 ; set iraf_tree_ok = 0
set err_count = `expr $err_count + 1`
endif
if ("$iraf_tree_ok" == 0) then
set back = $cwd ; chdir $iraf_p ; set iraf_p = $cwd; chdir $back
NEWLINE
MSG " An error was detected in the structure of the iraf tree."
MSG " Your directory tree should look something like:"
MSG ""
MSG " $iraf_p"
MSG " / \"
MSG " (AS) /iraf /irafbin"
MSG " / \"
MSG " (IB) bin.$mach noao.bin.$mach (NB)"
MSG ""
MSG " The AS, IB, and NB distribution files are shown where they"
MSG " should be unpacked."
NEWLINE
endif
echo -n " Checking file ownerships ... "
if ($mach == "hp700" || $mach == "rs6000" || $mach == "irix") then
set downr = `$LS -lLd $iraf_p/iraf | awk '{print ($5)}'`
set fownr = `$LS -lLd $iraf_p/iraf/mkpkg | awk '{print ($5)}'`
else
set downr = `$LS -lLd $iraf_p/iraf | awk '{print ($4)}'`
set fownr = `$LS -lLd $iraf_p/iraf/mkpkg | awk '{print ($4)}'`
endif
if ("$downr" == "iraf" && "$fownr" == "iraf") then
DO_OK
set ok_count = `expr $ok_count + 1`
else if ("$downr" == "tody" && "$fownr" == "tody") then
# Special exemption for NOAO installations.
DO_OK
set ok_count = `expr $ok_count + 1`
else
DO_FAIL
NEWLINE
MSG "(root dir owned by $downr, iraf files owned by $fownr)"
MSG "The iraf tree should be owned by the iraf user so it can"
MSG "be updated and maintained properly."
MSG ""
MSG 'To fix this, login as root, set the iraf environment, and'
MSG 'issue the commands:'
MSG ""
MSG " cd " `echo $iraf_p`
MSG ' chown -R iraf . # change dir owner'
MSG ' cd $hbin # go to HSI bin dir'
MSG ' chown 0 alloc.e # fix alloc.e ownership'
MSG ' chmod 4755 alloc.e # fix permissions'
NEWLINE
set errstat = 1 ; set err_count = `expr $err_count + 1`
endif
# Check that binary dirs are populated correctly.
set archs = ""
set back = $cwd ; chdir $iraf_p ; set iraf_p = $cwd; chdir $back
NEWLINE ; NEWLINE
echo "======================================================================"
NEWLINE
echo "Checking Core system binaries in $iraf_p/irafbin ..."
# Do a special check that we have a bin directory for the current arch.
echo -n " Checking for current platform arch... "
if (! -e $iraf_ib) then
DO_FAIL ; set errstat = 1
NEWLINE
MSG "The core system binary directory, $iraf_ib, does"
MSG "not exist for this platform."
NEWLINE
set err_count = `expr $err_count + 1`
else
DO_OK
set ok_count = `expr $ok_count + 1`
endif
NEWLINE
echo " Size Date"
echo " ---- ----"
# Check all of the bin directories in case we have a multi-arch system
foreach i ($iraf_p/irafbin/bin.*)
set dir = $i:t
if ($dir:r == "bin") then
set sz = `(chdir $i ; du -s | awk '{printf ("%d", $1)}')`
echo -n $dir $sz | awk '{printf ("%18s\t%5d\t", $1, $2)}'
if (`$LS -lL $i | wc -l` > 1) then
set dat = `$LS $LSDF $i/* | head -2 | tail -1`
echo -n $dat | awk '{printf ("%3s %2s %-5s\t\t\t", $7, $8, $9)}'
if (! (-e "$i/cl.e" && -e "$i/x_system.e")) then
DO_FAIL ; set errstat = 1
NEWLINE
MSG "The core system binary directory, $i:t, does"
MSG "not appear to contain the proper binaries. The IB dist-"
MSG "ribution files should be unpacked in this directory."
NEWLINE
set err_count = `expr $err_count + 1`
else
DO_OK ; set ok_count = `expr $ok_count + 1`
# Save the list of installed binaries, allow for changes between
# the binary arch and HSI arch here (e.g. ssun->ssol).
if ("$dir:e" == "ssun") then
set archs = `echo $archs ssol`
else
set archs = `echo $archs $dir:e`
endif
endif
else
echo "< empty > [ FAIL ]" ; set errstat = 1
NEWLINE
MSG "bin directory is empty or does not contain IRAF binaries."
NEWLINE
endif
endif
end
NEWLINE
NEWLINE
echo "Checking NOAO Package binaries in $iraf_p/irafbin ..."
# Do a special check that we have a bin directory for the current arch.
echo -n " Checking for current platform arch... "
if (! -e $iraf_nb) then
DO_FAIL ; set errstat = 1
NEWLINE
MSG "The NOAO package binary directory, $iraf_nb, does"
MSG "not exist for this platform."
NEWLINE
set err_count = `expr $err_count + 1`
else
DO_OK
set ok_count = `expr $ok_count + 1`
endif
NEWLINE
NEWLINE
echo " Size Date"
echo " ---- ----"
foreach i ($iraf_p/irafbin/noao.bin.*)
set dir = $i:t
if ($dir:r == "noao.bin") then
set sz = `(chdir $i ; du -s | awk '{printf ("%d", $1)}')`
echo -n $dir $sz | awk '{printf ("%18s\t%5d\t", $1, $2)}'
if (`$LS -lL $i | wc -l` > 1) then
set dat = `$LS $LSDF $i/* | head -2 | tail -1`
echo -n $dat | awk '{printf ("%3s %2s %-5s\t\t\t", $7, $8, $9)}'
if (! (-e "$i/x_apphot.e" && -e "$i/x_rv.e")) then
DO_FAIL ; set errstat = 1
NEWLINE
if (-e "$iraf_ib/x_apphot.e" && -e "$iraf_ib/x_rv.e") then
NEWLINE
MSG "The NOAO package binary directory, $iraf_nb, is"
MSG "empty but the binaries appear to have been unpacked in"
MSG "the core system directory, $iraf_ib. These will need to"
MSG "be moved, please delete the binaries and start again, be"
MSG "sure to unpack the NB distribution files in the $iraf_nb"
MSG "directory and the core system file in the $iraf_ib"
MSG "directory."
else
NEWLINE
MSG "The NOAO package binary directory, $iraf_nb, does"
MSG "not appear to contain the proper files. The NB dist-"
MSG "ribution files should be unpacked in this directory."
endif
NEWLINE
set err_count = `expr $err_count + 1`
else
DO_OK ; set ok_count = `expr $ok_count + 1`
endif
else
echo "< empty > [ FAIL ]" ; set errstat = 1
NEWLINE
MSG "bin directory is empty or does not contain NOAO binaries."
NEWLINE
endif
else
continue
endif
end
# Check the HSI binaries.
NEWLINE
NEWLINE
echo "Checking HSI system binaries in $iraf/unix ..."
# Do a special check that we have a bin directory for the current arch.
echo -n " Checking for current platform arch... "
if (! -e $iraf/unix/bin.$hmach) then
DO_FAIL ; set errstat = 1
NEWLINE
MSG "The HSI binary directory, $iraf/unix/bin.$hmach, does"
MSG "not exist for this platform."
NEWLINE
set err_count = `expr $err_count + 1`
else if (! (-e "$iraf/unix/bin.$hmach/alloc.e")) then
DO_FAIL ; set errstat = 1
NEWLINE
MSG "The HSI binary directory, $iraf/unix/bin.$hmach, appears"
MSG "to be empty."
NEWLINE
set err_count = `expr $err_count + 1`
else
DO_OK
set ok_count = `expr $ok_count + 1`
endif
NEWLINE
NEWLINE
echo " Size Date"
echo " ---- ----"
set delete_bin = ""
set empty_bin = ""
foreach i ($iraf_p/iraf/unix/bin.*)
set dir = $i:t
if ($dir:r == "bin") then
set sz = `(chdir $i ; du -s | awk '{printf ("%d", $1)}')`
echo -n $dir $sz | awk '{printf ("%18s\t%5d\t", $1, $2)}'
if (`$LS -lL $i | wc -l` > 1) then
set d = `$LS $LSDF $i/* | head -2 | tail -1`
echo -n $dat | awk '{printf ("%3s %2s %-5s\t\t\t", $7, $8, $9)}'
if (! (-e "$i/alloc.e" && -e "$i/xc.e")) then
DO_FAIL ; set errstat = 1
else
DO_OK ; set ok_count = `expr $ok_count + 1`
endif
if ("`echo $archs | grep $dir:e`" == "") then
set delete_bin = `echo $delete_bin $dir`
endif
else
if ($sz < 8 && "`echo $archs | grep $dir:e`" == "") then
BOLD_ON
echo "< unused > [ OK ]"
BOLD_OFF
else
BOLD_ON
echo "< empty > [ WARNING ]" ; set errstat = 1
BOLD_OFF
set warn_count = `expr $warn_count + 1`
set empty_bin = `echo $empty_bin $dir`
endif
if ($sz > 8 && "`echo $archs | grep $dir:e`" == "") then
set delete_bin = `echo $delete_bin $dir`
endif
endif
else
continue
endif
end
NEWLINE
if ("$delete_bin" != "") then
NEWLINE
MSG "The following bin directories were found to be"
MSG "unneeded for this installation. If disk usage is a"
MSG "concern the contents may be deleted to reclaim space:"
MSG ""
foreach i ($delete_bin)
MSG " $iraf/unix/$i"
end
endif
NEWLINE
if ($early_exit == 1) then
goto exit_early
endif
#=============================================================================
# Networking Information
#=============================================================================
Networking:
set net_errstat = 0 # initialize error status
NEWLINE
echo "======================= Networking Information ======================="
NEWLINE
set hname = `hostname`
set lhost_abbr = `hostname | awk '{printf ("%16.16s\n", $1 ) }'`
set ihosts = $iraf/dev/hosts
set nhost_files = `$LS -1 $iraf/dev/hosts* | wc -l`
echo 'Local host name: '$hname
echo 'Truncated host name: '$lhost_abbr
if (`echo $hname | grep "\."` != "") then
# When using FQDN lnode may not be set....
set is_fqdn = yes
set domain = `hostname | sed -e 's/^[a-zA-Z0-9_\-]*\.//g'`
set lhost = `hostname | sed -e 's/\.[a-zA-Z0-9]*//g'`
else
set is_fqdn = no
set domain = "<unknown>"
set lhost = $hname
endif
echo 'Domain name: '$domain
echo 'No. of dev$host* files: '$nhost_files
echo 'Using IRAF hosts file: '$ihosts
NEWLINE
echo -n 'Checking for iraf hosts file ... '
if (-e $ihosts) then
DO_OK
set ok_count = `expr $ok_count + 1`
set nhosts = `grep irafks.e $ihosts | wc -l`
set lnode = `grep irafks.e $ihosts | sort | grep $lhost | head -1`
# The following madness is required to workaround shortcomings in the
# GNU versions of the sed command (i.e. Linux/FreeBSD). Working sed
# commands for Sun here.
#
# set n = `cat $ihosts | sort | grep $lhost | head -1`
# set irafks = `echo $n | sed -e 's/^[a-zA-Z0-9 _\!\/\-\.:]*//g'`
# set nalias = `echo $n | sed -e 's/:[a-zA-Z0-9 _\!\/\-\.]*//g'`
# set rhs = `echo $n | sed -e 's/^[a-zA-Z0-9 _\!\-\.]*://g'`
# set nnode = `echo $rhs | sed -e 's/\![a-zA-Z0-9 _\!\/\-\.]*//g'`
set TEMP = "/tmp/_$$"
echo $lnode | sed -e 's/\!/ /g' > $TEMP
set line = `cat $TEMP`
RM $TEMP
set nalias = ""
set irafks = ""
set nnode = ""
if ("$line" != "") then
while ("$line[1]" != "")
if ("$line[1]" == ":") then
break
else
set nalias = `echo $nalias $line[1]`
endif
shift line
end
shift line
set nnode = $line[1] ; shift line
set irafks = $line[1] ; shift line
endif
# Print out the entry information found.
echo ' No. nodes in hosts file: '$nhosts
echo ' irafks.e pathname: '$irafks
echo ' Node aliases: '$nalias
echo ' Network node name: '$nnode
NEWLINE
# Make sure the node is in the file.
echo -n ' Checking for local node in hosts file ... '
if ("`grep $lhost $ihosts | head -1`" != "") then
DO_OK
set ok_count = `expr $ok_count + 1`
else
DO_FAIL ; set net_errstat = 1
NEWLINE
MSG "The local host, $lhost, was not found in the iraf hosts"
MSG "file $iraf/dev/hosts. This means that IRAF networking"
MSG "will not be available from this machine to others in the"
MSG "iraf network."
NEWLINE
set err_count = `expr $err_count + 1`
endif
# See if the irafks.e path is correct on this machine.
if ("$irafks" != "") then
echo -n ' Checking for irafks.e binary ... '
if (-e $irafks) then
DO_OK
set ok_count = `expr $ok_count + 1`
else
DO_FAIL ; set net_errstat = 1
NEWLINE
MSG "The named irafks.e binary was not found on this system."
NEWLINE
set err_count = `expr $err_count + 1`
endif
endif
# Look for duplicate host names which may trigger a CL bug.
echo -n ' Checking for duplicate hosts in dev$hosts file ... '
set dup_hosts = `grep irafks.e $ihosts | sort | awk '{print $1}' | uniq -d`
if ("$#dup_hosts" == 0) then
DO_OK
set ok_count = `expr $ok_count + 1`
else
DO_WARN ; set net_errstat = 1
NEWLINE
MSG 'Duplicate hosts found in dev$hosts file:'
grep irafks.e $ihosts | \
sort | \
awk '{print $1}' | \
uniq -d | \
awk '{printf(" ***\t\t%s\n", $1)}'
MSG ""
MSG "Duplicate node names should be removed to ensure"
MSG "networking and the CL operate properly."
NEWLINE
set warn_count = `expr $warn_count + 1`
endif
else
DO_FAIL ; set net_errstat = 1
NEWLINE
MSG "The IRAF hosts file, $ihosts, was not found."
NEWLINE
set err_count = `expr $err_count + 1`
endif
# See what NETSTATUS says about this setup.
NEWLINE
echo -n 'Verify NETSTATUS says iraf networking is enabled ... '
set system = $iraf/bin.$mach/x_system.e
if (-e $system) then
set net = `$system netstatus | grep -i "interface disabled"`
if ("$net" == "") then
DO_OK
set ok_count = `expr $ok_count + 1`
else
DO_FAIL ; set net_errstat = 1
NEWLINE
MSG "The NETSTATUS task claims that networking is disabled."
NEWLINE
set err_count = `expr $err_count + 1`
endif
else
DO_FAIL ; set net_errstat = 1
NEWLINE
MSG "The NETSTATUS task binary could not be executed."
NEWLINE
set err_count = `expr $err_count + 1`
endif
# See if we're in the trusted hosts file for rsh access.
NEWLINE
echo -n 'Checking for host in /etc/hosts.equiv ... '
set equiv = /etc/hosts.equiv
if (-e $equiv) then
if ("`grep $lhost $equiv | head -1`" != "") then
DO_OK
set ok_count = `expr $ok_count + 1`
else
DO_WARN ; set net_errstat = 1
NEWLINE
MSG "The local host, '$lhost', is not present in the $equiv"
MSG "file."
MSG ""
MSG "By default IRAF networking will try to use the 'rsh'"
MSG "protocol for connecting to a remote machine. Without a"
MSG "$equiv entry a networking attempt will fail and"
MSG "a password prompt will be required since an rexec protocol"
MSG "is the fallback. Some systems are not configured for rsh"
MSG "access even with a $equiv file, or rsh is not a valid"
MSG "command, and so some other protocol will be required."
MSG ""
MSG "A KSRSH unix environment variable may be defined to specify"
MSG "a different command or protocol (e.g. remsh or ssh). This"
MSG "is not a fatal error and will not prevent IRAF networking"
MSG "from working, but can be used to avoid to password prompt."
NEWLINE
set warn_count = `expr $warn_count + 1`
endif
else
DO_WARN ; set net_errstat = 1
NEWLINE
MSG "The trusted hosts file, '$equiv', is not present on this"
MSG "system. This may mean that the 'rsh' connection protocol"
MSG "is not available and IRAF networking will require password"
MSG "prompts."
MSG ""
MSG "By default IRAF networking will try to use the 'rsh'"
MSG "protocol for connecting to a remote machine. Without a"
MSG "$equiv entry a networking attempt will fail and"
MSG "a password prompt will be required since an 'rexec' protocol"
MSG "is the fallback. Some systems are not configured for rsh"
MSG "access even with a $equiv file, or 'rsh' is not a valid"
MSG "command, and so some other protocol will be required."
MSG ""
MSG "A 'KSRSH' unix environment variable may be defined to specify"
MSG "a different command or protocol (e.g. 'remsh' or 'ssh'). This"
MSG "is not a fatal error and will not prevent IRAF networking from"
MSG "operating, but can be used to avoid to password prompt."
NEWLINE
set warn_count = `expr $warn_count + 1`
endif
# Print out the recommended dev$hosts entry for this machine.
NEWLINE
echo "----------------------------------------------------------------------"
NEWLINE
echo "Recommended $ihosts file entry for this machine: "
NEWLINE
echo -n " "
if ("$is_fqdn" == "no") then
echo $lhost " : "$hname"\!"$iraf/bin.$mach/irafks.e
else
echo $lhost $lhost_abbr " : " $nnode"\!"$iraf/bin.$mach/irafks.e
endif
NEWLINE
if ($early_exit == 1) then
goto exit_early
endif
#=============================================================================
# Image Display Device Information
#=============================================================================
Image_Display:
NEWLINE
echo "===================== Image Display Device Info ======================"
NEWLINE
set DISPLAY_SERVERS = "ximtool ximtool-alt saoimage ds9 saotng"
set GRAPHICS_TERMS = "xgterm xterm"
set IMTOOLRC = /usr/local/lib/imtoolrc
if (! ($?termcap_file)) then
set termcap_file = "$iraf/dev/termcap"
endif
if (! ($?graphcap_file)) then
set graphcap_file = "$iraf/dev/graphcap"
endif
echo -n "Display Servers Available: "
set found = 0
set have_sockets = 0
set have_saoimage = 0
set have_ximtool = 0
foreach i ($DISPLAY_SERVERS)
set p = `which $i |& grep -i "^\/"`
if ($status == 0) then
if ("$found" == 0) then
DO_OK
set ok_count = `expr $ok_count + 1`
endif
set d = `$LS $LSDF $p | head -2 | tail -1`
echo $d | awk '{printf (" ( Date: %3s %2s %-5s )\t", $7, $8, $9) }'
echo " "$p
set found = 1
if ("$i" == "saoimage") set have_saoimage = 1
if ("$i" == "ximtool") set have_ximtool = 1
if ("$i" != "saoimage") set have_sockets = 1
endif
end
if ($found == 0) then
DO_FAIL ; set errstat = 1
echo " None Found"
NEWLINE
MSG "No display servers were found on this machine or in the user"
MSG "path. A display server such as XImtool/SAOimage/SAOtng/DS9"
MSG "is required to be running on the local machine before an iraf"
MSG "display command (e.g. DISPLAY/TVMARK/IMEXAMINE) will work."
MSG ""
MSG "Remote displays (i.e. the server on one machine and IRAF on"
MSG "another) require either iraf networking be enabled or the X"
MSG "'DISPLAY' variable be set so the server appears on the remote"
MSG "machine."
MSG ""
MSG "XImtool can be downloaded from"
MSG ""
MSG " http://iraf.net/ftp/iraf/x11iraf"
MSG ""
MSG "or it's mirror sites. Contact http://iraf.net with questions."
NEWLINE
set err_count = `expr $err_count + 1`
endif
NEWLINE
echo -n "Graphics Terminals Available: "
set found = 0
foreach i ($GRAPHICS_TERMS)
set p = `which $i |& grep "^\/"`
if ($status == 0) then
if ("$found" == 0) then
DO_OK
set ok_count = `expr $ok_count + 1`
endif
set d = `$LS $LSDF $p | head -2 | tail -1`
echo $d | awk '{printf (" ( Date: %3s %2s %-5s )\t", $7, $8, $9) }'
echo " "`which $i`
set found = 1
endif
end
if ($found == 0) then
DO_FAIL ; set errstat = 1
echo " None Found"
NEWLINE
MSG "No 'xterm' or 'xgterm' binary was found on this systen or"
MSG "in the user path. IRAF graphics require some form of "
MSG "graphics-enabled terminal window to be running or else"
MSG "garbarge characters will appear on the screen. Windows"
MSG "such as 'cmdtool', 'rxvt', 'aixterm', 'hpterm', 'decterm'"
MSG "do not support graphics and should not be used for IRAF."
MSG ""
MSG "The default terminal type is set in the login.cl when"
MSG "a user runs MKIRAF, this is the type of window they should"
MSG "be running when starting IRAF. Users can use the 'show"
MSG "terminal' command to see the current setting, or 'stty"
MSG "xterm' or 'stty xgterm' command (or rerun MKIRAF and reset"
MSG "the default terminal type) to change the default iraf terminal."
MSG ""
MSG "XGterm can be downloaded from"
MSG ""
MSG " http://iraf.net/ftp/iraf/x11iraf"
MSG ""
MSG "or it's mirror sites. Contact site support with questions."
set err_count = `expr $err_count + 1`
endif
NEWLINE
# Check for imtoolrc file and /usr/local/lib dir.
set errstat = 0
NEWLINE
echo -n "Checking for /usr/local/lib directory ... "
if (-d /usr/local/lib) then
DO_OK
set ok_count = `expr $ok_count + 1`
# Check for imtoolrc file...
echo -n "Checking for imtoolrc file ... "
if (-e $IMTOOLRC) then
DO_OK
set ok_count = `expr $ok_count + 1`
set islink = `$LS -l $IMTOOLRC | grep "^l"`
set file = $iraf/dev/imtoolrc
if ("$islink" != "" && -e $file) then
# Check for valid link
echo -n "Checking for valid imtoolrc link ... "
set tmp = `diff $IMTOOLRC $file | wc -l`
if ("$tmp" == 0) then
DO_OK
set ok_count = `expr $ok_count + 1`
else
DO_FAIL ; set errstat = 1
NEWLINE
MSG "The /usr/local/lib/imtoolrc link is invalid"
NEWLINE
set err_count = `expr $err_count + 1`
endif
endif
else
DO_FAIL ; set errstat = 1
NEWLINE
MSG "The /usr/local/lib/imtoolrc file is missing."
MSG "This normally gets created by the iraf install script"
MSG "but only if /usr/local/lib already exists. Without"
MSG "this file you won't be able to use ximtool with a buffer"
MSG "larger than 512x512, to fix this just create the"
MSG "/usr/local/lib dir and rerun the install script or"
MSG "make the link by hand as the root user."
NEWLINE
set err_count = `expr $err_count + 1`
endif
# Check for imtoolcmap directory...
if ($have_ximtool == 1) then
echo -n "Checking for imtoolcmap directory ... "
if (-d /usr/local/lib/imtoolcmap) then
DO_OK
set ok_count = `expr $ok_count + 1`
else
DO_WARN
NEWLINE
MSG "The /usr/local/lib/imtoolcmap directory is missing."
MSG "This directory is not required but provides extra"
MSG "colormap options for XImtool. The colormaps may be"
MSG "be obtained from "
MSG ""
MSG " http://iraf.net/ftp/iraf/x11iraf/imtoolcmap.tar"
MSG ""
MSG "This should be unpacked as the /usr/local/lib/imtoolcmap"
MSG "directory. This is not a fatal error."
NEWLINE
set warn_count = `expr $warn_count + 1`
endif
endif
else
DO_FAIL ; set errstat = 1
NEWLINE
MSG "The /usr/local/lib directory does not exist."
NEWLINE
set err_count = `expr $err_count + 1`
endif
if ($errstat == 1) then
MSG "The imtoolrc file is used by the display servers (XImtool,"
MSG "SAOimage, etc) to set various frame buffer sizes. Without"
MSG "this file the server can only use a 512x512 frame buffer,"
MSG "and displays to larger buffers will result in the message"
MSG "'attempt to write out of bounds on framebuf'. Sites can"
MSG "rerun the install script or make the link by hand, users"
MSG 'can copy the dev$imtoolrc file to their $HOME directory as'
MSG "'.imtoolrc' as a workaround."
endif
if ($have_saoimage == 1) then
echo -n "Checking file descriptor limits: "
set ds = `limit descriptors | awk '{print ($2)}'`
if ("$ds" != "64") then
DO_WARN
NEWLINE
MSG "SAOimage has a hardwired restriction of 64 file descriptors,"
MSG "however this user shell allows more. When there are many"
MSG "windws open SAOimage may fail, this warning applies only"
MSG "to users of SAOimage. A 'limit descriptors 64' command"
MSG "can be used to reset the limit."
NEWLINE
set warn_count = `expr $warn_count + 1`
else
DO_OK
endif
endif
# See whether we have fifo pipes installed.
set errstat = 0
if ( !($pciraf && ($mach == "macosx" || $mach == "macintel")) ) then
foreach p (/dev/imt1i /dev/imt1o)
echo -n "Checking for $p fifo pipe ... "
if (-e $p) then
if ("`$LS -l $p | grep '.rw.rw.rw.'`" == "") then
if ($have_sockets == 1) then
DO_WARN ; set errstat = 1
set warn_count = `expr $warn_count + 1`
else
DO_FAIL ; set errstat = 1
set err_count = `expr $err_count + 1`
endif
MSG "File $p not mode 666."
else
DO_OK
set ok_count = `expr $ok_count + 1`
endif
else
if ($have_sockets == 1) then
DO_WARN ; set errstat = 1
set warn_count = `expr $warn_count + 1`
else
DO_FAIL ; set errstat = 1
set err_count = `expr $err_count + 1`
endif
MSG "The $p fifo pipe is missing."
endif
end
echo -n "Checking for /dev/imt1 fifo pipe link ... "
if (-e /dev/imt1) then
if ("`$LS -l /dev/imt1 | grep imt1o`" != "") then
DO_OK
set ok_count = `expr $ok_count + 1`
else
if ($have_sockets == 1) then
DO_WARN ; set errstat = 1
set warn_count = `expr $warn_count + 1`
else
DO_FAIL ; set errstat = 1
set err_count = `expr $err_count + 1`
endif
MSG "The /dev/imt1 fifo pipe link is invalid."
endif
else
if ($have_sockets == 1) then
DO_WARN ; set errstat = 1
set warn_count = `expr $warn_count + 1`
else
DO_FAIL ; set errstat = 1
set err_count = `expr $err_count + 1`
endif
MSG "The /dev/imt1 fifo pipe link is missing (but is not"
MSG "strictly required for proper display). If it exists it"
MSG "should be a symlink pointing to /dev/imt1o."
endif
if ($errstat == 1 && $have_sockets == 0) then
NEWLINE
MSG "The /dev fifo pipes are used only by SAOimage as a default"
MSG "communication with IRAF or as a fallback for other display"
MSG "servers such as XImtool. Except for SAOimage or in the case"
MSG "of some other mechanism such as a private graphcap file or"
MSG "IMTDEV environment variable, missing /dev pipes should not be"
MSG "fatal for image display. A 'Cannot open device' message may"
MSG "simply mean there is no display server running, or the 'node'"
MSG "CL environment variable has been set to an invalid node or"
MSG "iraf networking is not enabled on the host. The pipes are"
MSG "created by the install script (which can be run on this host)"
MSG "or they can be created by hand as root with the 'mknod' or"
MSG "'mkfifo' command."
NEWLINE
endif
endif
# Make sure there are entries in the the termcap and graphcap files for xgterm
# and imtool.
echo -n "Checking termcap file for an XGterm entry ... "
set temp = `grep -l xgterm $termcap_file | grep -v "^#"`
if ("$temp" == "") then
DO_FAIL ; set errstat = 1
set err_count = `expr $err_count + 1`
else
DO_OK
set ok_count = `expr $ok_count + 1`
endif
echo -n "Checking graphcap file for XGterm/imtool entries ... "
set gcok = yes
foreach i (xgterm imtool)
set temp = `grep -l $i $graphcap_file | grep -v "^#"`
if ("$temp" == "" && "$gcok" == "yes") then
DO_FAIL ; set errstat = 1
set err_count = `expr $err_count + 1`
set gcok = no
endif
end
if ($gcok == yes) then
DO_OK
set ok_count = `expr $ok_count + 1`
endif
if ($early_exit == 1) then
goto exit_early
endif
#=============================================================================
# Tape Device Information
#=============================================================================
Tape_Device:
NEWLINE
echo "====================== Tape Device Information ======================="
NEWLINE
set errstat = 0
if (! ($?tapecap_file)) then
set tapecap_file = "$iraf/dev/tapecap"
endif
# Check the alloc.e binary.
NEWLINE
set file = "$iraf/unix/bin.$hmach/alloc.e"
echo -n 'Checking for hbin$alloc.e binary ... '
if (-e $file) then
DO_OK
set ok_count = `expr $ok_count + 1`
echo -n 'Checking hbin$alloc.e ownership ... '
if (-e $file) then
if ("`$LS -l $file | grep 'root'`" == "") then
DO_FAIL
set errstat = 1 ; set err_count = `expr $err_count + 1`
echo " *** File $file:t not owned by root."
else
DO_OK
set ok_count = `expr $ok_count + 1`
endif
endif
echo -n 'Checking hbin$alloc.e binary permissions ... '
if (-e $file) then
if ("`$LS -l $file | grep '.rwsr.xr.x'`" == "") then
DO_FAIL
set errstat = 1 ; set err_count = `expr $err_count + 1`
echo " *** File $file:t not mode 4755."
else
DO_OK
set ok_count = `expr $ok_count + 1`
endif
endif
if ($errstat == 1) then
NEWLINE
MSG "The alloc.e binary is used to allocate tape devices"
MSG "for exclusive access by the user. It does this by"
MSG "changing the ownership and permissions on the /dev"
MSG "files associated with each device. For this reason"
MSG "it must be owned by root with setuid permissions so"
MSG "it can execute properly. Tape devices are not required"
MSG "to be allocated before they are used but executing the"
MSG "ALLOC command w/in iraf will result in an error."
MSG "This error can be cleared by running the IRAF install"
MSG "script as root, or issuing the commands:"
MSG ""
MSG " # cd $hbin"
MSG " # chown 0 alloc.e ; chmod 4755 alloc.e"
NEWLINE
endif
else
DO_FAIL ; set errstat = 1
set err_count = `expr $err_count + 1`
MSG "File $file not found."
endif
# Check for a tapecap file.
set errstat = 0
NEWLINE
echo -n 'Checking for tapecap file ... '
if (-e $iraf/dev/tapecap.`hostname`) then
DO_OK
set ok_count = `expr $ok_count + 1`
echo " Using file: $iraf/dev/tapecap.`hostname`"
else
if (-e $tapecap_file) then
DO_OK
set ok_count = `expr $ok_count + 1`
echo " Using tapecap file: $tapecap_file"
else
DO_FAIL ; set errstat = 1
set err_count = `expr $err_count + 1`
endif
endif
if ($errstat == 1) then
NEWLINE
MSG 'No tapecap file found on this system.'
NEWLINE
MSG 'IRAF will first attempt to find a file in the iraf$dev'
MSG 'directory called "tapecap.\<node\>", if that fails it will'
MSG 'fallback to use the dev$tapecap file (or whichever file is'
MSG 'named by the 'tapecap' variable in the hlib$zzsetenv.def file).'
MSG ''
MSG 'Not all IRAF distributions come with a default tapecap file'
MSG 'appropriate for the given machine. For example, the default'
MSG 'dev$tapecap for Sun/IRAF is for SunOS and will not generally'
MSG 'work for Solaris. The PC-IRAF distribution comes with generic'
MSG 'tapecap.linux, tapecap.freebsd, etc files which must be renamed'
MSG '"tapecap" to be used. Generic device entries are provided with'
MSG 'each tapecap file (e.g. mtp for a DAT on unit 0) but in most'
MSG 'cases the tapecap file must be installed and/or configured'
MSG 'before devices will be accessible.'
MSG ''
MSG 'Further information on configuring tapecaps can be found in'
MSG 'the last IRAF Newsletter at:'
MSG ''
MSG ' http://iraf.noao.edu/irafnews/apr98/irafnews.1f.html'
MSG ''
MSG 'or by contacting http://iraf.net'
NEWLINE
endif
NEWLINE
echo "Tape Device Template: $TAPES"
set nloks = `$LS -lL /tmp/*.lok |& grep -v -i "no match" | wc -l`
if ($nloks == 0) then
set nloks = "<none>"
endif
echo "Lok Files on this machine: $nloks"
if ("$nloks" != '<none>') then
$LS -lL /tmp/*.lok
endif
NEWLINE
set ntapes = `$LS -lL $TAPES |& grep -v -i "no match" | wc -l`
if ($ntapes == 0) then
set ntapes = "<none>"
endif
echo "Tape Devices Available: $ntapes"
NEWLINE
if ("$ntapes" != '<none>') then
NEWLINE
echo " ******************************************************************"
echo " ** More tape devices files may be defined than there are actual **"
echo " ** devices on the machine. For those file which correspond to **"
echo " ** a physical device the file should have mode 666 and be owned **"
echo " ** by root. **"
echo " ******************************************************************"
NEWLINE
ls -lL $TAPES
endif
if ($early_exit == 1) then
goto exit_early
endif
#=============================================================================
# External Package Information
#=============================================================================
External_Packages:
NEWLINE
echo "=================== External Package Information ====================="
NEWLINE
# Check the iraf root directory stuff
if ($?iraf == 1) then
set hlib = $iraf/unix/hlib
else
if (-e /usr/include/iraf.h) then
set ip = `grep "^#define IRAF" /usr/include/iraf.h |sed -e 's/\"//g'`
if ("$ip" != "") then
set iraf = $ip[3]
endif
set hlib = $iraf/unix/hlib
else
MSG "No 'iraf' defined in your environment and no <iraf.h>"
MSG "file found on this system."
MSG ""
MSG "Aborting..."
endif
endif
# Strip off any trailing '/'.
set iraf = `echo $iraf | sed -e 's+/\(["]*\)$+\1+'`
set epkg = $hlib/extern.pkg
# Get the helpdb string.
set helpdb = `cat $epkg | grep -v "^#" | grep helpdb`
# Get the list of tasks defined in the extern.pkg file.
set t = `cat $epkg | grep -v "^#" | grep task | sed -e 's/task//g' -e 's/=//g' -e 's/\.pkg//g' -e 's/\$//g'`
set tasks = ""
while ("$t[1]" != "")
set tasks = `echo $tasks $t[1]`
shift t ; shift t
if ("$#t" == "0") then
break
endif
end
# Get the variables and paths declared, includes data directories.
cat $epkg | grep -v "^#" | grep -v helpdb | grep ^set > /tmp/_ext$$
cat $epkg | grep -v "^#" | grep -v helpdb | grep ^reset >> /tmp/_ext$$
set l = `cat /tmp/_ext$$ | sed -e 's/reset//g' -e 's/set//g' -e 's/=//g'`
set pkg = ""
set ppath = ""
while ("$l[1]" != "")
set pkg = `echo $pkg $l[1]`
set ppath = `echo $ppath $l[2]`
shift l; shift l
if ("$#l" == "0") then
break
endif
end
RM /tmp/_ext$$
NEWLINE
echo " 1) The 'Path' check verifies that the extern.pkg path exists and is"
echo " not located in the iraf root directory (NOAO excepted)."
echo " 2) The 'Helpdb' check verifies that the package is declared in the"
echo " helpdb string. A warning here indicates the helpdb.mip file is"
echo " out of date w.r.t the package .hd files. Help database files may"
echo " be updated using the SOFTOOLS.MKHELPDB task."
echo " 3) The 'Binaries' check prints the most recent file date for the"
echo " installed binaries. A failed test indicates no binaries for"
echo " the current architecture."
echo " 4) The date given is the date of the most recent file in the named"
echo " bin directory. Dates before 12/99 indicate binaries which should"
echo " be recompiled for Y2K compliance (assuming IRAF V2.11.3 or later"
echo " is available on the machine)."
NEWLINE
NEWLINE
echo "Number of declared packages: " $#tasks
echo "Number of logical directories: " $#ppath
NEWLINE
echo "Checking packages ..."
NEWLINE
echo " Package Path Helpdb Binaries Date"
echo " ------- ---- ------ -------- ----"
#NEWLINE
set CL = $iraf/bin.$mach/cl.e
if (! -e $CL) then
echo "ERROR: CL executable not found, skipping package checks..."
set err_count = `expr $err_count + 1`
goto exit_early
endif
set lp = ""
set lpath = ""
set delpak = ()
set delpak_p = ()
foreach p ($pkg)
set decl = `cat $epkg | grep task | grep $p`
set pat = $ppath[1]
if ("$decl" != "") then
# See if this is an iraf logical path and resolve it.
echo $pat | egrep '\$' >& /dev/null
if ($status == 0) then
set cmd = `echo $pat | awk '{printf("=osfn(\"%s\");logout\n", $1)}'`
echo "#\!$CL -f" > /tmp/_cmd$$
echo $cmd >> /tmp/_cmd$$
chmod 755 /tmp/_cmd$$
set pat = `/tmp/_cmd$$`
rm -rf /tmp/_cmd$$
endif
# Check that the path exists.
if (-d $pat) then
echo $p | awk '{printf ("%12.12s", $1 ) }'
if ("$p" == "noao") then
BOLD_ON
echo -n " [ OK ]"
BOLD_OFF
set ok_count = `expr $ok_count + 1`
else
if (`echo $pat | grep $iraf` == "") then
BOLD_ON
echo -n " [ OK ]"
BOLD_OFF
set ok_count = `expr $ok_count + 1`
else if (`echo $pat | grep $iraf | grep "/\.\."` != "") then
BOLD_ON
echo -n " [ OK ]"
BOLD_OFF
set ok_count = `expr $ok_count + 1`
else
BOLD_ON
echo " [FAIL] " ; set errstat = 1
BOLD_OFF
echo " *** invalid path: $p = $pat"
echo " *** package should not be in iraf root dir"
set err_count = `expr $err_count + 1`
set delpak = ($delpak $p)
set delpak_p = ($delpak_p $pat)
goto pkg_err
endif
endif
else
set delpak = ($delpak $p)
set delpak_p = ($delpak_p $pat)
set err_count = `expr $err_count + 1`
goto pkg_err
endif
# See if the package was declared with help.
echo $helpdb | grep $p >& /dev/null
if ($status == 0) then
# The package has help but we'll assume the standard help
# database name and look to see if the helpdb itself is current.
# The helpdb.mip file should be newer than any <foo>.hd files in
# the package tree.
if (-e $pat/lib/helpdb.mip) then
set pkgp = `echo $pat | sed -e 's+/\(["]*\)$+\1+'`
set hdbfile = "$pkgp/lib/helpdb.mip"
set hdfiles = `find $pkgp -name \*.hd -a -newer $hdbfile -print`
if ("$hdfiles" != "") then
echo -n " [WARN] "
set warn_count = `expr $warn_count + 1`
else
echo -n " [ OK ] "
set ok_count = `expr $ok_count + 1`
endif
else
echo -n " [ OK ] "
set ok_count = `expr $ok_count + 1`
endif
else
echo -n " [FAIL] " ; set errstat = 1
set err_count = `expr $err_count + 1`
endif
# See if binaries exist for this platform.
set dir = $pat/bin.$mach
if (-d $dir) then
if (`$LS -lL $dir | wc -l` > 1) then
set d = `$LS $LSDF $pat/bin.$mach/* | head -2 | tail -1`
set dat = `echo $d |awk '{printf("%s %s %s",$7,$8,$9)}'`
#echo -n "[ OK ]"
if ("`echo $dat | grep 199 | grep Dec`" == "") then
if ("`echo $dat | grep 200`" == "" && "`echo $dat | grep ':'`" == "") then
echo -n "[WARN]"
set warn_count = `expr $warn_count + 1`
else
echo -n "[ OK ]"
set ok_count = `expr $ok_count + 1`
endif
else
echo -n "[ OK ]"
set ok_count = `expr $ok_count + 1`
endif
echo $d | awk '{printf ("\t%3s %2s %-5s", $7, $8, $9) }'
echo " "bin.$mach
else
echo -n "[FAIL] " ; set errstat = 1
set err_count = `expr $err_count + 1`
echo "<not found> "bin.$mach
#goto pkg_err
endif
else
echo -n "[FAIL] " ; set errstat = 1
echo "<not found> "bin.$mach
set err_count = `expr $err_count + 1`
endif
# Check for other architectures installed
if (-e $pat/bin) then
if (-e $pat/bin.$mach) then
foreach dir ($pat/bin.*)
set b = $dir:t
if ("$b" != "bin.generic" && "$b" != "bin.$mach") then
if (`$LS -l $dir | wc -l` > 1) then
set d = `$LS $LSDF $pat/$b/* | head -2 | tail -1`
set dat = `echo $d |awk '{printf("%s %s %s",$7,$8,$9)}'`
echo -n " "
if ("`echo $dat | grep 199 | grep Dec`" == "") then
if ("`echo $dat | grep 200`" == "" && "`echo $dat | grep ':'`" == "") then
echo -n " [WARN] "
set warn_count = `expr $warn_count + 1`
else
echo -n " [ OK ] "
set ok_count = `expr $ok_count + 1`
endif
else
echo -n " [ OK ] "
set ok_count = `expr $ok_count + 1`
endif
echo $d |awk '{printf ("%3s %2s %-5s", $7, $8, $9)}'
echo " "$b
endif
endif
end
endif
endif
#NEWLINE
else
set lp = `echo $lp $p`
set lpath = `echo $lpath $pat`
endif
pkg_err:
shift ppath
end
# Report unnecessary packages or logical dirs.
set npack = $#delpak
if ($npack != 0) then
NEWLINE
NEWLINE
MSG "The folowing packages were declared but do not exist on the"
MSG 'current platform and can be removed from the hlib$extern.pkg'
MSG "file:"
MSG ""
set i = 1
while ($i <= $npack)
echo $delpak[$i] $delpak_p[$i] | \
awk '{printf (" ***\t%16s = %s\n", $1, $2)}'
set i = `expr $i + 1`
end
MSG ""
endif
# Now check logical directories defined in the file.
set dellog = ()
set dellog_p = ()
if ("$lp" != "") then
NEWLINE
NEWLINE
echo "Checking logical directories ..."
NEWLINE
echo " Logical Directory Path"
echo " ----------------- ----"
foreach p ($lp)
set pat = $lpath[1]
echo $p | awk '{printf ("%20.20s", $1 ) }'
# See if this is an iraf logical path and resolve it.
echo $pat | egrep '\$' >& /dev/null
if ($status == 0) then
set cmd = `echo $pat | awk '{printf("=osfn(\"%s\");logout\n", $1)}'`
echo "#\!$CL -f" > /tmp/_cmd$$
echo $cmd >> /tmp/_cmd$$
chmod 755 /tmp/_cmd$$
set pat = `/tmp/_cmd$$`
rm -rf /tmp/_cmd$$
endif
if (-d $pat) then
echo " [ OK ]"
set ok_count = `expr $ok_count + 1`
else
echo -n " [ FAIL ]" ; set errstat = 1
echo " *** invalid path"
set dellog = ($dellog $p)
set dellog_p = ($dellog_p $pat)
set err_count = `expr $err_count + 1`
endif
shift lpath
end
endif
set nlog = $#dellog
if ($nlog != 0) then
NEWLINE
NEWLINE
MSG "The folowing logical directories were found to be invalid for"
MSG 'current platform and can be removed from the hlib$extern.pkg'
MSG "file:"
MSG ""
set i = 1
while ($i <= $nlog)
echo $dellog[$i] $dellog_p[$i] | \
awk '{printf (" ***\t%16s = %s\n", $1, $2)}'
set i = `expr $i + 1`
end
MSG ""
endif
exit_early:
NEWLINE
NEWLINE
echo "======================================================================"
NEWLINE
echo "SYSINFO completed with: Tests Passed: $ok_count"
echo " Warnings: $warn_count"
echo " Errors: $err_count"
if ($err_count > 0) then
NEWLINE
echo " Not all errors listed here will be fatal but may indicate a"
echo " problem with some aspect of the system, or will reveal the"
echo " likely cause of a problem currently being seen."
NEWLINE
echo " Users should contact http://iraf.net if help is needed with"
echo " correcting any problems, or with suggestions/comments for"
echo " future versions of this diagnostic script."
endif
NEWLINE
echo "======================================================================"
NEWLINE
sysinfo_cleanup:
RM /tmp/_cmd$$
RM /tmp/_ext$$
exit 0
# Print usage information. We will not get here unless the "-help" flag
# was issued.
Usage:
NEWLINE
echo "Usage: sysinfo [ -G | -V | -N | -P | -D | -T | -help ]"
NEWLINE
echo " where: -G Print General Info only"
echo " -V Do Verification tests only"
echo " -N Do Networking tests only"
echo " -P Do Extern Package tests only"
echo " -D Do Display tests only"
echo " -T Do Tape Device tests only"
echo " -h Print this message"
NEWLINE
|