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: Mon, 24 Aug 2020 20:47:40 +0200	[thread overview]
Message-ID: <87zh6jlw37.fsf@gmail.com> (raw)
In-Reply-To: <663933226.5501400.1598287861052@mail.yahoo.com>

vapnik spaknik <vapniks@yahoo.com> writes:
>
> Even without the '-f' flag I still get the same problem in guile.  If
> I print the pid of the child process I can see that it is different
> from the pid of the ssh process.

When I put

  (let ((pid  (primitive-fork))
        (host         THE-HOST)
        (control   "~/.ssh/%C"))
    (if (eq? 0 pid)
        (execlp "ssh" "ssh"
                "-F" "none"
                "-S" control
                "-N" "-M"
                host)
        (begin
          (display pid)
          (sleep 3600))))

into a file '0.scm' and run it using, e.g., 'guile 0.scm' (tested with
Guile 3.0.4, 2.2.6, and 1.8.8), and after that run 'pgrep -a ssh' in
another terminal, I do get the same PIDs.

So everything is as expected here.  (Apart from that, somehow the single
'ssh' child of the Guile process gets killed automatically when the
Guile process gets killed.  I do not exactly know why.  This may very
well be reliable behaviour prescribed by POSIX.)

It is really, really unlikely that Guile is the culprit of the
unexpected behavior that you describe.  Think about it this way: How
likely is it to introduce such a bug in a wrapper for 'execvp'?  It
would have to be really convoluted relative to the quite simple way that
such a wrapper (almost certainly) can be written.

However, if you can become really, really sure, that Guile in fact is
the culprit (try AT LEAST something like '(execlp "sleep" "1234")'
instead of '(execlp "ssh" ...)' before):

What system?  What version of Guile?

I am running recent Arch Linux x86_64.

Best wishes
Sebastian



  reply	other threads:[~2020-08-24 18:47 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
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 [this message]
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=87zh6jlw37.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).