AnyEvent::Util();
use Carp;
use ControlFreak::Util;
use Fcntl qw(F_GETFD F_SETFD FD_CLOEXEC);
use JSON::XS;
use Object::Tiny qw{ name cmd pid is_running env auto };
use Params::Util qw{ _ARRAY _STRING
svc->tie_stdin_to,
no_new_session => $svc->no_new_session,
};
my $string = encode_json($descr);
$hdl->push_write("$string\n");
}
sub stop_service {
my $proxy = shift;
my %
escr = {
command => 'stop',
name => $svc->name,
};
my $string = encode_json($descr);
$hdl->push_write("$string\n");
}
sub unset {
my $proxy = shift;
my $attr =
package ControlFreak::Proxy::Process;
use strict;
use warnings;
use JSON::XS;
use Try::Tiny;
use POSIX 'SIGTERM';
use IO::Select;
$SIG{PIPE} = 'IGNORE';
=head1 NAME
ControlFreak::Proxy::Process -
s_command {
my $proxy = shift;
my $command = shift;
my $param = try {
decode_json($command)
} catch {
$proxy->log('err', "parse error in command $command: $_");
me, $pid, $es) = @_;
my $fh = $proxy->{status_fh}
or return;
my $string = encode_json({
status => $cmd,
name => $name,
pid => $pid,
exit_status => $es,
vent::Util();
use AnyEvent::Handle();
use Carp;
use ControlFreak::Util();
use Data::Dumper();
use JSON::XS;
use Params::Util qw{ _NUMBER _STRING _IDENTIFIER _ARRAY _POSINT };
use POSIX qw{ SIGTERM SIG
lue =~ /^\[/) {
$value = try { decode_json($value) }
catch {
my $error = $_;
$svc->{ctrl}->log->error("Invalid JSON: $error");
return;
};
with other Event loops.
=item * Log4perl
This is the logging backend of ControlFreak.
=item * JSON::XS
=item * Object::Tiny
=item * Try::Tiny
=item * Params::Util
=back
=head2 cpanm
Other in