1 |
#!/usr/bin/perl -- |
2 |
|
3 |
# generate config scripts rather than follow the instructions |
4 |
# and have to look at all of variables to change around, |
5 |
# when most are in the 'config.local' file |
6 |
|
7 |
# 2009/04/16 : jhourcle : 1.0 : first version released |
8 |
# 2009/04/17 : jhourcle : 1.1 : don't do anything without confirmation; |
9 |
# deal with missing config AND template |
10 |
|
11 |
# LIMITATIONS : |
12 |
# assumes UNIX directory path seperators (/) |
13 |
# currently, only tested under macosx to automatically determine partition sizes |
14 |
# could hose an existing install, as I reset passwords, etc. |
15 |
# -- probably need an 'install' and an 'update' |
16 |
|
17 |
use strict; |
18 |
use warnings; |
19 |
use Data::Dumper; |
20 |
use ExtUtils::MakeMaker; |
21 |
|
22 |
#### |
23 |
# before we go any further ... |
24 |
warn <<"EOF"; |
25 |
|
26 |
This will create and/or overwrite your config.local file, and will |
27 |
generate scripts to perform the rest of a DRMS / SUMS install. |
28 |
|
29 |
Please review all files before running them for unescaped characters. |
30 |
|
31 |
EOF |
32 |
exit if ( my $flag = prompt ('Continue?', 'yes') ) !~ m/^[yY]/; |
33 |
#### |
34 |
|
35 |
##### |
36 |
# configuration ( for the script ) |
37 |
|
38 |
# where we expect the file to be |
39 |
my $config = 'config.local'; |
40 |
|
41 |
# where we dump the generated scripts to |
42 |
my $output_dir = 'setup_scripts'; |
43 |
|
44 |
# if true, don't bother prompting for changes to |
45 |
# the config file |
46 |
my $noprompt = 0; |
47 |
|
48 |
# verbosity level |
49 |
my $verbose = 0; |
50 |
|
51 |
# the fields we need in the config script. |
52 |
# (I _could_ read this from config.local.template, but I don't |
53 |
# know if that's always safe) |
54 |
|
55 |
my @fields = qw ( |
56 |
LOCAL_CONFIG_SET |
57 |
DRMS_DATABASE |
58 |
DBSERVER_HOST |
59 |
DRMS_SITE_CODE |
60 |
POSTGRES_ADMIN |
61 |
POSTGRES_INCS |
62 |
POSTGRES_LIBS |
63 |
SUMS_MANAGER |
64 |
SUMS_SERVER_HOST |
65 |
SUMS_LOG_BASEDIR |
66 |
THIRD_PARTY_LIBS |
67 |
THIRD_PARTY_INCS |
68 |
DRMS_SAMPLE_NAMESPACE |
69 |
|
70 |
POSTGRES_DATA_DIR |
71 |
SUMS_PARTITIONS |
72 |
SUMS_FILL_TO_LINE |
73 |
SUMS_GROUP |
74 |
SUMS_USER |
75 |
DRMS |
76 |
); |
77 |
|
78 |
|
79 |
##### |
80 |
# Check what options were passed in |
81 |
|
82 |
use Getopt::Long; |
83 |
GetOptions( |
84 |
'config=s' => \$config, |
85 |
'output=s' => \$output_dir, |
86 |
noprompt => \$noprompt, |
87 |
'verbose:+' => \$verbose |
88 |
); |
89 |
|
90 |
##### |
91 |
# setup other variables |
92 |
|
93 |
my $EOL = $verbose > 2 ? '' : "\n" ; |
94 |
|
95 |
if ($noprompt) { $ENV{'PERL_MM_USE_DEFAULT'} = 1 }; |
96 |
|
97 |
if ($verbose > 2) { print <<EOF; } |
98 |
|
99 |
verbosity : $verbose |
100 |
noprompt? : $noprompt |
101 |
config : $config |
102 |
out dir : $output_dir |
103 |
|
104 |
EOF |
105 |
|
106 |
#### |
107 |
# TODO : prompt to create or update the config file |
108 |
|
109 |
# read the config file |
110 |
# this might seem strange -- we'll copy the template to make the config file, |
111 |
# but we want to find the config file to look to see where the template might |
112 |
# be (so we can pull in the descriptions) |
113 |
|
114 |
my ($config_lines, %config); |
115 |
|
116 |
if ( defined($config) and -f $config) { |
117 |
($config_lines, %config) = read_config($config); |
118 |
} |
119 |
|
120 |
sub read_config { |
121 |
my $config = shift; |
122 |
print "Reading config file ($config) ...\n" if $verbose; |
123 |
|
124 |
open (CONFIG, '<', $config ) |
125 |
or die "Can't read from config file ($config) : $!$EOL"; |
126 |
my @config = <CONFIG>; |
127 |
my %config = map { |
128 |
my ($key,$val) = m/(\S+)\s+(.*)/; |
129 |
if ( defined($val) ) { |
130 |
($key,$val); |
131 |
} else { |
132 |
warn "unparsed line : $_$EOL"; |
133 |
(); |
134 |
} |
135 |
} grep { m/\S/ } grep { ! m/^#/ } @config; |
136 |
close (CONFIG); |
137 |
return(\@config, %config); |
138 |
} |
139 |
|
140 |
# check on the template file |
141 |
|
142 |
warn "Checking template ... $EOL" if $verbose; |
143 |
|
144 |
my $template; |
145 |
my @templates = qw( ./config.local.template ); |
146 |
if ( defined($config) ) { unshift @templates, "$config.template" } |
147 |
if ( defined($config{DRMS}) ) { unshift @templates, "$config{DRMS}/config.local.template" } |
148 |
foreach my $test ( @templates ) { |
149 |
if ( -f $test ) { $template = $test; last } |
150 |
} |
151 |
|
152 |
my @template_file = <DATA>; |
153 |
if ( ! -f $config and defined($template) ) { |
154 |
print "\nUsing template to generate config file\n\n"; |
155 |
# no config file |
156 |
use File::Copy; |
157 |
if ( ! copy( $template, $config ) ) { |
158 |
warn "Can't copy template : $!$EOL"; |
159 |
if ( ! @$config_lines ) { |
160 |
die "No config file, and can't copy template. Aborting.$EOL"; |
161 |
} |
162 |
} |
163 |
($config_lines, %config) = read_config($config); |
164 |
} elsif ( ! -f $config ) { |
165 |
# use the contents of the __DATA__ section as the template |
166 |
warn "\nNo template file! Regenerating from script.\n $EOL"; |
167 |
if ( open ( CONFIG, '>', $config ) ) { |
168 |
print CONFIG @template_file; |
169 |
close CONFIG |
170 |
or warn "Can't save config ($config) : $!$EOL"; |
171 |
($config_lines, %config) = read_config($config); |
172 |
} else { |
173 |
warn "Can't write config ($config) :$!$EOL"; |
174 |
} |
175 |
} |
176 |
|
177 |
# read the template file for its comments. |
178 |
|
179 |
warn "Reading template ($template) ... $EOL" if $verbose; |
180 |
|
181 |
# you _could_ set some values here, but take a look in the __DATA__ block |
182 |
# first |
183 |
my %descriptions = (); |
184 |
my %template_defaults = (); |
185 |
|
186 |
if ( defined($template) and -f $template ) { |
187 |
open (TEMPLATE, '<', $template) |
188 |
or warn "Can't read template ($template) : $!$EOL" |
189 |
and last; |
190 |
push ( @template_file, <TEMPLATE> ); |
191 |
close TEMPLATE; |
192 |
} |
193 |
|
194 |
my $description = ''; |
195 |
while ( @template_file ) { |
196 |
my $line = shift @template_file; |
197 |
|
198 |
if ($line =~ m/^\s*$/) { # empty line |
199 |
$description = ''; |
200 |
next; |
201 |
} |
202 |
if ($line =~ m/^\s*#/) { # starts with '#' |
203 |
$description .= $line; |
204 |
next; |
205 |
} |
206 |
if ( $line =~ m/(\S+)\s+(.*)/ ) { # something got set |
207 |
my ($key,$val) = ($1,$2); |
208 |
chomp $val; |
209 |
$descriptions{$key} = $description; |
210 |
$template_defaults{$key} = $val; |
211 |
$description = ''; |
212 |
} |
213 |
} |
214 |
|
215 |
|
216 |
# are there any config options in the template that were NOT in the hard coded list? |
217 |
# if so, we'll need to prompt for them, too. |
218 |
|
219 |
my %known_fields = map { $_ => undef } @fields; |
220 |
my @unknown_fields = grep { ! exists $known_fields{$_} } keys %template_defaults; |
221 |
|
222 |
if (@unknown_fields) { |
223 |
warn "Unknown field in template : @unknown_fields $EOL" if $verbose; |
224 |
push @fields, @unknown_fields; |
225 |
} |
226 |
|
227 |
|
228 |
##### |
229 |
|
230 |
|
231 |
warn "Verifying config ...\n" if $verbose; |
232 |
|
233 |
my $config_changed = 0; |
234 |
while ( 1 ) { |
235 |
|
236 |
# prompt to update / change values |
237 |
print "Current configuration settings:\n", |
238 |
map { sprintf " %32s : %s\n", $_, (defined($config{$_})?$config{$_}:'(undefined)') } @fields; |
239 |
|
240 |
my $response = prompt( "Use current settings?", 'yes' ); |
241 |
last if $response =~ m/^[yY]/; # exit current (CHANGECONFIG) block |
242 |
|
243 |
warn "setting changed flag ...$EOL" if $verbose; |
244 |
$config_changed = 1; |
245 |
|
246 |
foreach my $field (@fields) { |
247 |
print $descriptions{$field}; |
248 |
$config{$field} = prompt( $field, $config{$field} ); |
249 |
} |
250 |
} |
251 |
|
252 |
warn "Config changed status : $config_changed $EOL" if $verbose; |
253 |
|
254 |
if ($config_changed) { |
255 |
# we try to use the existing order of the config file, but add in |
256 |
# new values (w/ descriptions) at the end. |
257 |
|
258 |
# note -- this will remove 'comment' blocks in the template |
259 |
# that aren't directly before a variable. |
260 |
|
261 |
warn "Generating new config file ... $EOL" if $verbose; |
262 |
|
263 |
my @new_config; |
264 |
my %unprocessed = map { ($_ => undef) } @fields; |
265 |
|
266 |
|
267 |
while ( @$config_lines ) { |
268 |
my $line = pop @$config_lines; |
269 |
if ( $line =~ m/^\s*(#|$)/ ) { |
270 |
unshift (@new_config, $line); |
271 |
} elsif ( $line =~ m/(\S+)\s+(.*)/ ) { |
272 |
my $field = $1; |
273 |
unshift (@new_config, "$field\t$config{$field}\n"); |
274 |
delete($unprocessed{$field}); |
275 |
} else { |
276 |
unshift (@new_config, $line); |
277 |
} |
278 |
} |
279 |
|
280 |
warn "Unprocessed fields : @{[ keys %unprocessed ]} $EOL" if $verbose > 2; |
281 |
|
282 |
warn "Checking new items ... $EOL" if $verbose; |
283 |
if ( scalar %unprocessed ) { |
284 |
foreach my $field (@fields) { |
285 |
next if !exists($unprocessed{$field}); |
286 |
push (@new_config, "\n", $descriptions{$field}, "$field\t$config{$field}\n"); |
287 |
} |
288 |
} |
289 |
|
290 |
warn "Writing config file ($config) ... $EOL" if $verbose; |
291 |
if ( open (CONFIG, '>', $config) ) { |
292 |
warn "Config file contents :", Dumper(\@new_config) if $verbose > 2; |
293 |
print CONFIG @new_config; |
294 |
close (CONFIG) |
295 |
or warn "Can't save to config file ($config) : $!\nConfig changes not saved\n $EOL"; |
296 |
} else { |
297 |
warn "Can't write to config file ($config) : $!\nConfig changes not saved\n $EOL"; |
298 |
} |
299 |
warn "... done $EOL" if $verbose; |
300 |
} |
301 |
|
302 |
|
303 |
# check to make sure we got all of the fields we care about. |
304 |
|
305 |
print "Checking config values ...\n" if $verbose; |
306 |
|
307 |
my $missing = 0; |
308 |
foreach my $field (@fields) { |
309 |
if (!defined($config{$field})) { |
310 |
$missing++; |
311 |
warn "Config file is missing value for : $field$EOL"; |
312 |
} |
313 |
} |
314 |
die "Aborting$EOL" if $missing; |
315 |
|
316 |
|
317 |
##### |
318 |
# prep directory to output to |
319 |
|
320 |
if ( ! -d $output_dir ) { |
321 |
if ( ! -e $output_dir ) { |
322 |
mkdir ($output_dir) or |
323 |
die "Can't create directory ($output_dir) : $!$EOL"; |
324 |
} else { |
325 |
die "Output directory exists but isn't a directory ($output_dir) $EOL"; |
326 |
} |
327 |
} |
328 |
|
329 |
#### |
330 |
# now we write some files |
331 |
|
332 |
write_file( 'README', <<"EOF" ); |
333 |
|
334 |
# Configuration scripts for NetDRMS generated at |
335 |
# @{[ scalar localtime() ]} |
336 |
|
337 |
The following scripts should be generated, that you will need |
338 |
to run: |
339 |
|
340 |
01_create_databases.sh |
341 |
To be run as the database user ($config{POSTGRES_ADMIN}) |
342 |
Will generate the postgres databases for DRMS and SUMS |
343 |
and call the sql scripts to create the necessary tables |
344 |
|
345 |
03_create_sums_partitions.pl |
346 |
Perl script to make the SUMS partitions and set their |
347 |
ownership. Should be run as root or via sudo. |
348 |
(but you should look at it first, and make sure there's no |
349 |
unescaped characters) |
350 |
|
351 |
start_sums |
352 |
This is called as part of the '01_create_databases.sh' |
353 |
script, but it's there as a convenience for calling after |
354 |
a reboot or whatever. |
355 |
|
356 |
Files generated, but you should never need to call directly: |
357 |
|
358 |
README |
359 |
(this file) |
360 |
|
361 |
02_create_drms_accounts.sql |
362 |
02_create_sums_accounts.sql |
363 |
SQL scripts to add the SUMS user ($config{SUMS_MANAGER}) |
364 |
to the database. These are called as part of |
365 |
01_create_databases.sh |
366 |
|
367 |
WARNING : THESE HAVE DATABASE PASSWORDS IN THEM. |
368 |
|
369 |
(or at least, they will, after you've run the script, as |
370 |
technically, the passwords aren't in use yet) |
371 |
|
372 |
04_create_sums_partitions.sql |
373 |
SQL script to let SUMS know about the partitions it should |
374 |
be using. (called by 01_create_databases.sh ) |
375 |
|
376 |
|
377 |
EOF |
378 |
|
379 |
|
380 |
write_file( '01_create_databases.sh', <<"EOF" ); |
381 |
#!sh -- |
382 |
|
383 |
# This file should be run as the database user ($config{POSTGRES_ADMIN}) |
384 |
# from within the directory it's in (so it can find the sql scripts) |
385 |
|
386 |
initdb --local=C -D '$config{POSTGRES_DATA_DIR}' |
387 |
initdb --local=C -D '$config{POSTGRES_DATA_DIR}_sums' |
388 |
|
389 |
perl -i.orig -e 's/#port = 5432/port = 5434/' '$config{POSTGRES_DATA_DIR}_sums' |
390 |
|
391 |
pg_ctl start -D '$config{POSTGRES_DATA_DIR}' -l '$config{POSTGRES_DATA_DIR}/logfile' |
392 |
pg_ctl start -D '$config{POSTGRES_DATA_DIR}_sums' -l '$config{POSTGRES_DATA_DIR}_sums/logfile' |
393 |
|
394 |
createdb -E LATIN1 '$config{DRMS_DATABASE}' |
395 |
createdb -E LATIN1 '$config{DRMS_DATABASE}_sums' |
396 |
|
397 |
createlang plpgsql '$config{DRMS_DATABASE}' |
398 |
|
399 |
psql -f $config{DRMS}/scripts/NetDRMS.sql -d '$config{DRMS_DATABASE}' |
400 |
psql -f ./02_create_drms_accounts.sql -d '$config{DRMS_DATABASE}' |
401 |
psql -f $config{DRMS}/scripts/drms_series.sql -d '$config{DRMS_DATABASE}' |
402 |
psql -f $config{DRMS}/scripts/drms_session.sql -d '$config{DRMS_DATABASE}' |
403 |
|
404 |
|
405 |
psql -p 5434 -f $config{DRMS}/scripts/create_sums_tables.sql -d '$config{DRMS_DATABASE}_sums' |
406 |
psql -p 5434 -f $config{DRMS}/scripts/create_sumindex.sql -d '$config{DRMS_DATABASE}_sums' |
407 |
psql -p 5434 -f ./02_create_sums_accounts.sql -d '$config{DRMS_DATABASE}_sums' |
408 |
|
409 |
psql -p 5434 -f ./04_create_sums_partitions.sql -d '$config{DRMS_DATABASE}_sums' |
410 |
|
411 |
make |
412 |
|
413 |
# must be done after everything is built ? |
414 |
masterlists dbuser='$config{SUMS_MANAGER}' namespace=drms |
415 |
|
416 |
make sums |
417 |
|
418 |
./start_sums |
419 |
|
420 |
EOF |
421 |
|
422 |
### |
423 |
|
424 |
# this value really shouldn't be in the config ... but we need to deal with it. |
425 |
if (! defined($config{SUMS_MANAGER_PASSWORD}) ) { |
426 |
if ($noprompt) { |
427 |
$config{SUMS_MANAGER_PASSWORD} = 'ChangeMe'.int(rand(999999)); |
428 |
print "\n\nAssigning password for database user '$config{SUMS_MANAGER}' to '$config{SUMS_MANAGER_PASSWORD}'\n\n"; |
429 |
} else { |
430 |
# no hitting return just to get by it. |
431 |
until ( defined( $config{SUMS_MANAGER_PASSWORD}) and ($config{SUMS_MANAGER_PASSWORD} =~ m/\S/) ) { |
432 |
$config{SUMS_MANAGER_PASSWORD} = prompt( 'Enter a password for the SUMS manager: ' ); |
433 |
} |
434 |
} |
435 |
} |
436 |
$config{SUMS_MANAGER_PASSWORD} =~ s/'/''/g; |
437 |
|
438 |
|
439 |
write_file( '02_create_drms_accounts.sql', <<"EOF" ); |
440 |
-- this should be called from 01_....sh |
441 |
create role jsoc; |
442 |
create role sumsadmin; |
443 |
create user $config{SUMS_MANAGER}; |
444 |
alter user $config{SUMS_MANAGER} with password '$config{SUMS_MANAGER_PASSWORD}' |
445 |
EOF |
446 |
|
447 |
write_file( '02_create_sums_accounts.sql', <<"EOF" ); |
448 |
-- this should be called from 01_...sh |
449 |
create user $config{SUMS_MANAGER}; |
450 |
alter user $config{SUMS_MANAGER} with password '$config{SUMS_MANAGER_PASSWORD}' |
451 |
grant all on sum_tape to $config{SUMS_MANAGER}; |
452 |
grant all on sum_ds_index_seq,sum_seq to $config{SUMS_MANAGER}; |
453 |
grant all on sum_file,sum_group,sum_main,sum_open to $config{SUMS_MANAGER}; |
454 |
grant all on sum_partn_alloc,sum_partn_avail to $config{SUMS_MANAGER}; |
455 |
EOF |
456 |
|
457 |
|
458 |
|
459 |
### |
460 |
|
461 |
my @partitions = split( /\s+/, $config{'SUMS_PARTITIONS'} ); |
462 |
|
463 |
my $fill_to_line = $config{'SUMS_FILL_TO_LINE'}; |
464 |
|
465 |
my %sizes = map {( $_, int(get_partition_size($_)*$fill_to_line) )} @partitions; |
466 |
|
467 |
warn ("Partition sizes : ", Dumper(\%sizes) ) if $verbose > 1; |
468 |
|
469 |
write_file( '03_create_sums_partitions.pl', |
470 |
"#!perl --\n\n# make sure partitions for SUMS are there\n# run as root (or use sudo)\n\n", |
471 |
map { <<"EOF" } @partitions ); |
472 |
mkdir -p '$_' |
473 |
chmod 2770 '$_' |
474 |
chown '$config{SUMS_MANAGER}' '$_' |
475 |
chgrp '$config{SUMS_GROUP}' '$_' |
476 |
|
477 |
EOF |
478 |
|
479 |
write_file( '04_create_sums_partitions.sql', "-- run this on the sums database\n\n", map { <<"EOF" } @partitions ); |
480 |
insert into sum_partn_avail (partn_name,total_bytes,avail_bytes,pds_set_num) values ($_, $sizes{$_}, $sizes{$_}, 0); |
481 |
EOF |
482 |
|
483 |
### |
484 |
|
485 |
my $PLATFORM = `$config{DRMS}/build/jsoc_machine.csh`; |
486 |
chomp $PLATFORM; |
487 |
# use Cwd; |
488 |
# my $cwd = cwd(); |
489 |
write_file ( 'start_sums', <<"EOF" ); |
490 |
#!sh -- |
491 |
|
492 |
'$config{DRMS}/bin/$PLATFORM/sum_svc '$config{DRMS_DATABASE}_sums' & |
493 |
EOF |
494 |
|
495 |
|
496 |
### |
497 |
|
498 |
print "\n\nFiles generated. Please read $output_dir/README for instructions\n\n"; |
499 |
|
500 |
|
501 |
############# |
502 |
# subroutines |
503 |
|
504 |
# someone's going to bitch that '$output_dir' and '$EOL' are globals |
505 |
|
506 |
use Carp qw( croak ); |
507 |
|
508 |
sub write_file { |
509 |
my $filename = "$output_dir/".shift; |
510 |
warn "Writing file ... $filename $EOL" if $verbose; |
511 |
open (OUTPUT, '>', $filename ) |
512 |
or croak "Can't write file ($filename) $!$EOL"; |
513 |
print OUTPUT @_; |
514 |
close (OUTPUT) |
515 |
or croak "Can't save file ($filename) $!$EOL"; |
516 |
return 1; |
517 |
} |
518 |
|
519 |
# we'll probably need to adjust this for other OSes |
520 |
sub get_partition_size { |
521 |
my $dir = shift; |
522 |
if ( $dir !~ m#/$# ) { $dir .= '/' } |
523 |
if ( ! -d $dir ) { |
524 |
if ( $dir =~ m#(.*/)[^/]*/$# ) { |
525 |
@_ = ( $1, $dir ); |
526 |
goto &get_partition_size; |
527 |
} |
528 |
$dir = shift || $dir; |
529 |
warn "No such directory for SUMS partition : $dir\nPlease create the directory\n $EOL"; |
530 |
return 0; |
531 |
} |
532 |
my $info = `df -k '$dir'`; |
533 |
if ($info) { |
534 |
my $line = [ split("\n", $info) ]->[-1]; |
535 |
my ($partition, $max, $used, $free, undef) = split( /\s+/, $line ); |
536 |
# might have to keep track of already seen partitions, to keep from screwing up |
537 |
|
538 |
if ( defined($free) ) { |
539 |
return $free*1024; |
540 |
} else { |
541 |
# parsing failed |
542 |
} |
543 |
} |
544 |
# command failed |
545 |
return 0; |
546 |
} |
547 |
|
548 |
__DATA__ |
549 |
# NetDRMS local site configuration info |
550 |
# edit the values in the second column of each line in this file to reflect |
551 |
# the values appropriate to your site |
552 |
|
553 |
# a marker to indicate whether this file has been checked/edited. You MUST |
554 |
# either change its value to yes (or anything but NO) or comment it out. |
555 |
LOCAL_CONFIG_SET YES |
556 |
|
557 |
# the next three entries must almost certainly be changed to reflect your |
558 |
# local configuration |
559 |
|
560 |
# the name of the NetDRMS database; the SUMS database will be assumed to |
561 |
# have the same name with "_sums" appended |
562 |
# see http://vso.stanford.edu/netdrms/site_codes.html |
563 |
DRMS_DATABASE mydb |
564 |
|
565 |
# the host name of the default database server you will be accessing; you |
566 |
# should include the internet domain (e.g. host.subnet.net) if the server is |
567 |
# not on your subnet; but if it is on your subnet it may be better not to |
568 |
# the default value is only really appropriate if you are running in a |
569 |
# single-user environment, such as a laptop; whether it is the default |
570 |
# or a named host depends on how the postgres database named above and |
571 |
# its dependent _sums have been configured in their pg_hba.conf files: |
572 |
# localhost for METHOD "trust", a named host for METHOD "ident sameuser" |
573 |
DBSERVER_HOST localhost |
574 |
|
575 |
# a 15-bit numerical site identifier; values < 16384 (0x4000) are for |
576 |
# publicly exporting sites, and must be registered to assure uniqueness |
577 |
# the default value is for a private unregistered site, and may not provide |
578 |
# access to publicly exporting sites |
579 |
# see http://vso.stanford.edu/netdrms/site_codes.html |
580 |
DRMS_SITE_CODE 0x4000 |
581 |
|
582 |
# the default values for the remaining entries may or may not be appropriate |
583 |
# for your site configuration, depending on how and where third-party |
584 |
# software has been set up and installed |
585 |
|
586 |
# the user name of the postgres administrative account; normally "postgres" |
587 |
# if you have followed the PostgreSQL installation suggestions |
588 |
POSTGRES_ADMIN postgres |
589 |
|
590 |
# the include path for the PostgreSQL API; likely to be either |
591 |
# /usr/include/pgsql or /usr/local/pgsql/include |
592 |
# it should contain the subdirectories: informix, internal, and server |
593 |
POSTGRES_INCS /usr/include/pgsql |
594 |
|
595 |
# the location of the PostgreSQL libs; likely to be either |
596 |
# /usr/lib or /usr/lib64 or /usr/local/pgsql/lib |
597 |
POSTGRES_LIBS /usr/include/pgsql |
598 |
|
599 |
# the user name of the SUMS administrator account - a special account is |
600 |
# recommended for multi-user systems, but not required |
601 |
SUMS_MANAGER production |
602 |
|
603 |
# the host name of the default SUMS server you will be using; this is the |
604 |
# the machine that the SUMS storage units are mounted on, not necessarily |
605 |
# the machine serving the Postgres SUMS database |
606 |
SUMS_SERVER_HOST localhost |
607 |
|
608 |
# the base directory for SUMS logs; used by base/sums/apps/sum_svc.c |
609 |
SUMS_LOG_BASEDIR /usr/local/logs/SUM |
610 |
|
611 |
# the location of third-party libraries (especially cfitsio, which is required, |
612 |
# also others that may be used for modules such as fftw, gsl, etc.) |
613 |
# if different libraries are in different paths, it is recommended that links |
614 |
# to all required ones be made in the single directory named here |
615 |
THIRD_PARTY_LIBS /usr/local/lib |
616 |
|
617 |
# the location of third-party library include files (currently ignored); |
618 |
# see above for multiple locations |
619 |
THIRD_PARTY_INCS /usr/local/include |
620 |
|
621 |
# a sample namespace appropriate to your site; this is only used for a |
622 |
# couple of database initialization scripts and is not important for |
623 |
# subsequent installations/updates |
624 |
# see http://vso.stanford.edu/netdrms/site_codes.html |
625 |
DRMS_SAMPLE_NAMESPACE drms |
626 |
|
627 |
# # # # # # |
628 |
# The following items are for Joe Hourcle's setup script, not used by |
629 |
# DRMS / SUMS directly |
630 |
|
631 |
# The path of where to install the Postgres databases |
632 |
POSTGRES_DATA_DIR /usr/local/db/ |
633 |
|
634 |
# A space-separated list of paths where SUMS can store files |
635 |
SUMS_PARTITIONS you_really_need_to_set_this |
636 |
|
637 |
# The percentage of currently available space should SUMS try to use |
638 |
# on each partition it knows about |
639 |
SUMS_FILL_TO_LINE 95 |
640 |
|
641 |
# The unix group that should own the SUMS directories |
642 |
# The files will be set writable to this whole group |
643 |
# if you run the generated scripts |
644 |
SUMS_GROUP sums |
645 |
|
646 |
# The unix user that should own the SUMS directories |
647 |
# on a single-user system, this is the user's account |
648 |
SUMS_USER sums |
649 |
|
650 |
# The directory where the NetDRMS is installed |
651 |
DRMS /home/jsoc/ |
652 |
|
653 |
|