Discussion:
lftp orphaning scp process
Joan Aguilar
2013-08-29 14:46:33 UTC
Permalink
Hi all,

I'm currently using lftp connecting to a server using sftp. I have noticed
that while a transfer is taking place and the connection is lost, lftp is
orphaning a process.
This occurs when it attempts to reconnect to the server, which spawns a new
child process using of the connecting program. The transfer might resume,
or eventually fail if you have a maximum amount of retries.In both cases
lftp will return but only with the second process spawned. The first
spawned connecting program process will still be there:

When I initiate the transfer, "ps -elf | egrep '(lftp|ssh)' " says:
* *
*4 S root 20420 4459 0 80 0 - 2276 - 13:54 pts/1
00:00:00 /usr/bin/lftp -u <username>: sftp://<server-ip>*
*4 S root 20421 20420 0 80 0 - 2664 - 13:54 pts/3 00:00:00
ssh -a -x -oUserKnownHostsFile=/dev/null
-oIdentityFile=/config/identity.rsa -s -l <username> <server-ip> sftp*
I let it transfer for a time, then I terminate my network connection either
by just pulling the cable or by bringing down the VPN tunnel to the server.
The transfer stops, for a time, the banner just shows the transfer speed
dropping, but once it says *[Continuing...], *a new process is spawned, and
*4 S root 20420 4459 0 80 0 - 2276 - 13:54 pts/1
00:00:00 /usr/bin/lftp -u **<username>**: sftp:/**/<server-ip>**
**4 S root 20421 20420 0 80 0 - 2664 - 13:54 ?
00:00:00 ssh -a -x -oUserKnownHostsFile=/dev/null -oIdentityFile=/config/
**identity**.rsa -s -l **<username> **<server-ip>** sftp
**4 S root 20635 20420 0 80 0 - 1980 - 13:54 pts/4
00:00:00 ssh -a -x -oUserKnownHostsFile=/dev/null -oIdentityFile=/config/
**identity**.rsa -s -l **<username>** **<server-ip>** sftp*
Once the transfer fails, or succeeds, one of the ssh process is still
there...

*4 S root 20421 1 0 80 0 - 2664 - 13:54 ? 00:00:00
ssh -a -x -oUserKnownHostsFile=/dev/null
-oIdentityFile=/config/identity.rsa -s -l **<username> **<server-ip>**
sftp*
I have a few variables set, aside from the default configuration:

set net:max-retries 1
set net:reconnect-interval-base 10
set net:timeout 10
set sftp:connect-program "ssh -a -x -oUserKnownHostsFile=/dev/null
-oIdentityFile=/config/*identity*.rsa"

And I'm simply running 'mput -c myfile.log' in the lftp command line.

Thanks for any input!

~Joan
Joan Aguilar
2013-08-29 14:52:36 UTC
Permalink
I forgot to add.

I initially saw this in version 4.0.9-1 for CentOS6.
I installed 4.4.9-1 for Fedora, still same behavior, still in CentOS6
Post by Joan Aguilar
Hi all,
I'm currently using lftp connecting to a server using sftp. I have noticed
that while a transfer is taking place and the connection is lost, lftp is
orphaning a process.
This occurs when it attempts to reconnect to the server, which spawns a
new child process using of the connecting program. The transfer might
resume, or eventually fail if you have a maximum amount of retries.In both
cases lftp will return but only with the second process spawned. The first
* *
*4 S root 20420 4459 0 80 0 - 2276 - 13:54 pts/1
00:00:00 /usr/bin/lftp -u <username>: sftp://<server-ip>*
*4 S root 20421 20420 0 80 0 - 2664 - 13:54 pts/3
00:00:00 ssh -a -x -oUserKnownHostsFile=/dev/null
-oIdentityFile=/config/identity.rsa -s -l <username> <server-ip> sftp*
I let it transfer for a time, then I terminate my network connection
either by just pulling the cable or by bringing down the VPN tunnel to the
server. The transfer stops, for a time, the banner just shows the transfer
speed dropping, but once it says *[Continuing...], *a new process is
*4 S root 20420 4459 0 80 0 - 2276 - 13:54 pts/1
00:00:00 /usr/bin/lftp -u **<username>**: sftp:/**/<server-ip>**
**4 S root 20421 20420 0 80 0 - 2664 - 13:54 ?
00:00:00 ssh -a -x -oUserKnownHostsFile=/dev/null -oIdentityFile=/config/
**identity**.rsa -s -l **<username> **<server-ip>** sftp
**4 S root 20635 20420 0 80 0 - 1980 - 13:54 pts/4
00:00:00 ssh -a -x -oUserKnownHostsFile=/dev/null -oIdentityFile=/config/
**identity**.rsa -s -l **<username>** **<server-ip>** sftp*
Once the transfer fails, or succeeds, one of the ssh process is still
there...
*4 S root 20421 1 0 80 0 - 2664 - 13:54 ?
00:00:00 ssh -a -x -oUserKnownHostsFile=/dev/null
-oIdentityFile=/config/identity.rsa -s -l **<username> **<server-ip>**
sftp*
set net:max-retries 1
set net:reconnect-interval-base 10
set net:timeout 10
set sftp:connect-program "ssh -a -x -oUserKnownHostsFile=/dev/null
-oIdentityFile=/config/*identity*.rsa"
And I'm simply running 'mput -c myfile.log' in the lftp command line.
Thanks for any input!
~Joan
Alexander V. Lukyanov
2013-09-02 06:28:39 UTC
Permalink
Please try this patch.

--
Alexander.

Loading...