App-cryp-mn

 view release on metacpan or  search on metacpan

lib/App/cryp/Masternode/bulwark.pm  view on Meta::CPAN

            }

            my $ssh_timeout =
                $crypconf->{masternodes}{bulwark}{$rec->{name}}{ssh_timeout} //
                $crypconf->{masternodes}{bulwark}{default}{ssh_timeout} //
                $conf->{GLOBAL}{ssh_timeout} // 300;

            log_trace "SSH-ing to $rec->{name} ($rec->{ip}) as $ssh_user to query masternode status (timeout=$ssh_timeout) ...";

            eval {
                local $SIG{ALRM} = sub { die "Timeout\n" };
                # XXX doesn't cleanup ssh process when timeout triggers. same
                # with IPC::Cmd, or System::Timeout (which is based on
                # IPC::Cmd). IPC::Run's timeout doesn't work?
                alarm $ssh_timeout;

                my $ssh_cmd = $ssh_user eq $mn_user ?
                    "bulwark-cli listmasternodes" :
                    "su $mn_user -c ".shell_quote("bulwark-cli listmasternodes");

                my $output;
                system({log=>1, shell=>0, capture_stdout=>\$output},
                       "ssh", "-l", $ssh_user, $rec->{ip}, $ssh_cmd);

lib/App/cryp/Masternode/zcoin.pm  view on Meta::CPAN

            }

            my $ssh_timeout =
                $crypconf->{masternodes}{zcoin}{$rec->{name}}{ssh_timeout} //
                $crypconf->{masternodes}{zcoin}{default}{ssh_timeout} //
                $conf->{GLOBAL}{ssh_timeout} // 300;

            log_trace "SSH-ing to $rec->{name} ($rec->{ip}) as $ssh_user to query masternode status (timeout=$ssh_timeout) ...";

            eval {
                local $SIG{ALRM} = sub { die "Timeout\n" };
                # XXX doesn't cleanup ssh process when timeout triggers. same
                # with IPC::Cmd, or System::Timeout (which is based on
                # IPC::Cmd). IPC::Run's timeout doesn't work?
                alarm $ssh_timeout;

                my $ssh_cmd = $ssh_user eq $mn_user ?
                    "zcoin-cli znode list" :
                    "su $mn_user -c ".shell_quote("zcoin-cli znode list");

                my $output;
                system({log=>1, shell=>0, capture_stdout=>\$output},
                       "ssh", "-l", $ssh_user, $rec->{ip}, $ssh_cmd);

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.549 second using v1.00-cache-2.02-grep-82fe00e-cpan-2c419f77a38b )