projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
eb035e5
)
don't leave ssh zombies around either
author
ivan
<ivan>
Wed, 8 Feb 2006 22:53:18 +0000
(22:53 +0000)
committer
ivan
<ivan>
Wed, 8 Feb 2006 22:53:18 +0000
(22:53 +0000)
FS/bin/freeside-selfservice-server
patch
|
blob
|
history
diff --git
a/FS/bin/freeside-selfservice-server
b/FS/bin/freeside-selfservice-server
index
c73349a
..
6026fd1
100644
(file)
--- a/
FS/bin/freeside-selfservice-server
+++ b/
FS/bin/freeside-selfservice-server
@@
-1,7
+1,7
@@
#!/usr/bin/perl -w
use strict;
#!/usr/bin/perl -w
use strict;
-use vars qw( $Debug %kids $kids $max_kids $ssh_pid $keepalives );
+use vars qw( $Debug %kids $kids $max_kids $ssh_pid
%old_ssh_pid
$keepalives );
use subs qw( lock_write unlock_write myshutdown usage );
use Fcntl qw(:flock);
use POSIX qw(:sys_wait_h);
use subs qw( lock_write unlock_write myshutdown usage );
use Fcntl qw(:flock);
use POSIX qw(:sys_wait_h);
@@
-102,6
+102,7
@@
while (1) {
if ( $ssh_pid ) {
warn "sending TERM signal to ssh process $ssh_pid\n" if $Debug;
kill 'TERM', $ssh_pid;
if ( $ssh_pid ) {
warn "sending TERM signal to ssh process $ssh_pid\n" if $Debug;
kill 'TERM', $ssh_pid;
+ $old_ssh_pid{$ssh_pid} = 1;
$ssh_pid = 0;
}
last;
$ssh_pid = 0;
}
last;
@@
-180,6
+181,10
@@
sub reap_kids {
delete $kids{$kid};
}
}
delete $kids{$kid};
}
}
+
+ foreach my $pid ( keys %old_ssh_pid ) {
+ waitpid($pid, WNOHANG) and delete $old_ssh_pid{$pid};
+ }
#warn "done reaping\n";
}
#warn "done reaping\n";
}