From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sebastian Miele Newsgroups: gmane.lisp.guile.user Subject: Re: how to kill child process? Date: Sun, 23 Aug 2020 22:31:21 +0200 Message-ID: <87o8n1yuhy.fsf@gmail.com> References: <2139767403.5164633.1598212258730.ref@mail.yahoo.com> <2139767403.5164633.1598212258730@mail.yahoo.com> Reply-To: sebastian.miele@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17093"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.4.13; emacs 27.1.50 Cc: guile-user@gnu.org To: vapnik spaknik Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sun Aug 23 22:31:43 2020 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k9weU-0004LW-GV for guile-user@m.gmane-mx.org; Sun, 23 Aug 2020 22:31:42 +0200 Original-Received: from localhost ([::1]:53552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k9weT-0002TI-IY for guile-user@m.gmane-mx.org; Sun, 23 Aug 2020 16:31:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46260) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k9weF-0002T7-MS for guile-user@gnu.org; Sun, 23 Aug 2020 16:31:27 -0400 Original-Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:34249) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k9weE-0002FQ-4B for guile-user@gnu.org; Sun, 23 Aug 2020 16:31:27 -0400 Original-Received: by mail-wr1-x429.google.com with SMTP id f7so6746586wrw.1 for ; Sun, 23 Aug 2020 13:31:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:reply-to:in-reply-to :message-id:date:mime-version:content-transfer-encoding; bh=VExlZF3WR9WA47qkuT1DRJOZN62H2NxkC9byUO/mJtg=; b=igzhXLxX0Mo+Wa0p9DVO05Ogi9k31AH5EF/WMcLn3TGsn8wDc16vRV5Z8QPGCKWLnA G0CK0NhRt4v0UlkwfilwNHt75loFQTho2tqaIigvG2T9xnLN7hNeC9VZk0rQQcd2Eg/a m69Gbm2aTGoqGOpv+5cziA9uO5a/5x8XNzgpdKwFKfsBj4hjG03gTLrjZlEzCy1k8REw o27f59GCWy9OPJu8CKNbuIopYpF3VhVZLw7ILYB7TIeCOlP3VssaMdP8wHpLaoVv1OGg YaHZoRN1rGTCM/UiFt/s1NYa/INmH7kWsPDWCkcdf5FKoFOYv/91RBFKgwwT/qmzBQXz ht6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :reply-to:in-reply-to:message-id:date:mime-version :content-transfer-encoding; bh=VExlZF3WR9WA47qkuT1DRJOZN62H2NxkC9byUO/mJtg=; b=H0HlzVXLHC5Wqdac+YqMVtQxYfmNVZWbdmcVg6jb244LUS5ibA0qa09gmnr4hA44zB RKymWRLZ37AbaFKq2gv1BstBpe9GfxBwzTqbLDjFoVSouMKT4N4+6wpvVhMtnZLi6mqX LCjNwQsBK2jY4kUU6e3Y/WyiazgeLbCMibV4BVmmBcibYfvokCRr7OzuodzfkmTxIYXM y65kQt5CgVwIQqgHUqMmtLTRiplL7tiW3XHt3a9T7dQMM+B6PkShpJv95q1zzIelUD21 HlNOxItDOIt5xwXv+nDfsZMw2hm1ZooMqqQi96bf4VopJ9nLd8wB6t9BaRxkehi7FqUL M7Ag== X-Gm-Message-State: AOAM532gUw7OklSMhEBCcJP0oXOAdY/0y9YekA3W1htiB567PvNS6poQ uPPqFZjPqwi3I0uyNpp1xTvNjqLuZfjCxg== X-Google-Smtp-Source: ABdhPJwxe53QNN24q6aGEDFXsZTQmqb/WCWL6WsyZoRXlX+p+mPUqi8+PzPmXOg8F0uS5gzskYOL1w== X-Received: by 2002:a5d:6a83:: with SMTP id s3mr2707822wru.125.1598214683887; Sun, 23 Aug 2020 13:31:23 -0700 (PDT) Original-Received: from huette ([2a02:908:175c:4260:33a6:b2b0:4ad5:928d]) by smtp.gmail.com with ESMTPSA id a7sm18555243wmj.24.2020.08.23.13.31.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Aug 2020 13:31:23 -0700 (PDT) In-reply-to: <2139767403.5164633.1598212258730@mail.yahoo.com> Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=sebastian.miele@gmail.com; helo=mail-wr1-x429.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:16827 Archived-At: vapnik spaknik writes: >> ssh -S ~/.ssh/%C -N -f remotehost & >> rsync -au -e "ssh -S ~/.ssh/%C remotehost" remotehost:file1 backupdir/fi= le1 >> rsync -au -e "ssh -S ~/.ssh/%C remotehost" remotehost:file2 backupdir/fi= le2 > > and finally, find the pid and kill the ssh session: > >> ps -e|grep ssh >> kill 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=E2=80=90 ple= xed connections, however the display and agent forwarded will be the one belonging to the master connection i.e. it is not pos=E2=80=90 sible to for= ward multiple displays or agents." But even then: ssh seems to have a '-o