projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5d1b7f1
)
pid file foo
author
ivan
<ivan>
Wed, 17 Apr 2002 05:22:04 +0000
(
05:22
+0000)
committer
ivan
<ivan>
Wed, 17 Apr 2002 05:22:04 +0000
(
05:22
+0000)
fs_passwd/fs_passwdd
patch
|
blob
|
history
diff --git
a/fs_passwd/fs_passwdd
b/fs_passwd/fs_passwdd
index
be75399
..
3a2bd1d
100755
(executable)
--- a/
fs_passwd/fs_passwdd
+++ b/
fs_passwd/fs_passwdd
@@
-9,7
+9,8
@@
use strict;
use Socket;
use strict;
use Socket;
-my($fs_passwdd_socket)="/usr/local/freeside/fs_passwdd_socket";
+my $fs_passwdd_socket = "/usr/local/freeside/fs_passwdd_socket";
+my $pid_file = "$fs_passwdd_socket.pid"
$ENV{'PATH'} ='/usr/local/bin:/usr/bin:/usr/ucb:/bin';
$ENV{'SHELL'} = '/bin/sh';
$ENV{'PATH'} ='/usr/local/bin:/usr/bin:/usr/ucb:/bin';
$ENV{'SHELL'} = '/bin/sh';
@@
-28,6
+29,16
@@
unlink($fs_passwdd_socket);
bind(Server, $uaddr) or die "bind: $!";
listen(Server,SOMAXCONN) or die "listen: $!";
bind(Server, $uaddr) or die "bind: $!";
listen(Server,SOMAXCONN) or die "listen: $!";
+if ( -e $pid_file ) {
+ open(PIDFILE,"<$pid_file");
+ chomp( my $old_pid = <$pid_file> );
+ close PIDFILE;
+ kill 'TERM', $pid_file;
+}
+open(PIDFILE,">$pid_file");
+print PIDFILE "$$\n";
+close PIDFILE;
+
my($paddr);
for ( ; $paddr = accept(Client,Server); close Client) {
my($me,$old_password,$new_password,$new_gecos,$new_shell);
my($paddr);
for ( ; $paddr = accept(Client,Server); close Client) {
my($me,$old_password,$new_password,$new_gecos,$new_shell);