From: ivan Date: Wed, 17 Apr 2002 01:17:50 +0000 (+0000) Subject: kill ssh children on exit also, like password server X-Git-Tag: freeside_1_4_0_pre12~73 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=5d1b7f1ec392d0c4a3c48c8fcd046f72c5d9b9b5;ds=sidebyside kill ssh children on exit also, like password server --- diff --git a/fs_signup/fs_signup_server b/fs_signup/fs_signup_server index 12f1e5ef0..5dfa0e88f 100755 --- a/fs_signup/fs_signup_server +++ b/fs_signup/fs_signup_server @@ -4,6 +4,7 @@ # use strict; +use vars qw($pid); use IO::Handle; use Storable qw(nstore_fd fd_retrieve); use Tie::RefHash; @@ -39,13 +40,20 @@ my $refnum = shift or die &usage; #causing trouble for some folks #$SIG{CHLD} = sub { wait() }; +$SIG{HUP} = \&killssh; +$SIG{INT} = \&killssh; +$SIG{QUIT} = \&killssh; +$SIG{TERM} = \&killssh; +$SIG{PIPE} = \&killssh; +sub killssh { kill 'TERM', $pid if $pid; exit; }; + my($fs_signupd)="/usr/local/sbin/fs_signupd"; while (1) { my($reader,$writer)=(new IO::Handle, new IO::Handle); #seems to be broken - calling ->flush explicitly# $writer->autoflush(1); warn "[fs_signup_server] Connecting to $machine...\n" if $Debug; - sshopen2($machine,$reader,$writer,$fs_signupd); + $pid = sshopen2($machine,$reader,$writer,$fs_signupd); my @pops = qsearch('svc_acct_pop',{} ); my $init_data = {