start as non-root if port switch not required

This commit is contained in:
Oliver Gorwits
2014-06-29 12:41:47 +01:00
parent e5e0c0c8d1
commit 6abcebafbe

View File

@@ -66,6 +66,8 @@ Daemon::Control->new({
stderr_file => file($log_dir, 'netdisco-web.log'), stderr_file => file($log_dir, 'netdisco-web.log'),
stdout_file => file($log_dir, 'netdisco-web.log'), stdout_file => file($log_dir, 'netdisco-web.log'),
redirect_before_fork => 0, redirect_before_fork => 0,
((scalar grep { $_ =~ m/port/ } @args) ? ()
: (uid => $uid, gid => $gid)),
})->run; })->run;
# the guts of this are borrowed from Plack::Loader::Restarter - many thanks!! # the guts of this are borrowed from Plack::Loader::Restarter - many thanks!!