File:  [LON-CAPA] / loncom / lonmemcached
Revision 1.6: download - view: text, annotated - select for diffs
Tue Oct 17 05:56:34 2006 UTC (15 years, 10 months ago) by albertel
Branches: MAIN
CVS tags: version_2_5_X, version_2_5_2, version_2_5_1, version_2_5_0, version_2_4_X, version_2_4_99_0, version_2_4_2, version_2_4_1, version_2_4_0, version_2_3_X, version_2_3_99_0, version_2_3_2, version_2_3_1, version_2_3_0, version_2_2_99_1, version_2_2_99_0, HEAD
- upping to amount of memeory memcached grabs
- turning on the ability for auto gzipping large structs when sending them to memcached

    1: #!/usr/bin/perl
    2: $pidfile="/home/httpd/perl/logs/lonmemcached.pid";
    3: $logfile="/home/httpd/perl/logs/lonmemcached.log";
    4: 
    5: if (-e $pidfile) {
    6:    open(LFH,"$pidfile");
    7:    my $pide=<LFH>;
    8:    chomp($pide);
    9:    close(LFH);
   10:    if (kill 0 => $pide) { die "already running $pide"; }
   11: }
   12: 
   13: if ($pid=fork()) { exit; }
   14: open (PIDSAVE,">$pidfile");
   15: print PIDSAVE "$$\n";
   16: close(PIDSAVE);
   17: 
   18: if (-e '/usr/sbin/memcached') {
   19:     exec('/usr/sbin/memcached','-m','400','-v');
   20: } elsif (-e '/usr/bin/memcached') {
   21:     exec('/usr/bin/memcached','-m','400','-v');
   22: } else {
   23:     die("Unable to find memcached");
   24: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>