Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: cygwin opensshd: how to detach remotely with fork/exec?

by zentara (Archbishop)
on Dec 13, 2012 at 17:30 UTC ( #1008690=note: print w/replies, xml ) Need Help??

in reply to cygwin opensshd: how to detach remotely with fork/exec?

Since no one has answered you yet, I'll throw this out. To exec a program in the background with SSH2 on linux, we use this to close off the file numbers of the process being backgrounded. I think it is important to do that, just as if it were a daemon.
my $chan = $ssh2->channel(); $chan->blocking(1); $chan->exec("nohup /home/zentara/perlplay/net/zzsleep > foo.out 2> foo +.err < /dev/null &"); $chan->send_eof;
I know the SSH2 libs are not what you are using, but it might help for you to see a correctly setup nohup string.

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

Replies are listed 'Best First'.
Re^2: cygwin opensshd: how to detach remotely with fork/exec?
by Boldra (Deacon) on Dec 17, 2012 at 09:11 UTC

    Many thanks for your ideas Zentara.

    Do you know if there is a difference between the way you are redirecting the standard filehandles and the way I do it in my example with close? I've tried both now, and neither seems to solve the detach problem with the cygwin sshd. nohup also doesn't seem to have any meaning to cygwin - but I'm not forcing the connection closed. Maybe I can do that with an alarm?

    At the moment I'm working with psexec again. I'm repeatedly sending simple psexec commands until one works, and then doing the important command. This seems reasonably reliable, if slow.

    - Boldra

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1008690]
[Corion]: marto: I believe nowadays, at least window.opener should not be set anymore (except maybe within the same domain)
[Corion]: But I wouldn't really know as I don't use iexplore much (except at $work) and mostly surf with JS disabled (except at $work :) )
[marto]: yeah, this is at work, where some intranet app launches links via When users close the intranet page so that only the new JS opened windows exist, clicking URLs in an email (or whatever) don't open
[Corion]: marto: It somewhat makes sense that the reduced popup window doesn't get new URLs, but it makes less sense that no new browser window opens :)
[marto]: Corion, yeah, why no new browser window opens is currently beyond my understanding

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2018-03-21 11:49 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (267 votes). Check out past polls.