| 1 | package HTTP::Balancer::Command::Status; | ||
| 2 | use Modern::Perl; | ||
| 3 | use Moose; | ||
| 4 | |||
| 5 | with qw(HTTP::Balancer::Role::Command); | ||
| 6 | |||
| 7 | use Path::Tiny; | ||
| 8 | |||
| 9 | sub run { | ||
| 10 | my ($self, ) = @_; | ||
| 11 | |||
| 12 | my $pidfile = path($self->config->pidfile); | ||
| 13 | |||
| 14 | if ($pidfile->exists) { | ||
| 15 | my ($pid, ) = $pidfile->lines({chomp => 1}); | ||
| 16 | say "$0 is running. pid: $pid"; | ||
| 17 | } else { | ||
| 18 | say "$0 is stop"; | ||
| 19 | } | ||
| 20 | } | ||
| 21 | |||
| 22 | 1; | ||
| 23 | __END__ |