Subject: | freebsd 11.2 bug |
Date: | Wed, 27 Feb 2019 23:08:51 +0300 |
To: | bug-Net-OpenSSH [...] rt.cpan.org |
From: | Andrew Vylegzhanin <avv314 [...] gmail.com> |
Hi!
I've successfully used Net::OpenSSH for couple years under FeeBSD
9.3-RELEASE.
It's simple perl script invoked by propraetry billing system for handling
external events by coping files via scp.
Here is fragment:
open( my $stderr_fh, ">>", $LOGDIR."vg-arcd-ssh.log" ) || warn "Can't
log\n";
my $tm = localtime;
print $stderr_fh "$tm [$$] \n";
$Net::OpenSSH::debug_fh = $stderr_fh;
$Net::OpenSSH::debug = ~0;
my $ssh = Net::OpenSSH->new( 'cptctrl@2.2.2.2:8844', default_stderr_fh
=> $stderr_fh, default_stdout_fh => $stderr_fh, async => 0 );
if( $ssh->error ) {
syslog( "Couldn't establish SSH connection: ". $ssh->error );
syslog( "Moving job file to queue" );
rename( $DATADIR.$tmpfile, $DATADIR."jobs/".$tmpfile );
}
else {
syslog( "DEBUG: before scp" );
$ssh->scp_put( {async => 0, timeout => 10 }, $DATADIR.$tmpfile,
"jobs" ) || syslog( "DEBUG: scp failed: " . $ssh->error );
syslog( "DEBUG: after scp" );
if( $ssh->error ) {
syslog( "scp_put to remote host failed: ".$ssh->error );
syslog( "Moving job file to queue" );
rename( $DATADIR.$tmpfile, $DATADIR."jobs/".$tmpfile );
}
else {
syslog( "Copied" );
unlink( $DATADIR.$tmpfile );
}
}
After upgrading to FreeBSD 11.2-RELEASE I've got following problem:
- when I run this script from command line (from bash), everything is ok,
always.
- when this script invoked from billing system (from FreeBSD process,
written on C++ mostly AFAIK), it's perl process ends without errors on
OpenSSH->new or after $ssh->scp_put (so sometimes it copied files)
Here is debug output from $Net::OpenSSH::debug = ~0
From command line:
# open_ex: ['ssh','-V']
# io3 mloop, cin: 0, cout: 1, cerr: 0
# io3 fast, cin: 0, cout: 1, cerr: 0
# stdout, bytes read: 51 at offset 0
#> 4f 70 65 6e 53 53 48 5f 37 2e 35 70 31 2c 20 4f 70 65 6e 53 53 4c 20 31
2e 30 2e 32 6f 2d 66 72 | OpenSSH_7.5p1, OpenSSL 1.0.2o-fr
#> 65 65 62 73 64 20 20 32 37 20 4d 61 72 20 32 30 31 38 0a
| eebsd 27 Mar 2018.
# io3 fast, cin: 0, cout: 1, cerr: 0
# stdout, bytes read: 0 at offset 51
# leaving _io3()
# _waitpid(50657) => pid: 50657, rc: 0, err:
# OpenSSH version is 7.5p1,
# ctl_path: /root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb,
ctl_dir: /root/.libnet-openssh-perl/
# _is_secure_path(dir: /root/.libnet-openssh-perl, file mode: 16832, file
uid: 0, euid: 0
# _is_secure_path(dir: /root, file mode: 16877, file uid: 0, euid: 0
# set_error(0 - 0)
# call args:
['ssh','-o','ServerAliveInterval=30','-o','ControlPersist=no','-2MNx','-S','/root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb','-l','cptctrl','-p','8844','2.2.2.2','--']
# tracer attached, ssh pid: 50658, tracer pid: 50659
# master state jumping from _STATE_START to _STATE_AWAITING_MUX
# file object not yet found at
/root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb,
state:_STATE_AWAITING_MUX
# file object not yet found at
/root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb,
state:_STATE_AWAITING_MUX
# file object not yet found at
/root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb,
state:_STATE_AWAITING_MUX
# file object not yet found at
/root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb,
state:_STATE_AWAITING_MUX
# file object not yet found at
/root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb,
state:_STATE_AWAITING_MUX
# file object not yet found at
/root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb,
state:_STATE_AWAITING_MUX
# file object not yet found at
/root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb,
state:_STATE_AWAITING_MUX
# file object not yet found at
/root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb,
state:_STATE_AWAITING_MUX
# file object not yet found at
/root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb,
state:_STATE_AWAITING_MUX
# file object not yet found at
/root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb,
state:_STATE_AWAITING_MUX
# file object not yet found at
/root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb,
state:_STATE_AWAITING_MUX
# file object not yet found at
/root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb,
state:_STATE_AWAITING_MUX
# file object not yet found at
/root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb,
state:_STATE_AWAITING_MUX
# file object not yet found at
/root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb,
state:_STATE_AWAITING_MUX
# file object not yet found at
/root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb,
state:_STATE_AWAITING_MUX
# file object not yet found at
/root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb,
state:_STATE_AWAITING_MUX
# file object not yet found at
/root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb,
state:_STATE_AWAITING_MUX
# file object not yet found at
/root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb,
state:_STATE_AWAITING_MUX
# file object found at
/root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb
# master state jumping from _STATE_AWAITING_MUX to _STATE_RUNNING
# call args:
['ssh','-O','check','-T','-S','/root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb','-l','cptctrl','-p','8844','2.2.2.2','--']
# open_ex:
['ssh','-O','check','-T','-S','/root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb','-l','cptctrl','-p','8844','2.2.2.2
# io3 mloop, cin: 0, cout: 1, cerr: 0
# io3 fast, cin: 0, cout: 1, cerr: 0
# stdout, bytes read: 28 at offset 0
#> 4d 61 73 74 65 72 20 72 75 6e 6e 69 6e 67 20 28 70 69 64 3d 35 30 36 35
38 29 0d 0a | Master running (pid=50658)..
# io3 fast, cin: 0, cout: 1, cerr: 0
# stdout, bytes read: 0 at offset 28
# leaving _io3()
# _waitpid(50668) => pid: 50668, rc: 0, err:
# scp call args:
['scp','-q','-o','ControlPath=/root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb','-S','ssh','-P','8844','--','/prov/tsey/cpt.job.50656r','cptctrl@2.2.2.2:
jobs']
# open_ex:
['scp','-q','-o','ControlPath=/root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb','-S','ssh','-P','8844','--','/prov/tsey/cpt.job.50656r','cptctrl@2.2.2.2:
jobs']
# _waitpid(50669) => pid: 50669, rc: 0, err: Interrupted system call
# DESTROY(Net::OpenSSH=HASH(0x80259f288), pid: 50658)
# sending exit control to master
# call args:
['ssh','-O','exit','-T','-S','/root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb','-l','cptctrl','-p','8844','2.2.2.2','--']
# open_ex:
['ssh','-O','exit','-T','-S','/root/.libnet-openssh-perl/0c3865501b7c522fd3404c3e5c0e36cb','-l','cptctrl','-p','8844','2.2.2.2','--']
# io3 mloop, cin: 0, cout: 1, cerr: 0
# io3 fast, cin: 0, cout: 1, cerr: 0
# stdout, bytes read: 20 at offset 0
#> 45 78 69 74 20 72 65 71 75 65 73 74 20 73 65 6e 74 2e 0d 0a
| Exit request sent...
# io3 fast, cin: 0, cout: 1, cerr: 0
# stdout, bytes read: 0 at offset 20
# leaving _io3()
# _waitpid(50671) => pid: 50671, rc: 0, err:
# set_error(1 - aborted)
# master state jumping from _STATE_RUNNING to _STATE_KILLING
# killing master
# _master_kill: 50658
# waitpid(master: 50658) => pid: 0, rc:
# waitpid(master: 50658) => pid: 50658, rc: Interrupted system call
# master state jumping from _STATE_KILLING to _STATE_GONE
Invoked from billing system:
# open_ex: ['ssh','-V']
# io3 mloop, cin: 0, cout: 1, cerr: 0
# io3 fast, cin: 0, cout: 1, cerr: 0
# stdout, bytes read: 51 at offset 0
#> 4f 70 65 6e 53 53 48 5f 37 2e 35 70 31 2c 20 4f 70 65 6e 53 53 4c 20 31
2e 30 2e 32 6f 2d 66 72 | OpenSSH_7.5p1, OpenSSL 1.0.2o-fr
#> 65 65 62 73 64 20 20 32 37 20 4d 61 72 20 32 30 31 38 0a
| eebsd 27 Mar 2018.
# io3 fast, cin: 0, cout: 1, cerr: 0
# stdout, bytes read: 0 at offset 51
# leaving _io3()
# _waitpid(62488) => pid: 62488, rc: 0, err:
# OpenSSH version is 7.5p1,
# ctl_path: /root/.libnet-openssh-perl/ca9523a03741dc7955578d7fb1933c0d,
ctl_dir: /root/.libnet-openssh-perl/
# _is_secure_path(dir: /root/.libnet-openssh-perl, file mode: 16832, file
uid: 0, euid: 0
# _is_secure_path(dir: /root, file mode: 16877, file uid: 0, euid: 0
# set_error(0 - 0)
# call args:
['ssh','-o','ServerAliveInterval=30','-o','ControlPersist=no','-2MNx','-S','/root/.libnet-openssh-perl/ca9523a03741dc7955578d7fb1933c0d','-l','cptctrl','-p','8844','2.2.2.2','--']
# tracer attached, ssh pid: 62489, tracer pid: 62490
What I should look for?
--
Andrew
Message body is not shown because it is too large.