From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id mGJ7GzdW8WEOVQAAgWs5BA (envelope-from ) for ; Wed, 26 Jan 2022 15:09:59 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 0GMxGDdW8WFYSgAAauVa8A (envelope-from ) for ; Wed, 26 Jan 2022 15:09:59 +0100 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 2512B412A3 for ; Wed, 26 Jan 2022 15:09:59 +0100 (CET) Received: from localhost ([::1]:57240 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCizm-00009A-71 for larch@yhetil.org; Wed, 26 Jan 2022 09:09:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36922) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCikH-0001R1-6U for guix-devel@gnu.org; Wed, 26 Jan 2022 08:53:57 -0500 Received: from mugam.systemreboot.net ([139.59.75.54]:41228) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCikE-0001XV-52 for guix-devel@gnu.org; Wed, 26 Jan 2022 08:53:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Type:MIME-Version:Message-ID:Date: Subject:To:From:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=5XcmrEJZOG3ZvO4fme/k9NCtMWCObOukCuYl1eTqh60=; b=ovrpIl8FegMz8dvSkrlO4lpY+5 4YZxrDaVb3sM+VUMDkRACFMkKvjBleOrphW3Car7kFgVZDGLsTjBTauJH1nWkL6VwmhqIjDO1abDg 004OgKeWvsYc2TxgU2jvNeDuQYO2EFR5Q5hLFCp414wdFm1UdenWjcY9L4UJlAsSm8/pbwQMR+ca8 e2QsRtuSFbpZ9LGT64P9dNcq5u6wbyP5L7tul/yp6Ocjsb5F80rkhe9wNr/uzRC3aNzMenNj6wmrK Qh7T+MRlHPq6rfpcIc2J81L0z63Z5h0a0gGS72Oy9r5/WcgKTxsF+7zW28iTQmmHS27s08BskSg7/ K5uJGOZw==; Received: from [192.168.2.1] (port=35578 helo=steel) by systemreboot.net with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1nCik6-0005Ah-Nj for guix-devel@gnu.org; Wed, 26 Jan 2022 19:23:46 +0530 From: Arun Isaac To: guix-devel@gnu.org Subject: Shepherd should not reboot on exit when running as root Date: Wed, 26 Jan 2022 19:23:42 +0530 Message-ID: <87tudq8uxl.fsf@systemreboot.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Received-SPF: pass client-ip=139.59.75.54; envelope-from=arunisaac@systemreboot.net; helo=mugam.systemreboot.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1643206199; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=5XcmrEJZOG3ZvO4fme/k9NCtMWCObOukCuYl1eTqh60=; b=otcdSwEwKbapchULPqdRmnV7xs1V0V/QLsdfLif/mYXSaB2wxirpwvXRmoEB2QAcOQKfWS zM8hZIQT4Sb+rbZX3F4yUtjMPMbr0c3aAjzcREMwfxv5iWKDSk4lP7jqbNJHiSqiTBuQJ2 X76pOkZT7zIbjjy4NN415xofBROyKZNwujhBn/l/5b/hTEVqMxCb2J+TXj9ditl7IDrQH4 91fuAH2juRFoEKDUF05B57/IT3K/gB4XdX8ek6kmUnFdgtQM5VYsvuYYosnbUaG7aPhW8D IKSJukU9wypEALd5XSobklt/P611NdMsi/eGG0+I/kTJp4yY7J/QxlXCsLFuIA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1643206199; a=rsa-sha256; cv=none; b=dvHNmZw2k3u/ZICfqKoJjUal2ug4rz+v57mJ/NXdSA05e3pQtEQ1L90VFZjX2Vna9pamKZ NeF7GRekftwEJNyHAxftoP+1xHjDg3qzEp8ykjOrGmY0Q8Wp1pbkg5aWNPuM9tLNVVv8YO AVIHmnQa2832XRAzS6sdytQPNVHZnzlzgvjz50ssJeiYAnm120kyWAoP5SJnPqcJ5A16o8 wCqVXxmGiv6aoqNakxtL8/HrSi8rOz+7WM8puJzikzqmZgzIdUzndgySJAsoDkuBjioAB5 ssul+RnSOswk+xXj0wgewUfZ3sahYWl0m9TYxfw1bpH9p78KHcxUK55GCUQ1LQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=systemreboot.net header.s=default header.b=ovrpIl8F; dmarc=fail reason="SPF not aligned (relaxed)" header.from=systemreboot.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.13 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=systemreboot.net header.s=default header.b=ovrpIl8F; dmarc=fail reason="SPF not aligned (relaxed)" header.from=systemreboot.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 2512B412A3 X-Spam-Score: -4.13 X-Migadu-Scanner: scn1.migadu.com X-TUID: f4Vn6/NOV4o/ --=-=-= Content-Type: text/plain Hi, If shepherd is run as root, it assumes it is the init system and reboots the system. Since shepherd is not just an init system, but can also be used as a non-init process to manage other daemons, this is probably not good default behaviour. At the very least, it would be nice to have a command-line option to disable this behaviour. Just yesterday, I was tinkering with shepherd on a production server running Debian as the host system, and ended up accidentally rebooting it. Needless to say, I went through much pain and suffering! :-) I suppose I should count myself very lucky that it didn't halt the system! :-P Here is the relevant piece of code in modules/shepherd.scm of the shepherd source code. --8<---------------cut here---------------start------------->8--- (define* (quit-exception-handler key #:optional value) "Handle the 'quit' exception, rebooting if we're running as root." (if (zero? (getuid)) (begin (local-output (l10n "Rebooting...")) (reboot)) (quit))) --8<---------------cut here---------------end--------------->8--- Thanks! Arun --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFPBAEBCAA5FiEEf3MDQ/Lwnzx3v3nTLiXui2GAK7MFAmHxUmYbHGFydW5pc2Fh Y0BzeXN0ZW1yZWJvb3QubmV0AAoJEC4l7othgCuzioEH/jZQYlz2Et1+GUorPZly SH9jDn/W0JzfylbdlARe7lnJ1jZLhHWYRWlOYYEUhbj38viy4wLFuhdbUtfV/F0x UkPnigyoAX4piEd7BMy2UWIjY3LwaXtr9+3nGy8gTpiq6tkZR4dVHaA3APB7Z1zL fh9yN/FUTGeC1+bfgjA3odNwwNRWY2ybNah+svhihUneMv3B7L+nhTD5EaxNWVfI VMKaPNTQztlNduR2S60IoLqabAII42emc0I64Nc7WUNUrOfX7n1iaSBCmSGV+Y5U odNYX1U/pwBmdhQ0PNx7iun6awVs+a9oRt9C5yMos6qgG4bei4U5fBkCwEytkK48 Cjk= =s1NA -----END PGP SIGNATURE----- --=-=-=--