Skip Menu |

This queue is for tickets about the Net-SFTP-Foreign CPAN distribution.

Report information
The Basics
Id: 88005
Status: resolved
Priority: 0/
Queue: Net-SFTP-Foreign

People
Owner: Nobody in particular
Requestors: stephen [...] lingraywatches.co.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: error message when program exits
Date: Wed, 21 Aug 2013 16:35:51 +0100
To: bug-Net-SFTP-Foreign [...] rt.cpan.org
From: Stephen Wylie <stephen [...] lingraywatches.co.uk>
It says 'Killed by signal 1.' This can be avoided by using the disconnect method, so the problem is really only in the documentation which advises that disconnect shouldn't normally be used. I'm running a program every 5 minutes on the cron, and getting an email every time, due to the ssh process being killed. -- "It is human nature to think wisely and act in an absurd fashion." - Anatole France
On Wed Aug 21 11:36:08 2013, stephen@lingraywatches.co.uk wrote: Show quoted text
> It says 'Killed by signal 1.' This can be avoided by using the disconnect > method, so the problem is really only in the documentation which advises > that disconnect shouldn't normally be used. I'm running a program every 5 > minutes on the cron, and getting an email every time, due to the ssh > process being killed.
You can avoid the message by using the method described here: http://perlmonks.org/?node_id=1022042
Subject: Re: [rt.cpan.org #88005] error message when program exits
Date: Mon, 26 Aug 2013 03:33:46 -0700 (PDT)
To: "bug-Net-SFTP-Foreign [...] rt.cpan.org" <bug-Net-SFTP-Foreign [...] rt.cpan.org>
From: Salvador Fandino <sfandino [...] yahoo.com>
Show quoted text
----- Original Message -----
> From: Stephen Wylie via RT <bug-Net-SFTP-Foreign@rt.cpan.org> > To: > Cc: > Sent: Wednesday, August 21, 2013 5:36 PM > Subject: [rt.cpan.org #88005] error message when program exits > > Wed Aug 21 11:36:08 2013: Request 88005 was acted upon. > Transaction: Ticket created by stephen@lingraywatches.co.uk >       Queue: Net-SFTP-Foreign >     Subject: error message when program exits >   Broken in: (no value) >     Severity: (no value) >       Owner: Nobody >   Requestors: stephen@lingraywatches.co.uk >       Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=88005 > > > > It says 'Killed by signal 1.'
That means that the SSH process is getting a HUP signal.
> This can be avoided by using the disconnect > method, so the problem is really only in the documentation which advises > that disconnect shouldn't normally be used. I'm running a program every > 5 > minutes on the cron, and getting an email every time, due to the ssh > process being killed.
I guess you are using password authentication and storing the Net::SFTP::Foreign object in a global variable instead of a lexical one (or otherwise, that some reference is keep in some way to the object until global destruction). If the SFTP object reaches the global destruction phase, it may be destroyed after the IO::Pty object handling the ssh process pty and that would cause the delivering of the HUP signal. If that is the problem, the documentation would be right, as it says that the conneciton is closed automatically when the object goes out of scope, the problem being that actually, in your case, it never goes out of scope. As a work around, you can: - save the SFTP object in a lexical variable:    my $sftp = Net::SFTP::Foreign->new(...); - call disconnect explicitly - set the stderr_discard flag from the constructor I will update the docs explaining that.
Subject: Re: [rt.cpan.org #88005] error message when program exits
Date: Mon, 26 Aug 2013 06:12:35 -0700 (PDT)
To: "bug-Net-SFTP-Foreign [...] rt.cpan.org" <bug-Net-SFTP-Foreign [...] rt.cpan.org>
From: Salvador Fandino <sfandino [...] yahoo.com>
Show quoted text
----- Original Message -----
> From: "Salvador \"Fandiño\" via RT" <bug-Net-SFTP-Foreign@rt.cpan.org> > To: > Cc: > Sent: Monday, August 26, 2013 12:34 PM > Subject: Re: [rt.cpan.org #88005] error message when program exits > >       Queue: Net-SFTP-Foreign > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=88005 > > > > > > > ----- Original Message -----
>> From: Stephen Wylie via RT <bug-Net-SFTP-Foreign@rt.cpan.org> >> To: >> Cc: >> Sent: Wednesday, August 21, 2013 5:36 PM >> Subject: [rt.cpan.org #88005] error message when program exits >> >> Wed Aug 21 11:36:08 2013: Request 88005 was acted upon. >> Transaction: Ticket created by stephen@lingraywatches.co.uk >>        Queue: Net-SFTP-Foreign >>      Subject: error message when program exits >>    Broken in: (no value) >>     Severity: (no value) >>        Owner: Nobody >>   Requestors: stephen@lingraywatches.co.uk >>       Status: new >> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=88005 > >> >> >> It says 'Killed by signal 1.'
> > That means that the SSH process is getting a HUP signal. >
>> This can be avoided by using the disconnect >> method, so the problem is really only in the documentation which advises >> that disconnect shouldn't normally be used. I'm running a program
> every
>> 5 >> minutes on the cron, and getting an email every time, due to the ssh >> process being killed.
> > > I guess you are using password authentication and storing the Net::SFTP::Foreign > object in a global variable instead of a lexical one (or otherwise, that some > reference is keep in some way to the object until global destruction). > > If the SFTP object reaches the global destruction phase, it may be destroyed > after the IO::Pty object handling the ssh process pty and that would cause the > delivering of the HUP signal. > > If that is the problem, the documentation would be right, as it says that the > conneciton is closed automatically when the object goes out of scope, the > problem being that actually, in your case, it never goes out of scope.
I have released a new version that includes a work-around for that issue. Could you try it? https://metacpan.org/release/SALVA/Net-SFTP-Foreign-1.76_03
Subject: Re: [rt.cpan.org #88005] error message when program exits
Date: Tue, 27 Aug 2013 11:37:49 +0100
To: bug-Net-SFTP-Foreign [...] rt.cpan.org
From: Stephen Wylie <stephen [...] lingraywatches.co.uk>
Thanks for your explanations. The version I am using is the one from rpmforge, an unofficial Centos repository. I'm not quite sure what version it is! Centos maintainers advise against installing directly from CPAN etc, as it can create obscure conflicts. I don't really know why this is, but as I have an adequate workaround, I am reluctant to go against their advice. I reported it just to help other people who might have the same problem. On 26 August 2013 14:12, Salvador \"Fandiño\" via RT < bug-Net-SFTP-Foreign@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=88005 > > > > > > > > ----- Original Message -----
> > From: "Salvador \"Fandiño\" via RT" <bug-Net-SFTP-Foreign@rt.cpan.org> > > To: > > Cc: > > Sent: Monday, August 26, 2013 12:34 PM > > Subject: Re: [rt.cpan.org #88005] error message when program exits > > > > Queue: Net-SFTP-Foreign > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=88005 > > > > > > > > > > > > > ----- Original Message -----
> >> From: Stephen Wylie via RT <bug-Net-SFTP-Foreign@rt.cpan.org> > >> To: > >> Cc: > >> Sent: Wednesday, August 21, 2013 5:36 PM > >> Subject: [rt.cpan.org #88005] error message when program exits > >> > >> Wed Aug 21 11:36:08 2013: Request 88005 was acted upon. > >> Transaction: Ticket created by stephen@lingraywatches.co.uk > >> Queue: Net-SFTP-Foreign > >> Subject: error message when program exits > >> Broken in: (no value) > >> Severity: (no value) > >> Owner: Nobody > >> Requestors: stephen@lingraywatches.co.uk > >> Status: new > >> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=88005 > > >> > >> > >> It says 'Killed by signal 1.'
> > > > That means that the SSH process is getting a HUP signal. > >
> >> This can be avoided by using the disconnect > >> method, so the problem is really only in the documentation which
> advises
> >> that disconnect shouldn't normally be used. I'm running a program
> > every
> >> 5 > >> minutes on the cron, and getting an email every time, due to the ssh > >> process being killed.
> > > > > > I guess you are using password authentication and storing the
> Net::SFTP::Foreign
> > object in a global variable instead of a lexical one (or otherwise, that
> some
> > reference is keep in some way to the object until global destruction). > > > > If the SFTP object reaches the global destruction phase, it may be
> destroyed
> > after the IO::Pty object handling the ssh process pty and that would
> cause the
> > delivering of the HUP signal. > > > > If that is the problem, the documentation would be right, as it says
> that the
> > conneciton is closed automatically when the object goes out of scope, the > > problem being that actually, in your case, it never goes out of scope.
> > I have released a new version that includes a work-around for that issue. > > Could you try it? > > https://metacpan.org/release/SALVA/Net-SFTP-Foreign-1.76_03 > >
-- "It is human nature to think wisely and act in an absurd fashion." - Anatole France
Subject: Re: [rt.cpan.org #88005] error message when program exits
Date: Tue, 27 Aug 2013 05:27:34 -0700 (PDT)
To: "bug-Net-SFTP-Foreign [...] rt.cpan.org" <bug-Net-SFTP-Foreign [...] rt.cpan.org>
From: Salvador Fandino <sfandino [...] yahoo.com>
Show quoted text
----- Original Message -----
> From: Stephen Wylie via RT <bug-Net-SFTP-Foreign@rt.cpan.org> > To: > Cc: > Sent: Tuesday, August 27, 2013 12:38 PM > Subject: Re: [rt.cpan.org #88005] error message when program exits > >       Queue: Net-SFTP-Foreign > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=88005 > > > Thanks for your explanations. The version I am using is the one from > rpmforge, an unofficial Centos repository. > I'm not quite sure what version it is! Centos maintainers advise against > installing directly from CPAN etc, as it can create obscure conflicts. I > don't really know why this is, but as I have an adequate workaround, I am > reluctant to go against their advice.
Well, their advice is sound. Replacing modules on the system perl may completely ruin your system. On the other hand it is possible to install modules in a private directory and use then for your scripts otherwise you end using really old versions. Nowadays local::lib is the module everybody use to install modules privately. In any case, just for testing, you can unpack the module archive in your home or some other harmless place, and add the lib directory inside to the module search patch. For instance:   PERL5LIB=/tmp/Net-SFTP-Foreign-1.76_03/lib your_script.pl
closing as resolved as a fix was released even if the OP never confirmed that the issue was gone.