unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Sebastian Miele <sebastian.miele@gmail.com>
To: vapnik spaknik <vapniks@yahoo.com>
Cc: guile-user@gnu.org
Subject: Re: how to kill child process?
Date: Sun, 23 Aug 2020 22:31:21 +0200	[thread overview]
Message-ID: <87o8n1yuhy.fsf@gmail.com> (raw)
In-Reply-To: <2139767403.5164633.1598212258730@mail.yahoo.com>

vapnik spaknik <vapniks@yahoo.com> writes:

>> ssh -S ~/.ssh/%C -N -f remotehost &
>> rsync -au -e "ssh -S ~/.ssh/%C remotehost" remotehost:file1 backupdir/file1
>> rsync -au -e "ssh -S ~/.ssh/%C remotehost" remotehost:file2 backupdir/file2
>
> and finally, find the pid and kill the ssh session:
>
>> ps -e|grep ssh
>> kill <PID>

This does not answer your exact question, but such behavior can be
acheived very automatically by putting something like the following into
~/.ssh/config:

  ControlMaster auto
  ControlPath ~/.ssh/socket/%C
  ControlPersist 5

This automatically creates master processes.  And the respective master
processes automatically terminate after 5 seconds.  See 'man 5
ssh_config'.

See "ControlMaster" in 'man 5 ssh_config' for a possible limitation:
"X11 and ssh-agent(1) forwarding is supported over these multi‐ plexed
connections, however the display and agent forwarded will be the one
belonging to the master connection i.e. it is not pos‐ sible to forward
multiple displays or agents."

But even then: ssh seems to have a '-o <option>'.  From 'man 1 ssh':
"This is useful for specifying options for which there is no separate
command-line flag."  So you do not even have to put it into the config
and can use it only on specific commands.

Best wishes
Sebastian



  reply	other threads:[~2020-08-23 20:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2139767403.5164633.1598212258730.ref@mail.yahoo.com>
2020-08-23 19:50 ` how to kill child process? vapnik spaknik
2020-08-23 20:31   ` Sebastian Miele [this message]
2020-08-23 23:08     ` Sebastian Miele
2020-08-24 11:07     ` vapnik spaknik via General Guile related discussions
2020-08-24 12:05   ` Sebastian Miele
2020-08-24 13:15     ` vapnik spaknik via General Guile related discussions
2020-08-24 14:27       ` Sebastian Miele
2020-08-24 14:33         ` Sebastian Miele
2020-08-24 16:51         ` vapnik spaknik via General Guile related discussions
2020-08-24 18:47           ` Sebastian Miele
2020-08-25 18:21             ` vapnik spaknik via General Guile related discussions

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o8n1yuhy.fsf@gmail.com \
    --to=sebastian.miele@gmail.com \
    --cc=guile-user@gnu.org \
    --cc=vapniks@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).