File:  [LON-CAPA] / loncom / lonmemcached
Revision 1.2: download - view: text, annotated - select for diffs
Thu Feb 17 20:45:04 2005 UTC (19 years, 2 months ago) by albertel
Branches: MAIN
CVS tags: version_1_99_1_tmcc, version_1_99_1, version_1_99_0_tmcc, version_1_99_0, HEAD
- changing ref to where it really gets installed.

#!/usr/bin/perl
$pidfile="/home/httpd/perl/logs/lonmemcached.pid";
$logfile="/home/httpd/perl/logs/lonmemcached.log";

if (-e $pidfile) {
   open(LFH,"$pidfile");
   my $pide=<LFH>;
   chomp($pide);
   close(LFH);
   if (kill 0 => $pide) { die "already running $pide"; }
}

if ($pid=fork()) { exit; }
open (PIDSAVE,">$pidfile");
print PIDSAVE "$$\n";
close(PIDSAVE);

exec("/usr/sbin/memcached -m 256 -v > $logfile");

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