Annotation of loncom/lonmemcached, revision 1.1
1.1 ! albertel 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: exec("/usr/local/bin/memcached -m 256 -v > $logfile");
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>