[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to kill child process?

From: Sebastian Miele
Subject: Re: how to kill child process?
Date: Mon, 24 Aug 2020 20:47:40 +0200
User-agent: mu4e 1.4.13; emacs 27.1.50

vapnik spaknik <> 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"
          (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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]