Skip Menu |

This queue is for tickets about the Daemon-Generic CPAN distribution.

Report information
The Basics
Id: 58287
Status: resolved
Priority: 0/
Queue: Daemon-Generic

People
Owner: Nobody in particular
Requestors: HALKEYE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.61
Fixed in: (no value)



Subject: Shell hangs on logout
$ ./daemon start $ logout SSH connection hangs. I'm pretty certain its because STDIN was not delt with. http://perldoc.perl.org/perlipc.html#Complete-Dissociation-of-Child- from-Parent has a bit more info. Code from my version (though there's probably a better way of handling this): sub gd_redirect_output { my $self = shift; return if $self->{gd_foreground}; my $logname = $self->gd_logname; my $p = $self->{gd_logpriority} ? "-p $self->{gd_logpriority}" : ""; close(STDIN); close(STDOUT); close(STDERR); open(STDIN, '/dev/null') or die "Can't read /dev/null: $!"; open(STDOUT, "|logger $p -t '$logname'") or die "redirect STDOUT -> STDERR: $!"; open(STDERR, "|logger $p -t '$logname'") or (print "could not open stderr: $!" && exit(1)); }
STDIN is now closed when daemonizing. Fix in version 0.71. Source is now on github.