Unicorn-Manager

 view release on metacpan or  search on metacpan

lib/Unicorn/Manager/CLI/Proc.pm  view on Meta::CPAN

}

sub _replace_uid_with_name {
    my $self = shift;

    my %user_table = %{ $self->process_table->ptable };

    my @users = keys %user_table;

    for (@users) {
        my $username = getpwuid $_;
        $user_table{$username} = $user_table{$_};
        delete $user_table{$_};
    }

    return {%user_table};
}

1;

__END__

script/uc.pl  view on Meta::CPAN

    'args=s'     => \$args,
    'debug'      => \$DEBUG,
    'rails'      => \$rails,
    'host|h=s'   => \$host,
    'port|p=i'   => \$port,
);

my ( $action, @params ) = @ARGV;

if ( $> > 0 ) {
    $user = getpwuid $> unless $user;
}
else {
    $user = 'nobody' unless $user;
}

unless ( $user && $action ) {
    print $HELP;
    die "Missing arguments. username and action are required\n";
}

script/uc.pl  view on Meta::CPAN

    },
    show => sub {
        my $uc = Unicorn::Manager::CLI->new(
            username => 'nobody',
            DEBUG    => $DEBUG,
        );

        my $uidref = $uc->proc->process_table->ptable;

        for ( keys %{$uidref} ) {
            my $username = getpwuid $_;
            my $pidref   = $uidref->{$_};

            print "$username:\n";

            for my $master ( keys %{$pidref} ) {
                print "    master: $master\n";
                for my $worker ( @{ $pidref->{$master} } ) {
                    if ( ref($worker) ~~ 'HASH' ) {
                        for ( keys %$worker ) {
                            print "        new master: " . $_ . "\n";



( run in 0.353 second using v1.01-cache-2.11-cpan-8d75d55dd25 )