Skip to content

Commit

Permalink
the server needs to bind to the port before calling setuidgid
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 29, 2015
1 parent 30054f1 commit d6880c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Mojo/Server/Daemon.pm
Expand Up @@ -25,7 +25,7 @@ sub DESTROY {
sub run {
my $self = shift;
local $SIG{INT} = local $SIG{TERM} = sub { $self->ioloop->stop };
$self->start->ioloop->start;
$self->start->setuidgid->ioloop->start;
}

sub start {
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Command/daemon.pm
Expand Up @@ -22,7 +22,7 @@ sub run {
'u|user=s' => sub { $daemon->user($_[1]) };

$daemon->listen(\@listen) if @listen;
$daemon->setuidgid->run;
$daemon->run;
}

1;
Expand Down

0 comments on commit d6880c1

Please sign in to comment.