Subject: | Can't disable backgrounding from the command line |
When deciding to background the process or not, Net::Server checks if the background property
is defined. However, there is no way to undefine something on the command line. If your
server has a default setting of backgrounding, you can't force it to the foreground at the
command line.
Testing background for truth lets you do './server.pl background=0'. The attached patch has
the change.
--
Chris Reinhardt
chris@triv.org
Subject: | net-server.patch |
--- Server.pm.orig 2009-02-12 12:05:20.000000000 -0500
+++ Server.pm 2009-02-12 12:06:10.000000000 -0500
@@ -288,7 +288,7 @@
if (! $ENV{BOUND_SOCKETS}) {
### background the process - unless we are hup'ing
- if( $prop->{setsid} || defined($prop->{background}) ){
+ if( $prop->{setsid} || $prop->{background} ){
my $pid = eval{ safe_fork() };
if( not defined $pid ){ $self->fatal( $@ ); }
exit(0) if $pid;