NAME

perfsonar.pl - An basic MA (Measurement Archive) framework

DESCRIPTION

This script shows how a script for a given service should look.

SYNOPSIS

./perfsonar.pl [--verbose --help --config=config.file --piddir=/path/to/pid/dir --pidfile=filename.pid]\n";

The verbose flag allows lots of debug options to print to the screen. If the option is omitted the service will run in daemon mode.

psService This function will wait for requests using the specified listener. It will then select the appropriate endpoint request handler, spawn a new process to handle the request and pass the request to the request handler. The function also tracks the processes spawned and kills them if they go on for too long, responding to the request with an error.

registerLS($args) The registerLS function is called in a separate process or thread and is responsible for calling the specified service's 'registerLS' function regularly.

cleanLS($args) The cleanLS function is (only by the LS) to periodically clean out the LS database.

handleRequest($handler, $request, $endpoint_conf); This function is a wrapper around the handler's handleRequest function. It's purpose is to ensure that if a crash occurs or a perfSONAR_PS::Error_compat message is thrown, the client receives a proper response.

daemonize Sends the program to the background by eliminating ties to the calling terminal.

lockPIDFile($piddir, $pidfile); The lockPIDFile function checks for the existence of the specified file in the specified directory. If found, it checks to see if the process in the file still exists. If there is no running process, it returns the filehandle for the open pidfile that has been flock(LOCK_EX).

unlockPIDFile This file writes the pid of the call process to the filehandle passed in, unlocks the file and closes it.

killChildren Kills all the children for this process off. It uses global variables because this function is used by the signal handler to kill off all child processes.

signalHandler Kills all the children for the process and then exits

SEE ALSO

perfSONAR_PS::Services::Base, perfSONAR_PS::Services::MA::General, perfSONAR_PS::Common, perfSONAR_PS::Messages, perfSONAR_PS::Transport, perfSONAR_PS::Client::Status::MA, perfSONAR_PS::Client::Topology::MA

To join the 'perfSONAR-PS' mailing list, please visit:

https://mail.internet2.edu/wws/info/i2-perfsonar

The perfSONAR-PS subversion repository is located at:

https://svn.internet2.edu/svn/perfSONAR-PS

Questions and comments can be directed to the author, or the mailing list.

VERSION

$Id:$

AUTHOR

Aaron Brown, aaron@internet2.edu

LICENSE

You should have received a copy of the Internet2 Intellectual Property Framework along with this software. If not, see <http://www.internet2.edu/membership/ip.html>

COPYRIGHT

Copyright (c) 2004-2007, Internet2 and the University of Delaware

All rights reserved.