rcconf 2.93 KB
Newer Older
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
#
# The template
#
use strict;
use libinstall;
use installvars;

sub Install($$$)
{
    my ($server, $isupdate, $impotent) = @_;

    my ($o1) = split(/\./, $FRISADDR);
    my $route_frisbee = qq|route_frisbee="-net $o1.0.0.0/8 -iface $BOSSNODE_IP"|;

    if ($isupdate) {
	Phase "frisbee", "Updating frisbee route", sub {
	    DoneIfUpdated($RCCONF, $route_frisbee);
	    UpdateFileFatal($RCCONF, [ qr(^route_frisbee) ], $route_frisbee);
	};
	return 0;
    }

    Phase "rc.conf", "Adding testbed content to $RCCONF", sub {
	DoneIfEdited($RCCONF);
	my @strings = (qq|rpcbind_enable="YES"|,
		       qq|nfs_client_enable="YES"|,
		       qq|inetd_enable="YES"|,
		       qq|inetd_flags="-wW -R 0"|,
		       qq|syslogd_flags=""|,
		       qq|tftpd_flags="-lvvvv -C 40 -s /tftpboot"|,
		       (("$APACHE_VERSION" eq "22") ?
			(qq|apache22_enable="YES"|,
			 qq|apache22_flags="-DSSL"|) :
			(qq|apache_enable="YES"|,
			 qq|apache_flags="-DSSL"|)),
		       qq|pubsubd_flags="-T 10"|);

Mike Hibler's avatar
Mike Hibler committed
38
39
	# OPSVM
	if (ISFS($server)) {
40
41
42
43
44
	    # don't enable NFS server unless we are the fileserver
	    push(@strings, qq|mountd_enable="YES"|);
	    push(@strings, qq|nfs_server_enable="YES"|);
	    push(@strings, qq|nfs_server_flags="-u -t -n 16"|);

Mike Hibler's avatar
Mike Hibler committed
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
	    if ($WINSUPPORT) {
		if ($FBSD_MAJOR > 8 || ($FBSD_MAJOR == 8 && $FBSD_MINOR > 2)) {
		    push(@strings, qq|samba_enable="YES"|);
		    push(@strings, qq|nmbd_enable="NO"|);
		} else {
		    push(@strings, qq|smbd_enable="YES"|);
		}
	    }
	    if ($QUOTA_FSLIST ne "") {
		if ($FBSD_MAJOR > 8 || ($FBSD_MAJOR == 8 && $FBSD_MINOR > 2)) {
		    push(@strings, qq|quota_enable="YES"|);
		} else {
		    push(@strings, qq|enable_quotas="YES"|);
		}
	    }
	}

62
63
64
65
	#
	# Starting at FreeBSD 6 we use the default version of bind,
	# not the port. Er, back to a port as of FreeBSD 10.
	#
66
67
68
	if ($FBSD_MAJOR < 6) {
	    push(@strings, qq|named_enable="NO"|);
	}
69
	elsif ($FBSD_MAJOR < 10) {
70
71
72
73
	    push(@strings, (qq|named_enable="YES"|,
			    qq|named_chrootdir=""|,
			    qq|named_flags=""|,
			    qq|named_uid="root"|,
74
75
76
77
78
79
80
81
			    qq|named_pidfile="$VARRUN/named.pid"|));
	}
	else {
	    push(@strings, (qq|named_enable="YES"|,
			    qq|named_conf="/etc/namedb/named.conf"|,
			    qq|named_chrootdir=""|,
			    qq|named_flags=""|,
			    qq|named_uid="root"|));
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
	}

	# At FreeBSD 6, they also changed the name of the ntp start var.
	if ($FBSD_MAJOR < 6) {
	    push(@strings, qq|xntpd_enable="YES"|);
	} else {
	    push(@strings, qq|ntpd_enable="YES"|);
	}

	# add multicast route for frisbee
	my ($o1) = split(/\./, $FRISADDR);
	push(@strings, (qq|static_routes="\$static_routes frisbee"|,
			$route_frisbee));

	# enable mrouted if needed
	if ($NEEDMROUTED) {
	    push(@strings, qq|mrouted_enable="YES"|);
	}

101
102
103
104
105
106
107
	# Turn on firewall.
	if ($FIREWALL_BOSS) {
	    push(@strings, qq|firewall_enable="YES"|);
	    push(@strings, qq|firewall_type="/etc/boss.ipfw"|);

	}

108
109
110
111
112
113
114
115
	AppendToFileFatal($RCCONF, @strings);
    };
    return 0;
}

# Local Variables:
# mode:perl
# End: