Tarantool development patches archive
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Alexander Turenko <alexander.turenko@tarantool.org>
Cc: tml <tarantool-patches@dev.tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH 6/7] popen: handle setsid os specifics
Date: Tue, 3 Mar 2020 14:45:37 +0300	[thread overview]
Message-ID: <20200303114537.GF22649@uranus> (raw)
In-Reply-To: <20200303113853.2gmoaph7zet7rzwo@tkn_work_nb>

On Tue, Mar 03, 2020 at 02:38:53PM +0300, Alexander Turenko wrote:
> On Mon, Mar 02, 2020 at 11:12:26PM +0300, Cyrill Gorcunov wrote:
> > On linux it is fine to call setsid right after
> > the vfork, in turn on bsd pgrp should be used.
> 
> Can you refer a source of this information?
> 
> I tried the following snippet on Mac OS and FreeBSD and it at least does
> not report an error:
> 
>  | #include <unistd.h>
>  | #include <stdio.h>
>  | 
>  | int
>  | main()
>  | {
>  | 	if (setsid() == -1) {
>  | 		perror("setsid");
>  | 		return 1;
>  | 	}
>  | 	return 0;
>  | }
> 
> $ cc setsid.c -o setsid
> $ echo 1 | ./setsid
> 
> (Pipeline is to not be a session leader already, this will lead to EPERM.)

I found that people are hitting the same problem.
https://stackoverflow.com/questions/15179361/setpgrp-setpgid-fails-works-on-mac-osx-not-on-linux

The main problem is that I don't have a clue about macos internals
but it looks like we have to setup group instead. To me it is
vague area. I suspect it is due to vfork macos specifics.

  reply	other threads:[~2020-03-03 11:45 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-02 20:12 [Tarantool-patches] [PATCH 0/7] popen: various fixes and a test Cyrill Gorcunov
2020-03-02 20:12 ` [Tarantool-patches] [PATCH 1/7] core/say: Export logger fd Cyrill Gorcunov
2020-03-02 20:12 ` [Tarantool-patches] [PATCH 2/7] popen: allow accessing environ variable Cyrill Gorcunov
2020-03-02 20:12 ` [Tarantool-patches] [PATCH 3/7] popen: close_inherited_fds - add support for macos/freebsd Cyrill Gorcunov
2020-03-02 20:12 ` [Tarantool-patches] [PATCH 4/7] popen: log errors if popen creation failed Cyrill Gorcunov
2020-03-02 20:12 ` [Tarantool-patches] [PATCH 5/7] popen: add logging in child process Cyrill Gorcunov
2020-03-02 20:12 ` [Tarantool-patches] [PATCH 6/7] popen: handle setsid os specifics Cyrill Gorcunov
2020-03-03 11:38   ` Alexander Turenko
2020-03-03 11:45     ` Cyrill Gorcunov [this message]
2020-03-10 15:49       ` Alexander Turenko
2020-03-10 16:36         ` Alexander Turenko
2020-03-10 16:41           ` Cyrill Gorcunov
2020-03-10 17:12             ` Alexander Turenko
2020-03-10 17:40               ` Cyrill Gorcunov
2020-03-11  7:55               ` [Tarantool-patches] [PATCH v5 6/7] popen: handle sid on macos Cyrill Gorcunov
2020-03-06 14:30   ` [Tarantool-patches] [PATCH v2 6/7] popen: handle setsid os specifics Cyrill Gorcunov
2020-03-10  8:02     ` [Tarantool-patches] [PATCH v3 6/7] popen: use ioctl on macos Cyrill Gorcunov
2020-03-02 20:12 ` [Tarantool-patches] [PATCH 7/7] test/unit: add popen test Cyrill Gorcunov
2020-03-11 20:22   ` Alexander Turenko
2020-03-12 10:38     ` [Tarantool-patches] [PATCH v5 " Cyrill Gorcunov
2020-03-12 11:58 ` [Tarantool-patches] [PATCH 0/7] popen: various fixes and a test Alexander Turenko
2020-03-12 12:18   ` Cyrill Gorcunov
2020-03-16 15:58 ` Kirill Yukhin

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

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

  git send-email \
    --in-reply-to=20200303114537.GF22649@uranus \
    --to=gorcunov@gmail.com \
    --cc=alexander.turenko@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 6/7] popen: handle setsid os specifics' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox