Parent Directory
|
Revision Log
Revision 1.1 - (view) (download) (as text)
1 : | olson | 1.1 | # |
2 : | # Linux-postgres-specific configuration. | ||
3 : | # | ||
4 : | |||
5 : | # | ||
6 : | # Invoke the postgres-specific configuration. | ||
7 : | # | ||
8 : | # We'll find it in the FigCommon directory. | ||
9 : | # | ||
10 : | |||
11 : | #$ cat /proc/meminfo | ||
12 : | # total: used: free: shared: buffers: cached: | ||
13 : | # Mem: 526127104 519618560 6508544 0 117166080 330891264 | ||
14 : | # Swap: 263200768 93118464 170082304 | ||
15 : | # | ||
16 : | |||
17 : | |||
18 : | my $fh; | ||
19 : | if (open($fh, "</proc/meminfo")) | ||
20 : | { | ||
21 : | while (<$fh>) | ||
22 : | { | ||
23 : | print; | ||
24 : | if (/^Mem:\s+(\d+)/) | ||
25 : | { | ||
26 : | $OtherConfig->{memory} = $1; | ||
27 : | last; | ||
28 : | } | ||
29 : | elsif (/^MemTotal:\s+(\d+)\s+(\S+)/) | ||
30 : | { | ||
31 : | my $mem = $1; | ||
32 : | my $units = lc($2); | ||
33 : | if ($units eq "kb") | ||
34 : | { | ||
35 : | $mem *= 1024; | ||
36 : | } | ||
37 : | elsif ($units eq "mb") | ||
38 : | { | ||
39 : | $mem *= 1024 * 1024; | ||
40 : | } | ||
41 : | elsif ($units eq "gb") | ||
42 : | { | ||
43 : | $mem *= 1024 * 1024 * 1024; | ||
44 : | } | ||
45 : | |||
46 : | $OtherConfig->{memory} = $mem; | ||
47 : | last; | ||
48 : | } | ||
49 : | } | ||
50 : | |||
51 : | close($fh); | ||
52 : | } | ||
53 : | |||
54 : | if (open($fh, "</proc/sys/kernel/shmmax")) | ||
55 : | { | ||
56 : | $_ = <$fh>; | ||
57 : | if (/^(\d+)$/) | ||
58 : | { | ||
59 : | $OtherConfig->{shmmax} = $1; | ||
60 : | } | ||
61 : | } | ||
62 : | |||
63 : | $pg_script = "$ENV{FIGCONFIG_RELEASE_DIR}/FigCommon/envsub.postgres.pl"; | ||
64 : | |||
65 : | run_script($pg_script); | ||
66 : |
MCS Webmaster | ViewVC Help |
Powered by ViewVC 1.0.3 |