lond - ``LON Daemon'' Server (port ``LOND'' 5663)
Usage: lond
Should only be run as user=www. This is a command-line script which is invoked by loncron. There is no expectation that a typical user will manually start lond from the command-line. (In other words, DO NOT START lond YOURSELF.)
There are two characteristics associated with the running of lond, PROCESS MANAGEMENT (starting, stopping, handling child processes) and SERVER-SIDE ACTIVITIES (password authentication, user creation, subscriptions, etc). These are described in two large sections below.
PROCESS MANAGEMENT
Preforker - server who forks first. Runs as a daemon. HUPs. Uses IDEA encryption
lond forks off children processes that correspond to the other servers in the network. Management of these processes can be done at the parent process level or the child process level.
logs/lond.log is the location of log messages.
The process management is now explained in terms of linux shell commands, subroutines internal to this code, and signal assignments:
This is the process id number of the parent lond process.
Parent signal assignment: $SIG{INT} = $SIG{TERM} = \&HUNTSMAN;
Child signal assignment: $SIG{INT} = 'DEFAULT'; (and SIGTERM is DEFAULT also) (The child dies and a SIGALRM is sent to parent, awaking parent from slumber to restart a new child.)
Command-line invocations: kill -s SIGTERM PID kill -s SIGINT PID
Subroutine HUNTSMAN: This is only invoked for the lond parent PID. This kills all the children, and then the parent. The lonc.pid file is cleared.
Current bug: This signal can only be processed the first time on the parent process. Subsequent SIGHUP signals have no effect.
Parent signal assignment: $SIG{HUP} = \&HUPSMAN;
Child signal assignment: none (nothing happens)
Command-line invocations: kill -s SIGHUP PID
Subroutine HUPSMAN: This is only invoked for the lond parent PID, This kills all the children, and then the parent. The lond.pid file is cleared.
Parent signal assignment: $SIG{USR1} = \&USRMAN;
Child signal assignment: $SIG{USR1}= \&logstatus;
Command-line invocations: kill -s SIGUSR1 PID
Subroutine USRMAN: When invoked for the lond parent PID, SIGUSR1 is sent to all the children, and the status of each connection is logged.
Parent signal assignment: $SIG{CHLD} = \&REAPER;
Child signal assignment: none
Command-line invocations: kill -s SIGCHLD PID
Subroutine REAPER: This is only invoked for the lond parent PID. Information pertaining to the child is removed. The socket port is cleaned up.
SERVER-SIDE ACTIVITIES
Server-side information can be accepted in an encrypted or non-encrypted method.
IO::Socket IO::File Apache::File Symbol POSIX Crypt::IDEA LWP::UserAgent() GDBM_File Authen::Krb4 Authen::Krb5
linux
Server/Process