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] |
| n | |
| sub blast_head | ( | $ | ) |
| sub blast_intro | ( | $ | ) |
Definition at line 627 of file dbsf_daemon.pl.
References my().
Referenced by process_blast().

| sub blast_title | ( | $ | ) |
Definition at line 606 of file dbsf_daemon.pl.
References my().
Referenced by process_blast().

| sub change_uid | ( | ) |
Definition at line 463 of file dbsf_daemon.pl.
References $user, chomp(), and my().

| sub check_blast | ( | ) |
Definition at line 376 of file dbsf_daemon.pl.
Referenced by while().

| chomp | ( | $ | exist_user | ) |
Referenced by change_uid(), check_blast(), get_pars(), get_uid(), and process_blast().
| sub connecttodb | ( | $ | ) |
Definition at line 494 of file dbsf_daemon.pl.
References $dsn, DBI, and my().
Referenced by get_pars().

| sub daemonize | ( | ) |
| sub disconnectdb | ( | $ | ) |
Definition at line 516 of file dbsf_daemon.pl.
References my().

| sub get_pars | ( | ) |
Definition at line 523 of file dbsf_daemon.pl.
References $dbprefix, $dir, $dsn, chomp(), connecttodb(), and my().

| sub get_uid | ( | $ | ) |
Definition at line 485 of file dbsf_daemon.pl.
References $user, chomp(), and my().

| 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().

| 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().

| my | ( | $ | condor, | |
| $ | help, | |||
| % | software_data, | |||
| $ | logfile, | |||
| $ | nosleep | |||
| ) |
| my | ( | $ | exist_uid, | |
| $ | exist_gid | |||
| ) | = &change_uid($user) |
Referenced by blast_intro(), blast_title(), change_uid(), check_blast(), connecttodb(), daemonize(), disconnectdb(), get_pars(), get_uid(), killme(), process_blast(), readlock(), and statusme().
| 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().

| use POSIX qw | ( | setsid | setuid | ) |
| sub readlock | ( | ) |
Definition at line 171 of file dbsf_daemon.pl.
References my().
Referenced by killme(), and statusme().

| sub statusme | ( | ) |
Definition at line 189 of file dbsf_daemon.pl.
References my(), and readlock().
Referenced by if().

| & unlock | ( | ) |
| while | ( | 1 | ) |
Definition at line 118 of file dbsf_daemon.pl.
References check_blast(), and process_blast().

| 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 |
| $dbprefix = ' ' |
| $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 |
Definition at line 71 of file dbsf_daemon.pl.
Referenced by change_uid(), dbsf_blast_form(), dbsf_get_user_datasets(), dbsf_ssaha2_form(), and get_uid().
| 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 |
| 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.
| 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.
1.5.5