[Bio] / FigCommon / env.linux-debian.pl Repository:
ViewVC logotype

View of /FigCommon/env.linux-debian.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Tue May 17 19:43:20 2005 UTC (14 years, 6 months ago) by olson
Branch: MAIN
CVS Tags: merge-trunktag-bobdev_news-2, Root-bobdev_news, merge-bobdev_news-1, merge-trunktag-bobdev_news-1, merge-bodev_news-3, lwc, caBIG-00-00-00, merge-bobdev_news-2, merge-trunktag-bodev_news-3
Branch point for: Branch-bobdev_news
debian conifg.

#
# Linux-postgres-specific configuration.
#

#
# Invoke the postgres-specific configuration. 
#
# We'll find it in the FigCommon directory.
# 

#$ cat /proc/meminfo
#        total:    used:    free:  shared: buffers:  cached:
#	Mem:  526127104 519618560  6508544        0 117166080 330891264
#	Swap: 263200768 93118464 170082304
#


my $fh;
if (open($fh, "</proc/meminfo"))
{
    while (<$fh>)
    {
	print;
	if (/^Mem:\s+(\d+)/)
	{
	    $OtherConfig->{memory} = $1;
	    last;
	}
	elsif (/^MemTotal:\s+(\d+)\s+(\S+)/)
	{
	    my $mem = $1;
	    my $units = lc($2);
	    if ($units eq "kb")
	    {
		$mem *= 1024;
	    }
	    elsif ($units eq "mb")
	    {
		$mem *= 1024 * 1024;
	    }
	    elsif ($units eq "gb")
	    {
		$mem *= 1024 * 1024 * 1024;
	    }

	    $OtherConfig->{memory} = $mem;
	    last;
	}
    }

    close($fh);
}

if (open($fh, "</proc/sys/kernel/shmmax"))
{
    $_ = <$fh>;
    if (/^(\d+)$/)
    {
	$OtherConfig->{shmmax} = $1;
    }
}

$pg_script = "$ENV{FIGCONFIG_RELEASE_DIR}/FigCommon/envsub.postgres.pl";

run_script($pg_script);


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3