Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / afsinstall / lib / InstallGuides / SUN4x_5x / unix
1 # Copyright 2000, International Business Machines Corporation and others.
2 # All Rights Reserved.
3 #
4 # This software has been released under the terms of the IBM Public
5 # License. For details, see the LICENSE file in the top-level source
6 # directory or online at http://www.openafs.org/dl/license10.html
7
8 # An InstallGuide for the AFS modified Unix commands
9 # For Sun systems running Solaris 5.x
10 #
11
12 sub unix {
13 &Copy("etc/inetd", "/usr/sbin/inetd.afs");
14 &Copy("etc/ftpd", "/usr/sbin/in.ftpd.afs");
15
16 &ErrorsAreFatal(1);
17 &Patch::Verbose if ($InstallVerbose);
18 &CreateDir("/usr/vice/bin");
19
20 &Copy("bin/rcp", "/usr/vice/bin");
21 &Chown (0,2, "/usr/vice/bin/rcp");
22 &Chmod (04755, "/usr/vice/bin/rcp");
23
24 &Copy("bin/rsh", "/usr/vice/bin");
25 &Chown (0,2, "/usr/vice/bin/rsh");
26 &Chmod (04755, "/usr/vice/bin/rsh");
27
28 # Create the inetd.conf.afs file
29 $InetdConfAfs = "/etc/inet/inetd.conf.afs";
30 open(INETD, ">$InetdConfAfs") || &ErrorMsg("Can't open file", $InetdConfAfs);
31 print INETD <<"EOINETD";
32 ftp stream tcp nowait root /usr/sbin/in.ftpd.afs in.ftpd.afs
33 shell stream tcp nowait root /usr/sbin/in.rshd in.rshd
34 ta-rauth stream tcp nowait root internal ta-rauth
35 EOINETD
36 &Symlink("./inet/inetd.conf.afs", "/etc/inetd.conf.afs");
37
38 # comment out the lines in inetd.conf
39 $InetdConf = "/etc/inet/inetd.conf";
40 &CopyStat($InetdConf, $InetdConfAfs);
41 &Patch::FileOpen($InetdConf);
42
43 $Search1 = "^(ftp\\s+.+)";
44 $Replace1 = '"#".$1';
45
46 $Search2 = "^(shell\\s+.+)";
47 $Replace2 = '"#".$1';
48
49 if (!&Patch::Patch($InetdConf, [[1, "Substitution", $Search1, $Replace1],
50 [1, "Substitution", $Search2, $Replace2]])) {
51 &ErrorMsg("Did not succeed with patch", $InetdConf);
52 }
53
54 # Modify the /etc/inet/services file
55 # append the ta-rauth to the services file
56 $Services = "/etc/inet/services";
57 &Patch::FileOpen($Services);
58 $ServicesAppend = "ta-rauth 601/tcp rauth";
59
60 if (!&Patch::Patch($Services, [[0, "EOF", "", $ServicesAppend]])) {
61 &ErrorMsg("Did not succeed with patch", $Services);
62 }
63 }