5 =head1 NAME $RCSfile: ccdbservice.pl,v $
7 ClearCase DataBase Service: Respond to requests for Clearcase metadata from
16 Andrew DeFaria <Andrew@ClearSCM.com>
24 Fri Mar 11 17:45:57 PST 2011
28 $Date: 2011/03/22 19:18:04 $
34 Usage ccdbservice.pl: [-u|sage] [-ve|rbose] [-de|bug]
35 [-da|emon] [-m|ultithreaded] [-p|idfile]
39 -u|sage: Displays usage
42 -de|bug: Output debug messages
44 -da|emon: Run in daemon mode. Use -nod|aemon to run in foreground
46 -m|ultithreaded: Multithread requests. Use -nom|ultithreaded to single
47 thread request handline (Default: -multithreaded)
48 -p|idfile: File to be created with the pid written to it (Default:
49 ccddservice.pid). Note: pidfile is only written if -daemon
51 -l|ogfile: Specify alternative logfile name. Note that .log will be
52 appended. (Default: ccdbservice.log).
54 Note: Certain options can be set in ../etc/ccdbserver.conf. See ccdbserver.conf
59 This script normally runs as a daemon and accepts requests from other hosts to
60 retrieve Clearcase metadata from CCDB.
70 use lib "$FindBin::Bin/lib", "$FindBin::Bin/../lib";
77 my $VERSION = '$Revision: 1.1 $';
78 ($VERSION) = ($VERSION =~ /\$Revision: (.*) /);
80 # Extract relative path and basename from script name.
81 my $me = $FindBin::Script;
83 # Remove .pl for Perl scripts that have that extension
87 "$CCDBService::OPTS{CCDB_RUNDIR}/$me.pid";
89 "$CCDBService::OPTS{CCDB_LOGDIR}/$me.log";
92 my $multithreaded = $CCDBService::OPTS{CCDB_MULTITHREADED};
96 'usage' => sub { Usage },
97 'verbose' => sub { set_verbose },
98 'debug' => sub { set_debug },
99 'daemon!' => \$daemon,
100 'multithreaded!' => \$multithreaded,
101 'pidfile=s' => \$pidfile,
102 'logfile=s' => \$logfile,
103 ) or Usage "Invalid parameter";
105 Usage 'Extraneous options: ' . join ' ', @ARGV
108 my $CCDBService = CCDBService->new;
110 $CCDBService->setMultithreaded ($multithreaded);
112 EnterDaemonMode $logfile, $logfile, $pidfile
115 display "$FindBin::Script V$VERSION started at " . localtime;
117 $CCDBService->startServer;
119 verbose "Server running";
123 =head1 CONFIGURATION AND ENVIRONMENT
125 DEBUG: If set then $debug is set to this level.
127 VERBOSE: If set then $verbose is set to this level.
129 TRACE: If set then $trace is set to this level.
137 L<Getopt::Long|Getopt::Long>
139 =head2 ClearSCM Perl Modules
152 <a href="http://clearscm.com/php/scm_man.php?file=clearadm/lib/Clearexec.pm">Clearexec</a><br>
153 <a href="http://clearscm.com/php/scm_man.php?file=lib/Display.pm">Display</a><br>
154 <a href="http://clearscm.com/php/scm_man.php?file=lib/Utils.pm">Utils</a><br>
159 =head1 BUGS AND LIMITATIONS
161 There are no known bugs in this script
163 Please report problems to Andrew DeFaria <Andrew@ClearSCM.com>.
165 =head1 LICENSE AND COPYRIGHT
167 Copyright (c) 2010, Tellabs, Inc. All rights reserved.