icsearch/dbsf_daemon.pl File Reference

Go to the source code of this file.

Functions

use POSIX qw (setsid setuid)
 chomp ($exist_user)
 my ($exist_uid, $exist_gid) = &change_uid($user)
 my ($condor, $help,%software_data, $logfile, $nosleep)
 GetOptions ( 'dsn:s'=>\$dsn, 'help'=>\$help, 'dir:s'=>\$dir, 'user:s'=>\$user, 'dbprefix:s'=>\$dbprefix, 'cpus:i'=>\$cpus,#if no condor 'nosleep'=>\$nosleep, 'db_link:s'=>\$db_link,#for HMTL blast reports)
 if (!$user||!$dir||$help)
 if ($action)
get_pars ()
daemonize ()
 while (1)
unlock ()
sub readlock ()
sub statusme ()
sub killme ()
sub process_blast ()
sub check_blast ()
sub change_uid ()
sub get_uid ($)
sub connecttodb ($)
sub disconnectdb ($)
sub blast_title ($)
sub blast_head ($)
sub blast_intro ($)

Variables

 host
 port = 15432
 user = postgres
 password
only one environmental
variable per software is 
allowed
only one environmental
variable per software is
Germany Centre for Ecology and 
Conservation
only one environmental
variable per software is
Germany Centre for Ecology and
University of 
Exeter
only one environmental
variable per software is
Germany Centre for Ecology and
University of UK alexie
butterflybase 
org
use Fcntl
use DBI
my $dsn
my $dir = '/tmp'
my $exist_user = `whoami`
my $user = $exist_user
my $dbprefix = ' '
my $cpus = 2
my $db_link
use sigtrap handler
use sigtrap & unlock
use sigtrap normal signals
 umask
my $lock = $dir . '/blast_daemon.lock'
my $action = shift if $ARGV[0]
print n


Function Documentation

sub blast_head (  ) 

Definition at line 612 of file dbsf_daemon.pl.

Referenced by process_blast().

sub blast_intro (  ) 

Definition at line 627 of file dbsf_daemon.pl.

References my().

Referenced by process_blast().

Here is the call graph for this function:

sub blast_title (  ) 

Definition at line 606 of file dbsf_daemon.pl.

References my().

Referenced by process_blast().

Here is the call graph for this function:

sub change_uid (  ) 

Definition at line 463 of file dbsf_daemon.pl.

References $user, chomp(), and my().

Here is the call graph for this function:

sub check_blast (  ) 

Definition at line 376 of file dbsf_daemon.pl.

References chomp(), and my().

Referenced by while().

Here is the call graph for this function:

chomp ( exist_user  ) 

sub connecttodb (  ) 

Definition at line 494 of file dbsf_daemon.pl.

References $dsn, DBI, and my().

Referenced by get_pars().

Here is the call graph for this function:

sub daemonize (  ) 

Definition at line 127 of file dbsf_daemon.pl.

References $dir, and my().

Here is the call graph for this function:

sub disconnectdb (  ) 

Definition at line 516 of file dbsf_daemon.pl.

References my().

Here is the call graph for this function:

sub get_pars (  ) 

Definition at line 523 of file dbsf_daemon.pl.

References $dbprefix, $dir, $dsn, chomp(), connecttodb(), and my().

Here is the call graph for this function:

sub get_uid (  ) 

Definition at line 485 of file dbsf_daemon.pl.

References $user, chomp(), and my().

Here is the call graph for this function:

GetOptions ( 'dsn:s'  ,
\$  dsn,
'help'  ,
\$  help,
'dir:s'  ,
\$  dir,
'user:s'  ,
\$  user,
'dbprefix:s'  ,
\$  dbprefix,
'cpus:i'  ,
\$  cpus,
#if no condor 'nosleep'  ,
\$  nosleep,
'db_link:s'  ,
\$  db_link,
#for HMTL blast  reports 
)

if ( action  ) 

Definition at line 99 of file dbsf_daemon.pl.

References killme(), and statusme().

Here is the call graph for this function:

if ( !$user||!$dir||$  help  ) 

Definition at line 93 of file dbsf_daemon.pl.

sub killme (  ) 

Definition at line 198 of file dbsf_daemon.pl.

References my(), and readlock().

Referenced by if().

Here is the call graph for this function:

my ( condor,
help,
software_data,
logfile,
nosleep 
)

my ( exist_uid,
exist_gid 
) = &change_uid($user)

sub process_blast (  ) 

Definition at line 210 of file dbsf_daemon.pl.

References $db_link, blast_head(), blast_intro(), blast_title(), chomp(), and my().

Referenced by while().

Here is the call graph for this function:

use POSIX qw ( setsid  setuid  ) 

sub readlock (  ) 

Definition at line 171 of file dbsf_daemon.pl.

References my().

Referenced by killme(), and statusme().

Here is the call graph for this function:

sub statusme (  ) 

Definition at line 189 of file dbsf_daemon.pl.

References my(), and readlock().

Referenced by if().

Here is the call graph for this function:

& unlock (  ) 

while (  ) 

Definition at line 118 of file dbsf_daemon.pl.

References check_blast(), and process_blast().

Here is the call graph for this function:


Variable Documentation

my $action = shift if $ARGV[0]

Definition at line 98 of file dbsf_daemon.pl.

my $cpus = 2

Definition at line 74 of file dbsf_daemon.pl.

my $db_link

Definition at line 75 of file dbsf_daemon.pl.

Referenced by process_blast().

$dbprefix = ' '

Definition at line 73 of file dbsf_daemon.pl.

Referenced by get_pars().

$dir = '/tmp'

Definition at line 65 of file dbsf_daemon.pl.

Referenced by daemonize(), dbsf_get_dataset_path(), dbsf_parameter_daemon(), and get_pars().

$dsn

Initial value:

 1
  'dbi:Pg:dbname=drupal

Definition at line 62 of file dbsf_daemon.pl.

Referenced by connecttodb(), and get_pars().

my $exist_user = `whoami`

Definition at line 66 of file dbsf_daemon.pl.

my $lock = $dir . '/blast_daemon.lock'

Definition at line 97 of file dbsf_daemon.pl.

my $user = $exist_user

only one environmental variable per software is allowed

Initial value:

head1 AUTHORS

 Alexie Papanicolaou 1 2

        1 Max Planck Institute for Chemical Ecology

Definition at line 23 of file dbsf_daemon.pl.

only one environmental variable per software is Germany Centre for Ecology and Conservation

Definition at line 23 of file dbsf_daemon.pl.

use DBI

Definition at line 50 of file dbsf_daemon.pl.

Referenced by connecttodb().

only one environmental variable per software is Germany Centre for Ecology and University of Exeter

Definition at line 23 of file dbsf_daemon.pl.

use Fcntl

Definition at line 49 of file dbsf_daemon.pl.

use sigtrap handler

Definition at line 95 of file dbsf_daemon.pl.

Initial value:

head1 NAME

dbsf_daemon.pl

=head1 USAGE

        * 'dsn|database_connection:s'     => DSN connection file or text string for Drupal DB

        You can check status or stop existing daemons by giving 'status' or 'stop', respectively
        You can optionally set dir with -dir (defaults to /tmp). 
        If you're root, you can set effective user with -user (defaults to existing user). If using it for dbsf, we recommend setting it  to your apache user.
        Note that all options can abbreviated with the first unique set of letters

=head1 TIPS

 a dsn file is simple text file which has one line like this:
 dbi:Pg:dbname=InsectaCentrallocalhost

Definition at line 19 of file dbsf_daemon.pl.

print n

Definition at line 112 of file dbsf_daemon.pl.

only one environmental variable per software is Germany Centre for Ecology and University of UK alexie butterflybase org

Initial value:

head1 DISCLAIMER & LICENSE

This software is released under the GNU General Public License version 3 (GPLv3).
It is provided "as is" without warranty of any kind.
You can find the terms and conditions at http:
Please note that incorporating the whole software or parts of its code in proprietary software
is prohibited under the current license.

=head1 BUGS & LIMITATIONS

None known so far. Please report them.

=cut

use strict

Definition at line 31 of file dbsf_daemon.pl.

Initial value:

123321

 Currently

Definition at line 19 of file dbsf_daemon.pl.

port = 15432

Definition at line 19 of file dbsf_daemon.pl.

use sigtrap normal signals

Definition at line 95 of file dbsf_daemon.pl.

Definition at line 96 of file dbsf_daemon.pl.

sub unlock

Definition at line 95 of file dbsf_daemon.pl.

user = postgres

Definition at line 19 of file dbsf_daemon.pl.


Generated on Mon Jan 4 00:11:28 2010 for DrupalBioinformaticServerFramework by  doxygen 1.5.5