/
twiki_fastcgi
executable file
·77 lines (65 loc) · 2.02 KB
/
twiki_fastcgi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/perl -wT
#
# Foswiki - The Free Open Source Wiki, http://foswiki.org/
#
# Copyright (C) 1999-2007 Peter Thoeny, peter@thoeny.org
# and TWiki Contributors.
#
# This script is based/inspired on Catalyst framework. Refer to
#
# http://search.cpan.org/author/MRAMBERG/Catalyst-Runtime-5.7010/lib/Catalyst.pm
#
# For credits and liscence details.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. For
# more details read LICENSE in the root of this distribution.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# As per the GPL, removal of this notice is prohibited.
use strict;
use warnings;
BEGIN {
$TWiki::cfg{Engine} = 'TWiki::Engine::FastCGI';
@INC = ('.', grep { $_ ne '.' } @INC);
delete $ENV{TWIKI_ACTION} if exists $ENV{TWIKI_ACTION};
require 'setlib.cfg';
}
use Getopt::Long;
use Pod::Usage;
my ( $listen, $nproc, $pidfile, $manager, $detach, $help );
GetOptions(
'listen|l=s' => \$listen,
'nproc|n=i' => \$nproc,
'pidfile|p=s' => \$pidfile,
'manager|M=s' => \$manager,
'daemon|d' => \$detach,
'help|?' => \$help,
);
pod2usage(1) if $help;
use TWiki;
use TWiki::UI;
$TWiki::engine->run(
$listen,
{ nproc => $nproc,
pidfile => $pidfile,
manager => $manager,
detach => $detach,
}
);
__END__
=head1 SYNOPSIS
twiki_fastcgi.pl [options]
Options:
-l --listen Socket to listen on
-n --nproc Number of backends to use, defaults to 1
-p --pidfile File used to write pid to
-M --manager FCGI manager class, defaults to FCGI::ProcManager
-d --daemon Detach from terminal and keeps running as a daemon
-? --help Display this help and exits
=cut