NAME

lonsql - LON TCP-MySQL-Server Daemon for handling database requests.


SYNOPSIS

This script should be run as user=www. The following is an example invocation from the loncron script. Note that a lonsql.pid file contains the pid of the parent process.

    if (-e $lonsqlfile) {
        my $lfh=IO::File->new("$lonsqlfile");
        my $lonsqlpid=<$lfh>;
        chomp($lonsqlpid);
        if (kill 0 => $lonsqlpid) {
            print $fh "<h3>lonsql at pid $lonsqlpid responding</h3>";
            $restartflag=0;
        } else {
            $errors++; $errors++;
            print $fh "<h3>lonsql at pid $lonsqlpid not responding</h3>";
                $restartflag=1;
        print $fh 
            "<h3>Decided to clean up stale .pid file and restart lonsql</h3>";
        }
    }
    if ($restartflag==1) {
        $errors++;
                 print $fh '<br><font color="red">Killall lonsql: '.
                    system('killall lonsql').' - ';
                    sleep 60;
                    print $fh unlink($lonsqlfile).' - '.
                              system('killall -9 lonsql').
                    '</font><br>';
        print $fh "<h3>lonsql not running, trying to start</h3>";
        system(
 "$perlvar{'lonDaemons'}/lonsql 2>>$perlvar{'lonDaemons'}/logs/lonsql_errors");
        sleep 10;


DESCRIPTION

Not yet written.


README

Not yet written.


PREREQUISITES

IO::Socket Symbol POSIX IO::Select IO::File Socket Fcntl Tie::RefHash DBI


COREQUISITES


OSNAMES

linux


SCRIPT CATEGORIES

Server/Process