Skip to content

Commit

Permalink
clusterd: Remove obsolete code
Browse files Browse the repository at this point in the history
  • Loading branch information
donald committed Jan 20, 2023
1 parent e2c16e1 commit 985ffdc
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions clusterd/clusterd
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,6 @@ chomp($my_unixrev);

our $CLUSTER_PW;
our $CLUSTER_PW_FILE='/etc/clusterd.password';
our $OLD_CLUSTER_PW_FILE='/root/clusterd.password';
our $CLUSTER_PW_TIMESTAMP=0;

$ENV{'PATH'} = '/usr/local/bin:/sbin:/usr/sbin:/bin'.($ENV{PATH}?':'.$ENV{PATH}:''); # for ps , tar (gnu!)
Expand Down Expand Up @@ -1612,24 +1611,6 @@ sub send_tcp_cp {
sub sync_cluster_pw {
my $st=Donald::FileInfo->lstat($CLUSTER_PW_FILE);

# upgrade : move cluster password file from /root to /etc

if (!$st && -e $OLD_CLUSTER_PW_FILE) {
warn "upgrading cluster password file location $OLD_CLUSTER_PW_FILE -> $CLUSTER_PW_FILE\n";
my $in=new IO::File $OLD_CLUSTER_PW_FILE,'<';
unless (defined $in) {warn "$OLD_CLUSTER_PW_FILE: $!\n";return undef;}
my $out=new IO::File $CLUSTER_PW_FILE,O_WRONLY|O_CREAT,0600;
unless (defined $out) {warn "$CLUSTER_PW_FILE: $!\n";return undef;}
my $data;
$in->read($data,1024);
$out->write($data);
$in->close;
$out->close;
$st=Donald::FileInfo->lstat($CLUSTER_PW_FILE);
defined $st or die "$CLUSTER_PW_FILE: $!\n";
unlink $OLD_CLUSTER_PW_FILE;
}

if ($st) {
if (!defined $CLUSTER_PW or $CLUSTER_PW_TIMESTAMP != $st->mtime) {
my $fh=new IO::File $CLUSTER_PW_FILE,'<';
Expand Down

0 comments on commit 985ffdc

Please sign in to comment.