new scripts which self-localenv, and a daemon web server

This commit is contained in:
Oliver Gorwits
2013-01-05 20:13:48 +00:00
parent e10ee4f520
commit 43ca40e28c
6 changed files with 55 additions and 23 deletions

View File

@@ -3,7 +3,12 @@
use strict;
use warnings FATAL => 'all';
use Daemon::Control;
BEGIN {
eval "use Daemon::Control";
if ($@) {
exec("$ENV{HOME}/bin/localenv", $0, @ARGV);
}
}
my $program = "$ENV{HOME}/bin/netdisco-daemon-fg";

View File

@@ -41,6 +41,7 @@ say ' * Internet access';
say ' * Database added to PostgreSQL for Netdisco';
say ' * User added to PostgreSQL with rights to the Netdisco Database';
say ' * "environments/development.yml" file configured with Database dsn/user/pass';
say ' * A full backup of any existing Netdisco database data';
say '';
say 'You will be asked to confirm all changes to your system.';
say '';

View File

@@ -1,9 +1,18 @@
#!/usr/bin/env perl
use FindBin;
use lib "$FindBin::Bin/../lib";
use App::Netdisco;
use strict;
use warnings FATAL => 'all';
use Dancer;
use App::Netdisco::Web;
dance;
BEGIN {
eval "use Daemon::Control";
if ($@) {
exec("$ENV{HOME}/bin/localenv", $0, @ARGV);
}
}
Daemon::Control->new({
name => 'Netdisco Web',
program => 'plackup',
program_args => ["$ENV{HOME}/bin/netdisco-web-fg"],
pid_file => "$ENV{HOME}/netdisco-web.pid",
})->run;

9
Netdisco/bin/netdisco-web-fg Executable file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env perl
use FindBin;
use lib "$FindBin::Bin/../lib";
use App::Netdisco;
use Dancer;
use App::Netdisco::Web;
dance;