use POE::Wheel::ReadLine; # To read/write lines on the console.
use POE::Filter::JSON::Incr;
use JSON::XS 2.21;
use Data::Dumper;
# Specify a UNIX rendezvous to use. This is the location th
specific program named "program_name"',
],
add => [
'Parameters: <json_object_defintion>',
'Example: add { "name" : "mydaemond", "command" : "/usr/local/bin
x -c /etc/someconfig.rc" }',
'',
'Add a new program to be supervised. The JSON object fields are as follows:',
'',
' name = required,
package Proc::Safetynet::Program::Storage::TextFile;
use strict;
use warnings;
use Carp;
use JSON::XS;
use Moose;
extends 'Proc::Safetynet::Program::Storage::Memory';
# NOTE: uses implementation in
$oh->{$ok} = $p->$ok();
}
push @out, $oh;
}
print $fh JSON::XS->new->utf8->pretty->encode( \@out );
close $fh;
}
}
sub reload {
my $self =
data = join '', <$fh>;
close $fh;
my $in;
eval {
$in = decode_json( $indata );
};
if ($@) {
croak "unable to decode programs storage fil
stener' => (
is => 'rw',
isa => 'Bool',
required => 0,
);
sub TO_JSON {
my $self = shift;
my $o = { };
foreach my $k (keys %$self) {
$o->{$k} = $se
et::Event;
use Proc::Safetynet::Program;
use Proc::Safetynet::ProgramStatus;
use JSON::XS 2.21;
use POE::Filter::JSON::Incr;
my $RPC_METHOD = {
'start_program' => 1,
'sto
=> $socket,
Filter => POE::Filter::JSON::Incr->new(
errors => 1,
json => JSON::XS->new->utf8->pretty->allow_blessed->convert_blessed,
def;
#print STDERR Dumper( "$self", $_[STATE], $input );
if (ref($input) eq 'POE::Filter::JSON::Incr::Error') {
$result = { result => undef, error => { message => $input->{error}, chun
d' => (
is => 'rw',
isa => 'Int',
required => 0,
);
sub TO_JSON {
my $self = shift;
my $o = { };
foreach my $k (keys %$self) {
next if ($k =~