Subversion Repositories DevTools

Rev

Rev 3846 | Rev 4456 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3846 Rev 3847
Line 72... Line 72...
72
    'logfile.size'    => {'default'   => '1M'   , 'fmt' => 'size'},
72
    'logfile.size'    => {'default'   => '1M'   , 'fmt' => 'size'},
73
    'logfile.count'   => {'default'   => 9      , 'fmt' => 'int'},
73
    'logfile.count'   => {'default'   => 9      , 'fmt' => 'int'},
74
    'verbose'         => {'default'   => 0      , 'fmt' => 'int'},
74
    'verbose'         => {'default'   => 0      , 'fmt' => 'int'},
75
    'user'            => {'mandatory' => 1      , 'fmt' => 'text'},
75
    'user'            => {'mandatory' => 1      , 'fmt' => 'text'},
76
    'hostname'        => {'mandatory' => 1      , 'fmt' => 'text'},
76
    'hostname'        => {'mandatory' => 1      , 'fmt' => 'text'},
-
 
77
    'sshport'         => {'default'   => 0      , 'fmt' => 'int'},
77
    'identity'        => {'mandatory' => 1      , 'fmt' => 'file'},
78
    'identity'        => {'mandatory' => 1      , 'fmt' => 'file'},
78
    'bindir'          => {'mandatory' => 1      , 'fmt' => 'text'},
79
    'bindir'          => {'mandatory' => 1      , 'fmt' => 'text'},
79
    'tagdir'          => {'mandatory' => 1      , 'fmt' => 'dir'},
80
    'tagdir'          => {'mandatory' => 1      , 'fmt' => 'dir'},
80
    'forcedirscan'    => {'default'   => 100    , 'fmt' => 'period'},
81
    'forcedirscan'    => {'default'   => 100    , 'fmt' => 'period'},
81
    'tagage'          => {'default'   => '10m'  , 'fmt' => 'period'},
82
    'tagage'          => {'default'   => '10m'  , 'fmt' => 'period'},
Line 106... Line 107...
106
 
107
 
107
#
108
#
108
#   Main processing loop
109
#   Main processing loop
109
#   Will exit when terminated by parent
110
#   Will exit when terminated by parent
110
#
111
#
111
while ( 1 )
112
while (1 )
112
{
113
{
113
    $logger->verbose3("Processing");
114
    $logger->verbose3("Processing");
114
    $now = time();
115
    $now = time();
115
 
116
 
116
    $transferred = {};
117
    $transferred = {};
Line 130... Line 131...
130
    #
131
    #
131
    my $kid;
132
    my $kid;
132
    do {
133
    do {
133
        $kid = waitpid(-1, WNOHANG);
134
        $kid = waitpid(-1, WNOHANG);
134
    } while ( $kid > 0 );
135
    } while ( $kid > 0 );
-
 
136
 
-
 
137
    #   If my PID file ceases to be, then exit the daemon
-
 
138
    #   Used to force daemon to restart
-
 
139
    #
-
 
140
    unless ( -f $conf->{'pidfile'} )
-
 
141
    {
-
 
142
        $logger->logmsg("Terminate. Pid file removed");
-
 
143
        last;
-
 
144
    }
135
}
145
}
136
$logger->logmsg("Child End");
146
$logger->logmsg("Child End");
137
exit 0;
147
exit 0;
138
 
148
 
139
#-------------------------------------------------------------------------------
149
#-------------------------------------------------------------------------------
Line 197... Line 207...
197
        }
207
        }
198
 
208
 
199
        $logger->verbose("Filter Packages: " . $conf->{'packageFilter'})
209
        $logger->verbose("Filter Packages: " . $conf->{'packageFilter'})
200
            if ( defined $conf->{'packageFilter'} );
210
            if ( defined $conf->{'packageFilter'} );
201
 
211
 
-
 
212
        $logger->warn("Non standard ssh port: " . $conf->{'sshport'})
-
 
213
            if ( $conf->{'sshport'} );
-
 
214
            
202
        $logger->warn("Transfer session configured as not active")
215
        $logger->warn("Transfer session configured as not active")
203
            unless ( $conf->{'active'} );
216
            unless ( $conf->{'active'} );
204
 
217
 
205
        $logger->warn("Transfer all projects packages")
218
        $logger->warn("Transfer all projects packages")
206
            if ( $conf->{'allProjects'} );
219
            if ( $conf->{'allProjects'} );
Line 1150... Line 1163...
1150
# Returns         : An shh command string
1163
# Returns         : An shh command string
1151
#
1164
#
1152
sub sshCmd
1165
sub sshCmd
1153
{
1166
{
1154
    my ($tgt_cmd) = @_;
1167
    my ($tgt_cmd) = @_;
-
 
1168
    my $sshPort = '';
-
 
1169
    $sshPort = "-p $conf->{'sshport'}"
-
 
1170
        if ($conf->{'sshport'});
-
 
1171
 
1155
    return "ssh -o \"BatchMode yes\" -i $conf->{'identity'} $conf->{'user'}\@$conf->{'hostname'} \"$tgt_cmd\" 2>&1";
1172
    return "ssh -o \"BatchMode yes\" -i $conf->{'identity'} ${sshPort} $conf->{'user'}\@$conf->{'hostname'} \"$tgt_cmd\" 2>&1";
1156
}
1173
}
1157
 
1174
 
1158
 
1175
 
1159
#-------------------------------------------------------------------------------
1176
#-------------------------------------------------------------------------------
1160
# Function        : parsePkgList
1177
# Function        : parsePkgList
Line 1226... Line 1243...
1226
        $lastTagListScan = 0;
1243
        $lastTagListScan = 0;
1227
	};
1244
	};
1228
 
1245
 
1229
    $SIG{__WARN__} = sub { $logger->warn("@_") };
1246
    $SIG{__WARN__} = sub { $logger->warn("@_") };
1230
    $SIG{__DIE__} = sub { $logger->err("@_") };
1247
    $SIG{__DIE__} = sub { $logger->err("@_") };
1231
    
-
 
1232
 
-
 
1233
}
1248
}
1234
 
1249
 
1235
#-------------------------------------------------------------------------------
1250
#-------------------------------------------------------------------------------
1236
# Function        : LogTxError
1251
# Function        : LogTxError
1237
#
1252
#