From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id x6AsC3UBM19nOwAA0tVLHw (envelope-from ) for ; Tue, 11 Aug 2020 20:37:09 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 4AP+BHUBM18fcQAAbx9fmQ (envelope-from ) for ; Tue, 11 Aug 2020 20:37:09 +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 2405C9403C9 for ; Tue, 11 Aug 2020 20:37:07 +0000 (UTC) Received: from localhost ([::1]:47134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k5b18-0006nY-Ry for larch@yhetil.org; Tue, 11 Aug 2020 16:37:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47486) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k5b14-0006nB-Ka for guix-patches@gnu.org; Tue, 11 Aug 2020 16:37:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58489) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k5b14-0007FB-BU for guix-patches@gnu.org; Tue, 11 Aug 2020 16:37:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k5b14-00073w-9T for guix-patches@gnu.org; Tue, 11 Aug 2020 16:37:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42816] [PATCH] guix-install.sh: Add support for openrc Resent-From: Morgan.J.Smith@outlook.com Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 11 Aug 2020 20:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 42816 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42816@debbugs.gnu.org Cc: Morgan Smith X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.159717819927115 (code B ref -1); Tue, 11 Aug 2020 20:37:02 +0000 Received: (at submit) by debbugs.gnu.org; 11 Aug 2020 20:36:39 +0000 Received: from localhost ([127.0.0.1]:41802 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k5b0g-00073G-V4 for submit@debbugs.gnu.org; Tue, 11 Aug 2020 16:36:39 -0400 Received: from lists.gnu.org ([209.51.188.17]:49358) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k5b0e-000738-U1 for submit@debbugs.gnu.org; Tue, 11 Aug 2020 16:36:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47446) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k5b0e-0006ei-Mo for guix-patches@gnu.org; Tue, 11 Aug 2020 16:36:36 -0400 Received: from mail-dm3nam07olkn2085.outbound.protection.outlook.com ([40.92.43.85]:46368 helo=NAM02-DM3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k5b0c-0007D8-Sq for guix-patches@gnu.org; Tue, 11 Aug 2020 16:36:36 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ntZIX5SMq9ivU4PNpawHYwP9Dd1HfbcCnxg4DSu13bKBE8lFr0qhkTMCQGfG1vFbOymYb0zBLP0HlguazuVIHUkPQJORErZKmLHn5dn4dYSwt3GF3bPGbP5ItA7DFMqSqeBWDxN8tisoPUs/0fMstNYz2zDkKc2TFI6MTloGcX6ck3y/suhpcDOb9lKSOlPQ2eR1ADAnYitIfkgY0Y9+nerw97A741S/m4pzN44DTwkSAFW+rhul64gygHmgB6SMvrm5h0c31CqNanSSxDjWZXZ3yQcC7hXuHvagDzYsGfncHo9b5MS/h16cfEvSUCXlLXXZrRu947v3P52+6lCTGA== 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=7H7MGz+v9NIK+TdSvhBpeyYvmMoD5lN66s6LFb3Trg8=; b=R6u+OiQYtiVXt++/TRXEiVNG+6Au+5PceZcx0BP3xNR4Rzp97K7XSEz5Zsm+PzEHQcoGY8QrVoPE+XQGBnETLIt9iJkpJUYxfwcY2agN4p2Srt6Eyj4YMTbSz8CgjznJ4d+BAQegEbf/UTLA+xtsG+gdgMUbMLTB0Xtwg0pkT4BI251T43+e8qLHMDBb8MqCK/NE+tVTV0oVbgXt7pSQsR2KGs5dzNxnhfEqUjHEzek05cadq2BPB5vPgw/JZEWK5uSs2qoXHPoA/4gQpu3aiOTRzrGzB9DIRpAjV7gUAbWLUTH3jUcSW2pZHJKvU9Qg3NQ/BoXF5aS4l24DA65xJw== 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=7H7MGz+v9NIK+TdSvhBpeyYvmMoD5lN66s6LFb3Trg8=; b=oSQtSmNr/B/vR17ms8y+B6zK6LifUcaEIaYZN4tlWFWhSqkevQhEt3ghdGVYc9USyc1T7p9UwYCI0/fHMqak3OtIKRbuoSetnqJsgVwgeg3wj+IlaYIClnGHo2QgNhbkTEIQSSIMuR5e4LzMzzemWgQwqa49ZYg7vo1bf1gHXg+PnmS7lV1pBUV63Sx1KJ8+kEnmvCpMuqxdU2lC/tDlc8ool6eZdxooRFcU28JW62Y5jhP2VkNfeygNbO5Cog3FCXmrAfzuE9HakYtTzfmIls/qZGTXBnJunYT2OHivdaMNMHRp+VGDQCfYOiDDiSJKhWpD9q2IpeKmTmFFvbIz5w== Received: from BL2NAM02FT043.eop-nam02.prod.protection.outlook.com (10.152.76.58) by BL2NAM02HT130.eop-nam02.prod.protection.outlook.com (10.152.76.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.19; Tue, 11 Aug 2020 20:36:32 +0000 Received: from DM5PR1001MB2105.namprd10.prod.outlook.com (2a01:111:e400:7e46::4d) by BL2NAM02FT043.mail.protection.outlook.com (2a01:111:e400:7e46::351) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.19 via Frontend Transport; Tue, 11 Aug 2020 20:36:32 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:88367A0DFA51DDB96C7C9511C6419B4BDFBB005201016D36ECEE4C436854E9BD; UpperCasedChecksum:667FF2E0B231611CF431BB62C9A908094777CBEF61208375C87897248790A7BD; SizeAsReceived:7409; Count:47 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; Tue, 11 Aug 2020 20:36:32 +0000 From: Morgan.J.Smith@outlook.com Date: Tue, 11 Aug 2020 16:36:17 -0400 Message-ID: X-Mailer: git-send-email 2.27.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: YQXPR01CA0088.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:41::17) To DM5PR1001MB2105.namprd10.prod.outlook.com (2603:10b6:4:2b::24) X-Microsoft-Original-Message-ID: <20200811203617.11739-1-Morgan.J.Smith@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from workarch.localdomain (184.164.26.34) by YQXPR01CA0088.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:41::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.15 via Frontend Transport; Tue, 11 Aug 2020 20:36:31 +0000 X-Mailer: git-send-email 2.27.0 X-Microsoft-Original-Message-ID: <20200811203617.11739-1-Morgan.J.Smith@outlook.com> X-TMN: [G3A3jh27hnelyHOCqYNNO4xE7jP3jtzJ] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 47 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: f93f450a-de71-4b02-08f9-08d83e363b66 X-MS-Exchange-SLBlob-MailProps: q+fD6XS3/UL2UDcFXhKBVFnJZ5FTblsjbVYgwBuewXSyBK9jYn5jyYmlvoZyjxonBKdPFiPYb4OG2+gDK7kEeierswmq1MOnhD1prrky1u5j0+MmJRWJh9xyL69P19XW6x/Ti27PypmN78smc4OC2S0gFa70Hw7SZ9am5OMCb0iPSMQbKgunBSKM6GYQ6oTIKHaEhP+xj4CC8P2NV6fxCRgzJx0U+UIOSuBA351XWnMiN4CL7d1uuBXJuc4M7MFv3FFBwAPki0Wrv7b/HU4tFLTMoZ4hcIOKnNu7u0nhd8SFCkcKYEF9/twIZkzLeygzIwBzsQFL9tdEB38AEQF7rxOM/tOG7l1L3oDgn9DS8DWfFVY7f7ugOezRfvtUFl3IFUQ1hr+uxcStktKCol3QCKD/aHoDy/s6B25vpGaClgRVVqd0pI+D6Zx/zeIgwAs7fbN36easrbxfPzxcBcFEdf3zFtmk9+kizbBmmy4Ry/zBQDFuNkug+zqnxNPPf4MsDC9s6v4FyqzE9e0ywnmNsVsJvwSsAVn/8V5F/IGF1bHH2wP7KiMW/84gMhhHPAKSQMiYt41lcR6TTpcuBYnaRtdgUVQnJW6zqDgtzDmfo9QDGS/Y9ETITyja1i4J0PeWvheJJTdE9/weINwUGEstKmQPbGzELEzvWhWhw76qNnbM3JGj/3KZ6mcas/yfsnRPeD/nqPCddD/BzhqpExQ1dg== X-MS-TrafficTypeDiagnostic: BL2NAM02HT130: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jzzrJX0aem1gloiBHdxNruYcbJbXSqbmgVHqCNHKSnSYK8d/SNXJTnRi2AVt14FMjkslq6v29e3bHjaGzaswGmpW/alkfzLxvZ92kdn0Jc6r8tImXT7jFrGFtYpWSVvxZ81TvdabIdvn72jYzdSJfvrdyWW8wHU6TEpLr7ae0Xlkf5fIU71lWEwPJ9qUvhUwlMb1xeE2E00rGaG/FTnkYg== 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: KkuP9SAnW5ZhkEbh+vAetEf6uGByN65tW0N08IAOeRmnstXJNAHbofXLfUJVde4TE3f41gdKmByYHLZ+GhKoHGhzaJTzqXFFP6oV93dX4jRh+7kvrGo3ZH4teHcFa6tWb/n1IoeCzTwC8oQfF2KB5A== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f93f450a-de71-4b02-08f9-08d83e363b66 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2020 20:36:32.1242 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: BL2NAM02FT043.eop-nam02.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: BL2NAM02HT130 Received-SPF: pass client-ip=40.92.43.85; envelope-from=Morgan.J.Smith@outlook.com; helo=NAM02-DM3-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/11 16:36:32 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.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, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -2.3 (--) 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=oSQtSmNr; 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: 4.59 X-TUID: udES752a99iD From: Morgan Smith * etc/guix-install.sh: Add support for openrc I also removed the --warning=no-timestamp tar flag and changed grep to use extended regex instead of perl regex since these flags where not supported on the alpine linux image I was using to test (3.12.0-x86_64). --- etc/guix-install.sh | 18 +++++++++++++++--- etc/openrc/guix-daemon | 11 +++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 etc/openrc/guix-daemon diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 72dc3839e8..9e9f8470d8 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -150,6 +150,9 @@ 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" else INIT_SYS="NA" _err "${ERR}Init system could not be detected." @@ -212,7 +215,7 @@ guix_get_bin_list() | sort -Vu)") latest_ver="$(echo "$bin_ver_ls" \ - | grep -oP "([0-9]{1,2}\.){2}[0-9]{1,2}" \ + | grep -oE "([[:digit:]]{1,2}\.){2}[[:digit:]]{1,2}" \ | tail -n1)" default_ver="guix-binary-${latest_ver}.${ARCH_OS}" @@ -268,8 +271,7 @@ sys_create_store() _debug "--- [ $FUNCNAME ] ---" cd "$tmp_path" - tar --warning=no-timestamp \ - --extract \ + tar --extract \ --file "$pkg" && _msg "${PAS}unpacked archive" @@ -384,6 +386,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/etc/openrc/guix-daemon b/etc/openrc/guix-daemon new file mode 100644 index 0000000000..436673f169 --- /dev/null +++ b/etc/openrc/guix-daemon @@ -0,0 +1,11 @@ +#!/sbin/openrc-run + +export GUIX_LOCPATH=/var/guix/profiles/per-user/root/guix-profile/lib/locale +export LC_ALL=en_US.utf8 +command="/var/guix/profiles/per-user/root/current-guix/bin/guix-daemon" +command_args="--build-users-group=guixbuild" +command_background="yes" +pidfile="/var/run/guix-daemon.pid" + +output_log="/var/log/guix-daemon-stdout.log" +error_log="/var/log/guix-daemon-stderr.log" -- 2.27.0