From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,NICE_REPLY_A,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 17031 invoked from network); 28 May 2022 19:43:28 -0000 Received: from alyss.skarnet.org (95.142.172.232) by inbox.vuxu.org with ESMTPUTF8; 28 May 2022 19:43:28 -0000 Received: (qmail 8498 invoked by uid 89); 28 May 2022 19:43:54 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Received: (qmail 8491 invoked from network); 28 May 2022 19:43:53 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1653767004; x= 1653853404; bh=O9q2ROeSy9H+fu73B/AxsO2gD5DUQvMx5WYKOepXlbw=; b=F +VRKlvxrjLyhJLx2XLAjZDNHJ7EhS5x56xVxyNCvzq5ks2k5wU5116hjZWt2FwnE oFU+/scFLj3VnbxDeept9XY6VATcJuv9BLEy08PdkBtgzWiEI6B5cl9xYrOUW2h2 DohD/UZxGKXS/tubz1frUaLwwlYjeyt/y+Pa0VPWfGTBTWrQbPkDt3WOGc5PEbGH HW11cMqc1hpZMX60jdu4D57B9t/Z5AdCD03HMCVYA/jy4u7DiyKLixN2dGTICfzp GkUoxiXKxzOX3BgO46/VdTGdbVGP+n0qZRzqItw6hVDPZKwIN6ZdrBy/yWN3KVMi d2UN9TQKd8boZ3nlK0roQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1653767004; x=1653853404; bh=O 9q2ROeSy9H+fu73B/AxsO2gD5DUQvMx5WYKOepXlbw=; b=B1VrJ9O17DXAeWz2H 9FDyTWGXhTfLeFX6wnZ9rdgSoJxXUc5cqQebVusfkV8CwiewZwOWDeOpxNysQIDh xr7xVjGoaCG577JHGDNlCkIfdcTuPkSlyK+CXr6EgpQhvVZtCpZS2DESNjmMXxGw dGhiy5sALd8Sw2Z9SrCJU1hTS5qIbYG01/PxjSRCZBIn/a0KKNE5u8kKx0cvgQtP MASZT4CRWNFDBh9uC+z2B/kQ9bfkSEMvICiDyWXQlY+uQ9whmV2hgfxlKDXShQDT tYucEQnY3rOWxoSMi17stSbiC/9qmWBTfr4fzdTEv8lX/hF7YQUPKNOt72+LlQdU 34p7A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrkedugddugeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtje ertddtfeejnecuhfhrohhmpefurghmuhgvlhcujfholhhlrghnugcuoehsrghmuhgvlhes shhhohhllhgrnhgurdhorhhgqeenucggtffrrghtthgvrhhnpefgveffteelheffjeeuke dvkedviedtheevgeefkeehueeiieeuteeugfettdeggeenucevlhhushhtvghrufhiiigv pedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehsrghmuhgvlhesshhhohhllhgrnhgurd horhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Subject: Re: s6 xinit replacement? To: supervision@list.skarnet.org References: <3VJC4G8PXTKVS.3RQFDLXYQABMW@oak.localdomain> <727c2c8b-2b5e-24b4-f9e5-17e651217cc9@sholland.org> <24F5HUEF0UP3F.2ESV518R0KDGL@oak.localdomain> From: Samuel Holland Message-ID: <842daac2-1413-3ce8-40ac-4af5c63bfa2f@sholland.org> Date: Sat, 28 May 2022 14:43:22 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <24F5HUEF0UP3F.2ESV518R0KDGL@oak.localdomain> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 5/28/22 12:15 PM, Dallin Dahl wrote: > It turns out I had the same issue as Rio, since my login shell was still > controlling my terminal. If I run: > > exec s6-setsid X :3 vt3 > > while logged into tty3, I get an X display. However, I still can't > seem to get it to work with s6-svscan. If I exec into s6-svscan from > my login shell, svscan then controls the tty. If I exec into s6-setsid > s6-svscan, it still seems attached to the tty. I thought that maybe > using the tiocnotty ioctl call would free the tty for X to pick up, > so I wrote the following wrapper program: > > #include > #include > #include > #include > > int main(int argc, char **argv) { > int tty = open("/dev/tty", O_RDONLY); This doesn't close the TTY. I don't know if that makes a difference. > int res = ioctl(tty, TIOCNOTTY); > if(!~res) perror("tiocnotty"); > argv++; > execvp(*argv, argv); > return 0; > } > > and tried to exec into that before s6-svscan, both with and without > s6-setsid. Unfortunately, the process immediately exits. I don't think > it's my wrapper program, since I can run other programs with it without > problems, and they do indeed show up in the output of ps aux without a > controlling terminal. > > So I guess the new question is how can I free the tty after login, > allowing X to open it and control it? Have you tried redirecting all three standard fds elsewhere (/dev/null or a file) when running s6-svscan? Possibly either s6-svscan or s6-supervise is doing some fd manipulation that steals control of the TTY before X can get it. You could also try running s6-supervise directly to narrow this down. Regards, Samuel