diff options
author | cvs2git <cvs2git> | 2002-08-12 06:17:10 +0000 |
---|---|---|
committer | cvs2git <cvs2git> | 2002-08-12 06:17:10 +0000 |
commit | 160be29a0dc62e79a4fb95d2ab8c0c7e5996760e (patch) | |
tree | 94ebadb17321b138fd7bfd9a5c379eec97c5d328 /fs_signup/FS-SignupClient/fs_signupd | |
parent | 3ef62a0570055da710328937e7f65dbb2c027c62 (diff) |
This commit was manufactured by cvs2svn to create branch 'BESTPRACTICAL'.
Diffstat (limited to 'fs_signup/FS-SignupClient/fs_signupd')
-rwxr-xr-x | fs_signup/FS-SignupClient/fs_signupd | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/fs_signup/FS-SignupClient/fs_signupd b/fs_signup/FS-SignupClient/fs_signupd deleted file mode 100755 index 85bd68a2f..000000000 --- a/fs_signup/FS-SignupClient/fs_signupd +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/perl -Tw -# -# fs_signupd -# -# This is run REMOTELY over ssh by fs_signup_server. - -use strict; -use Socket; -use Storable qw(nstore_fd fd_retrieve); -use IO::Handle; - -use vars qw( $Debug ); - -$Debug = 1; - -my $fs_signupd_socket = "/usr/local/freeside/fs_signupd_socket"; -my $pid_file = "$fs_signupd_socket.pid"; - -$ENV{'PATH'} ='/usr/local/bin:/usr/bin:/usr/ucb:/bin'; -$ENV{'SHELL'} = '/bin/sh'; -$ENV{'IFS'} = " \t\n"; -$ENV{'CDPATH'} = ''; -$ENV{'ENV'} = ''; -$ENV{'BASH_ENV'} = ''; - -$|=1; - -warn "[fs_signupd] Reading init data...\n" if $Debug; -my $init_data = fd_retrieve(\*STDIN); - -warn "[fs_signupd] Creating $fs_signupd_socket\n" if $Debug; -my $uaddr = sockaddr_un($fs_signupd_socket); -my $proto = getprotobyname('tcp'); -socket(Server,PF_UNIX,SOCK_STREAM,0) or die "socket: $!"; -unlink($fs_signupd_socket); -bind(Server, $uaddr) or die "bind: $!"; -listen(Server,SOMAXCONN) or die "listen: $!"; - -if ( -e $pid_file ) { - open(PIDFILE,"<$pid_file"); - #chomp( my $old_pid = <PIDFILE> ); - my $old_pid = <PIDFILE>; - close PIDFILE; - $old_pid =~ /^(\d+)$/; - kill 'TERM', $1; -} -open(PIDFILE,">$pid_file"); -print PIDFILE "$$\n"; -close PIDFILE; - -warn "[fs_signupd] Entering main loop...\n" if $Debug; -my $paddr; -for ( ; $paddr = accept(Client,Server); close Client) { - - chop( my $command = <Client> ); - - if ( $command eq "signup_info" ) { - - warn "[fs_signupd] sending signup info...\n" if $Debug; - nstore_fd($init_data, \*Client) or die "can't send init data: $!"; - Client->flush; - - } elsif ( $command eq "new_customer" ) { - - #inefficient... - - warn "[fs_signupd] reading customer signup...\n" if $Debug; - my $signup_data = fd_retrieve(\*Client); - - warn "[fs_signupd] sending customer data to remote server...\n" if $Debug; - nstore_fd($signup_data, \*STDOUT) or die "can't send signup data: $!"; - STDOUT->flush; - - warn "[fs_signupd] reading error from remote server...\n" if $Debug; - my $error = <STDIN>; - - warn "[fs_signupd] sending error to local client...\n" if $Debug; - print Client $error; - Client->flush; - - } else { - die "unexpected command from client: $command"; - } - -} - |