From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id +IQBJ5pkM1+bfwAA0tVLHw (envelope-from ) for ; Wed, 12 Aug 2020 03:40:10 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id qF2IIZpkM19MLgAAB5/wlQ (envelope-from ) for ; Wed, 12 Aug 2020 03:40:10 +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 9852F94050F for ; Wed, 12 Aug 2020 03:40:09 +0000 (UTC) Received: from localhost ([::1]:36420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k5hcW-0006Wb-0Y for larch@yhetil.org; Tue, 11 Aug 2020 23:40:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57402) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k5hcQ-0006Vu-VK for guix-patches@gnu.org; Tue, 11 Aug 2020 23:40:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59166) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k5hcQ-0007mk-MR for guix-patches@gnu.org; Tue, 11 Aug 2020 23:40:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k5hcQ-0001gh-K6 for guix-patches@gnu.org; Tue, 11 Aug 2020 23:40:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42816] [PATCH 2/2] guix-install.sh: Add openrc support Resent-From: Morgan.J.Smith@outlook.com Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 12 Aug 2020 03:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42816 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: me@tobias.gr Cc: Morgan Smith , 42816@debbugs.gnu.org Received: via spool by 42816-submit@debbugs.gnu.org id=B42816.15972035886448 (code B ref 42816); Wed, 12 Aug 2020 03:40:02 +0000 Received: (at 42816) by debbugs.gnu.org; 12 Aug 2020 03:39:48 +0000 Received: from localhost ([127.0.0.1]:42478 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k5hc6-0001fp-Dh for submit@debbugs.gnu.org; Tue, 11 Aug 2020 23:39:48 -0400 Received: from mail-bn8nam11olkn2084.outbound.protection.outlook.com ([40.92.20.84]:25312 helo=NAM11-BN8-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k5hbz-0001fF-GF for 42816@debbugs.gnu.org; Tue, 11 Aug 2020 23:39:39 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I4HzNfGJX10wfJMppnjRAlzXC2CedjeynT5r81Plu8WKFl9ePXc+fhlfwZYvEcuc2KzKFJAeUnZTodL2Ku47r6QCWwRMfm8Jor6kph04AgttU/PH7hod5qtzNEI1lokkyg+g1+da1SIMUXhqA8H4Cbj/dIBdm+agIhXLHs0N+7pl2J6kW74XiIkgxUobEeOWo8TYIY+G9ugTieY1RkZla58CfDVzRwkSTP5YmW6Aw/rAGrQjsJHw9MEKY95xPbfIQsp63C8yYU8OUyha99l78dnVx9s9ehfBF4rNQavFXEld86U260O+h0qa3crZx2oQX9g1qk8M43APhHlKdRf1hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Cgcf/xMZXAycu7BjYQ4bIoyI7PRufIW0oz8MYJpMPr0=; b=jgOPLJSO6a2V7gcNLpE1q+fPpDotdexLbF6OehAYr8M4WdMajhjbjGwl0+hUKXaSvIj+nIaSN1pJQ+GQOOqFmhCAxnhC+RQq/En61HLbkWIqoVdbF77TXBITzg7qBcZBE9ZagsapKKE4L1FTVLv0cpzPU3W7asMfpTSUjseaIncze8U8hb2Mwm+L+YVn/FgCu+JRXbGv8ZrrITPpllhR6/rxyLu6bxmUggVvdEuIq+R0dMNEKdtKegaVWV0PDZweJZa4KRgdFCvD3x69Qa/9ZmIi3s8zmpyyH3YXtULgjmJB5sgF7svIS3Q/7jhe32aySfpPTumqpNjwmo003l/aIA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Cgcf/xMZXAycu7BjYQ4bIoyI7PRufIW0oz8MYJpMPr0=; b=K7NRzpvtAKFISJTd0Kp+rRFscNVOXRz+ygCV2I/4agQM5sem9RNOnvI/8Jw+2Oq6aDErDH1lS2D8H1Rfzstw8RoTkjupQQCv3W2LFXiOD9mrxfzsBqkkAruGJFo9bpjg1PE5xEb8lR1iumUaSzRLe/oEKJElby+TRzOYY7WY1f2GdgfD8SBOMWbr6hnhf2u9SH+t8li2ZBJybevujoTEbKLzmNIDQPpbjZ8zcckEs8qlTmxOZ5HMNa/Oc1i1ubQeRKX3lh3lXaKERd8LHwTa791m7TbkIpWVzBout1s45T5McCdpss8aJMw/2JLBm2p8eNP4JSxupQOVC/o4wvLBGg== Received: from BN8NAM11FT060.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::4c) by BN8NAM11HT030.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::268) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.16; Wed, 12 Aug 2020 03:39:29 +0000 Received: from DM5PR1001MB2105.namprd10.prod.outlook.com (2a01:111:e400:fc4b::44) by BN8NAM11FT060.mail.protection.outlook.com (2a01:111:e400:fc4b::467) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.16 via Frontend Transport; Wed, 12 Aug 2020 03:39:29 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:C8B25E9D97B9241EA33082C9E51C5AA3DC2817EAFFA3A53D11B6772C37308C32; UpperCasedChecksum:B027DCF5BA72BE2E17C54F2A38CD28D28BB2B8E6F1B30EBB7E91E16AB0DE52AE; SizeAsReceived:8747; Count:49 Received: from DM5PR1001MB2105.namprd10.prod.outlook.com ([fe80::cc1a:65a6:d74d:52f4]) by DM5PR1001MB2105.namprd10.prod.outlook.com ([fe80::cc1a:65a6:d74d:52f4%6]) with mapi id 15.20.3283.015; Wed, 12 Aug 2020 03:39:29 +0000 From: Morgan.J.Smith@outlook.com Date: Tue, 11 Aug 2020 23:38:42 -0400 Message-ID: X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200812033842.99352-1-Morgan.J.Smith@outlook.com> References: <87r1sc98m8.fsf@nckx> <20200812033842.99352-1-Morgan.J.Smith@outlook.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: YTOPR0101CA0009.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b00:15::22) To DM5PR1001MB2105.namprd10.prod.outlook.com (2603:10b6:4:2b::24) X-Microsoft-Original-Message-ID: <20200812033842.99352-2-Morgan.J.Smith@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from workarch.localdomain (184.164.26.34) by YTOPR0101CA0009.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b00:15::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.15 via Frontend Transport; Wed, 12 Aug 2020 03:39:29 +0000 X-Mailer: git-send-email 2.28.0 X-Microsoft-Original-Message-ID: <20200812033842.99352-2-Morgan.J.Smith@outlook.com> X-TMN: [Mz8uFtMf0ZeK3xF42n9rQjFpr6TRFx1Y] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 49 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: d2146a96-8c8d-4b96-87a5-08d83e715199 X-MS-Exchange-SLBlob-MailProps: 79Jo46q8hhC0JQTTD4CjH08I0IOG8GQi3oZMaepxEZXqr0em3iMscBDlQvqC0RPubEsFdRkS7QaoIDiNmriA9CxobHqGjQEbmuOPgWaL6tLgIM9+09R/w+BJsvIatPspzi1HFJg9QzVOHc3VVt2edHRSkHISrBGQUl/Hyt3+jvjfi5syfZrhdjOUl3FAESwtyDL7xmIU6zhxRinayGDfSzeZn5PF6lcftXkdwNyiEXqIPH3OLAG3Wb21/W/lGPmev1pb3PvteTavLnq+Hq/O6AmZhmWa+37QfRd0I44rvHiO1hTe+VudzTh/WcB4Bxwl59YzroSfCqpAU/ZSlLyC9cBAl7row5q1tS4fz0uW5HF3PpGFSogvZNNDlIA7WFLwNkrHBbR1Q1sTSJ01Z0ywf8ByobFbbjkStnWVCJZVL5kebpEVvmWTWD2ynBGrx/glJc4hHfHH5ol+COpIc6z7vjftZGmwXBeHFg1FSU8cf4Tj1K6ABf0qWbrb59pKSVoecliHT2+07sYFUhsVSyhVc/n3S6smPh+e2kIDrf5VAIIUfqf0doDa0ADcv5NngJwoH8iTYVxkrKcwZ8v+armPrMxj9s/s5/MS7323wx4vgd4WeXAWoljM2FOYbZSgHAucRrORhrvd0bvEa7c9j6T2XnxzDhKF6Uvyoxb7tsA2qDgluWhTyIGFXOKdmUN2C6Uq X-MS-TrafficTypeDiagnostic: BN8NAM11HT030: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: moMED22OtPyvrY+vfwguJ4rWclMRcSHBRPrpYNfzhmbawpRg+gjK3MXK4I2AdqlrywhXsNMYbigPUqFdyzkdlZzR91BbcChPPKV2NCeWywRo0i7bEvAWsskMsTXc/EECVoz/YL8efF6neQmWacxkOI3/E+ZXH3ntUcQS+mtTJfQGlukrTlcZIBZWadLpheq0DvnQDh+rNvinFMs2AC6a8g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:0; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR1001MB2105.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:; DIR:OUT; SFP:1901; X-MS-Exchange-AntiSpam-MessageData: TZzy0ywqTMr8nhparNvh88qBSdHB7Mbz5kYMTEa3TbjwmCtTAGEzg2TQhEZIdmritQzLJds0igsJUBFZaQd3MjT2VkMaaPHUaqbkemTrG8N0ktqHMFmBIPeOcdhilDUPNrry4JzGUbvpbOH34eRPPw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d2146a96-8c8d-4b96-87a5-08d83e715199 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2020 03:39:29.6656 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT060.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8NAM11HT030 X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) 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-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=outlook.com header.s=selector1 header.b=K7NRzpvt; dmarc=fail reason="SPF not aligned (relaxed)" header.from=outlook.com (policy=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-Spam-Score: 2.09 X-TUID: FxiUKbVwMGA2 From: Morgan Smith Tested and working on Alpine Linux 3.12.0-x86_64 * etc/guix-install.sh: Add openrc support * etc/openrc/guix-daemon.in: New file - openrc service file * nix/local.mk (etc/openrc/guix-daemon): New rule. (nodist_openrcservice_DATA): Add etc/openrc/guix-daemon.in . (CLEANFILES): Add etc/openrc/guix-daemon . * .gitignore: Add etc/openrc/guix-daemon . --- I'm pretty far out of comfort zone on these changes so please let me know how this works. I basically guessed what needed to be changed in local.mk. --- .gitignore | 1 + etc/guix-install.sh | 15 +++++++++++++++ nix/local.mk | 17 +++++++++++++++-- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f630444a0f..e2f745b42a 100644 --- a/.gitignore +++ b/.gitignore @@ -74,6 +74,7 @@ /etc/guix-publish.conf /etc/guix-publish.service /etc/init.d/guix-daemon +/etc/openrc/guix-daemon /guix-daemon /guix/config.scm /libformat.a diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 06edbaaffd..ff4b95f124 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -4,6 +4,7 @@ # Copyright © 2018 Ricardo Wurmus # Copyright © 2018 Efraim Flashner # Copyright © 2019, 2020 Tobias Geerinckx-Rice +# Copyright © 2020 Morgan Smith # # This file is part of GNU Guix. # @@ -150,6 +151,10 @@ chk_init_sys() _msg "${INF}init system is: sysv-init" INIT_SYS="sysv-init" return 0 + elif [[ $(openrc --version 2>/dev/null) =~ \(OpenRC\) ]]; then + _msg "${INF}init system is: OpenRC" + INIT_SYS="openrc" + return 0 else INIT_SYS="NA" _err "${ERR}Init system could not be detected." @@ -383,6 +388,16 @@ sys_enable_guix_daemon() service guix-daemon start; } && _msg "${PAS}enabled Guix daemon via sysv" ;; + openrc) + { mkdir -p /etc/init.d; + cp "${ROOT_HOME}/.config/guix/current/etc/openrc/guix-daemon" \ + /etc/init.d/guix-daemon; + chmod 775 /etc/init.d/guix-daemon; + + rc-update add guix-daemon default && + rc-service guix-daemon start; } && + _msg "${PAS}enabled Guix daemon via OpenRC" + ;; NA|*) _msg "${ERR}unsupported init system; run the daemon manually:" echo " ${ROOT_HOME}/.config/guix/current/bin/guix-daemon --build-users-group=guixbuild" diff --git a/nix/local.mk b/nix/local.mk index 005cde5563..2bb01041b9 100644 --- a/nix/local.mk +++ b/nix/local.mk @@ -180,6 +180,17 @@ etc/init.d/guix-daemon: etc/init.d/guix-daemon.in \ "$<" > "$@.tmp"; \ mv "$@.tmp" "$@" +# The service script for openrc. +openrcservicedir = $(sysconfdir)/init.d +nodist_openrcservice_DATA = etc/openrc/guix-daemon + +etc/openrc/guix-daemon: etc/openrc/guix-daemon.in \ + $(top_builddir)/config.status + $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \ + $(SED) -e 's|@''localstatedir''@|$(localstatedir)|' < \ + "$<" > "$@.tmp"; \ + mv "$@.tmp" "$@" + # The '.conf' jobs for Upstart. upstartjobdir = $(libdir)/upstart/system nodist_upstartjob_DATA = etc/guix-daemon.conf etc/guix-publish.conf @@ -194,7 +205,8 @@ etc/guix-%.conf: etc/guix-%.conf.in \ CLEANFILES += \ $(nodist_systemdservice_DATA) \ $(nodist_upstartjob_DATA) \ - $(nodist_sysvinitservice_DATA) + $(nodist_sysvinitservice_DATA) \ + $(nodist_openrcservice_DATA) EXTRA_DIST += \ %D%/AUTHORS \ @@ -203,7 +215,8 @@ EXTRA_DIST += \ etc/guix-daemon.conf.in \ etc/guix-publish.service.in \ etc/guix-publish.conf.in \ - etc/init.d/guix-daemon.in + etc/init.d/guix-daemon.in \ + etc/openrc/guix-daemon.in if CAN_RUN_TESTS -- 2.28.0