more spectre goodness, it almost runs!!
This commit is contained in:
parent
9ff0794746
commit
d9a80d9f6f
6 changed files with 78 additions and 43 deletions
|
|
@ -11,52 +11,57 @@
|
|||
use strict;
|
||||
use warnings;
|
||||
use lib '../lib';
|
||||
use Spectre::Admin;
|
||||
use Getopt::Long;
|
||||
use POE::Component::IKC::ClientLite;
|
||||
use Spectre::Admin;
|
||||
use WebGUI::Config;
|
||||
|
||||
$|=1; # disable output buffering
|
||||
my $help;
|
||||
my $shutdown;
|
||||
my $daemon;
|
||||
|
||||
GetOptions(
|
||||
'help'=>\$help,
|
||||
'shutdown'=>\$shutdown
|
||||
'shutdown'=>\$shutdown,
|
||||
'daemon'=>\$daemon
|
||||
);
|
||||
|
||||
if ($help) {
|
||||
if ($help || !($shutdown||$daemon)) {
|
||||
print <<STOP;
|
||||
|
||||
S.P.E.C.T.R.E. is the Supervisor of Perplexing Event-handling Contraptions for
|
||||
Triggering Relentless Executions. It handles WebGUI's workflow, mail sending,
|
||||
search engine indexing, and other background processes.
|
||||
|
||||
Usage:
|
||||
|
||||
perl spectre.pl
|
||||
Usage: perl spectre.pl [ options ]
|
||||
|
||||
|
||||
Options:
|
||||
|
||||
--daemon Starts the Spectre server.
|
||||
|
||||
--shutdown Stops the running Spectre server.
|
||||
|
||||
STOP
|
||||
exit;
|
||||
}
|
||||
|
||||
my $config = WebGUI::Config->new("..","spectre.conf",1);
|
||||
|
||||
if ($shutdown) {
|
||||
my $remote = create_ikc_client(
|
||||
port=>32133,
|
||||
port=>$config->get("port"),
|
||||
ip=>'127.0.0.1',
|
||||
name=>rand(100000),
|
||||
timeout=>10
|
||||
);
|
||||
die $POE::Component::IKC::ClientLite::error unless $remote;
|
||||
my $result = $remote->post('scheduler/shutdown');
|
||||
my $result = $remote->post('admin/shutdown');
|
||||
die $POE::Component::IKC::ClientLite::error unless defined $result;
|
||||
undef $remote;
|
||||
exit;
|
||||
} elsif ($daemon) {
|
||||
fork and exit;
|
||||
Spectre::Admin->new($config);
|
||||
}
|
||||
|
||||
fork and exit;
|
||||
|
||||
Spectre::Admin->new("/data/WebGUI");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue