From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id WKGyK7R2EmHwVQAAgWs5BA (envelope-from ) for ; Tue, 10 Aug 2021 14:53:08 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id SHh3J7R2EmFDOQAA1q6Kng (envelope-from ) for ; Tue, 10 Aug 2021 12:53:08 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E980717348 for ; Tue, 10 Aug 2021 14:53:07 +0200 (CEST) Received: from localhost ([::1]:46120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDRFj-0005q8-36 for larch@yhetil.org; Tue, 10 Aug 2021 08:53:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60726) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDRFe-0005pq-OH for guix-patches@gnu.org; Tue, 10 Aug 2021 08:53:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:47132) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mDRFe-0001vL-Gn for guix-patches@gnu.org; Tue, 10 Aug 2021 08:53:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mDRFe-0005aN-Ep for guix-patches@gnu.org; Tue, 10 Aug 2021 08:53:02 -0400 Subject: bug#49839: [PATCH] shepherd: add keep-tty flag to skip setsid Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Tue, 10 Aug 2021 12:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 49839 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: muradm Cc: 49839-done@debbugs.gnu.org Mail-Followup-To: 49839@debbugs.gnu.org, ludo@gnu.org, mail@muradm.net Received: via spool by 49839-done@debbugs.gnu.org id=D49839.162859993121385 (code D ref 49839); Tue, 10 Aug 2021 12:53:02 +0000 Received: (at 49839-done) by debbugs.gnu.org; 10 Aug 2021 12:52:11 +0000 Received: from localhost ([127.0.0.1]:58674 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDREl-0005Yf-JO for submit@debbugs.gnu.org; Tue, 10 Aug 2021 08:52:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51832) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDREf-0005Y5-Ra for 49839-done@debbugs.gnu.org; Tue, 10 Aug 2021 08:52:05 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47798) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDREa-0001PG-EV; Tue, 10 Aug 2021 08:51:56 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=45054 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDREY-0003Xk-Jh; Tue, 10 Aug 2021 08:51:56 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87eebbwd35.fsf@muradm.net> Date: Tue, 10 Aug 2021 14:51:51 +0200 In-Reply-To: <87eebbwd35.fsf@muradm.net> (muradm's message of "Tue, 03 Aug 2021 04:07:10 +0300") Message-ID: <87czqlsbrs.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1628599988; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-to: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=MpY4Ap3rwY9STrN1Gdr7Rx3l5qo8SL4/Du0x4rVNUKo=; b=UU+VcvGKeH4iZO/Ew4F/ZM8oV49DpavBDJ7CtUaGZ44IsmK0EoAFKXwK3VkfAtnbFA3Gh6 Eml/sY7i4ZhrtLZp3+zy4SmM6tgZvyueJWTBWRI8F6mAKZD8Lclc6yDV/c2Jbdgv9jMSFQ Af+5e2Kr1Nw2MVZuGi/rg1NwfKxuX9yLU/ZlP0dozXo0913MHyPYKyeAiBmPxfzD8ueJ1f rcscrB8OoMEWDQi247CfdqZ3jEAlVhU+K3EF+m6Jtqe9hrmnqYYK2tbkt8FjEe4lFi2aRp PmoQ+yVj83UI5JGMj1DdHzwbhAYM8FzxirmLIXF+sK8sR0CAvb/LdNdVv7XLGA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628599988; a=rsa-sha256; cv=none; b=QH/Zw3PdJRGouUZlTBtBvWTfXQPiCiGdtg4yE7n0F+Fxifav/A3BuiJl1UwWxfJQlbtIhS ywmiToYmnMo435Ob8SVIoBXWkeNa9Diru4djfUUfSeBRV6fxDkWXX+iIdH/+7nZxVWJkI4 jVuB2iRjPjvsQ1QbJdTgeFBCxaC/0f25N6rmTAZ4YSWF86I6CgD9695gknoWfxp5eJD6ib zN2EUYp1LSnuRr2MLKDtAv5BqkKJ0mKUBEl92m4x9HO8IkjRfrv84ZxQFTezM1lcqlqCoj 2jmUzTvmY9+EFsGd4AvC9L3P9RbL3azU9pfLV5xxNQsE8Sw74yh1C8AMcuWKBg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.91 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: E980717348 X-Spam-Score: -2.91 X-Migadu-Scanner: scn0.migadu.com X-TUID: 8tyD92tjTEy0 Hi, muradm skribis: > * modules/shepherd/service.scm: add keep-tty flag to skip setsid > > when using shepherd as user, programs like xorg server, potentially > any > program which ends up interacting with user, require terminal to > remain. > > currently, setsid is called unconditionally from exec-command > function, > making it impossible to have such process. > > this adds keep-tty flag to make-forkexec-constructor up to > exec-command > function where setsid is actually called. > > diff --git a/modules/shepherd/service.scm b/modules/shepherd/service.scm > index 587ff68..1ae9544 100644 > --- a/modules/shepherd/service.scm > +++ b/modules/shepherd/service.scm > @@ -786,6 +786,7 @@ daemon writing FILE is running in a separate PID name= space." > (log-file #f) > (directory (default-service-directory)) > (file-creation-mask #f) > + (keep-tty #f) > (environment-variables (default-environment-varia= bles))) > "Run COMMAND as the current process from DIRECTORY, with FILE-CREATION= -MASK > if it's true, and with ENVIRONMENT-VARIABLES (a list of strings like > @@ -804,7 +805,7 @@ false." > ((program args ...) > ;; Become the leader of a new session and session group. > ;; Programs such as 'mingetty' expect this. > - (setsid) > + (unless keep-tty (setsid)) I did that slightly differently: https://git.savannah.gnu.org/cgit/shepherd.git/commit/?id=3Dc43f81794344d= bac31bcb8b8f1c0d266f47f14fa Let me know if it works for you. Thanks, Ludo=E2=80=99.