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 SFwKMywNM19uRwAA0tVLHw (envelope-from ) for ; Tue, 11 Aug 2020 21:27:08 +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 IA1fLSwNM18OIAAAB5/wlQ (envelope-from ) for ; Tue, 11 Aug 2020 21:27: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 1EC9E9402A0 for ; Tue, 11 Aug 2020 21:27:08 +0000 (UTC) Received: from localhost ([::1]:41660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k5bnX-0005QD-3r for larch@yhetil.org; Tue, 11 Aug 2020 17:27:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k5bnT-0005Q4-47 for guix-patches@gnu.org; Tue, 11 Aug 2020 17:27:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58588) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k5bnS-0004Ji-RZ for guix-patches@gnu.org; Tue, 11 Aug 2020 17:27:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k5bnS-0008I2-Gp for guix-patches@gnu.org; Tue, 11 Aug 2020 17:27:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42816] [PATCH] guix-install.sh: Add support for openrc Resent-From: Tobias Geerinckx-Rice Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 11 Aug 2020 21:27: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: Morgan.J.Smith@outlook.com Cc: 42816@debbugs.gnu.org Received: via spool by 42816-submit@debbugs.gnu.org id=B42816.159718122131858 (code B ref 42816); Tue, 11 Aug 2020 21:27:02 +0000 Received: (at 42816) by debbugs.gnu.org; 11 Aug 2020 21:27:01 +0000 Received: from localhost ([127.0.0.1]:41901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k5bnN-0008Hi-FO for submit@debbugs.gnu.org; Tue, 11 Aug 2020 17:27:01 -0400 Received: from tobias.gr ([80.241.217.52]:44746) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k5bnI-0008HV-3s for 42816@debbugs.gnu.org; Tue, 11 Aug 2020 17:26:56 -0400 Received: by tobias.gr (OpenSMTPD) with ESMTP id 3b2ba11a; Tue, 11 Aug 2020 21:27:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=tobias.gr; h=from:to:cc :subject:references:in-reply-to:date:message-id:mime-version :content-type; s=2018; i=me@tobias.gr; bh=6yA3vAM5Jowrh3+CtxhlIu 8j1SWqxZ+upKy6ntbUfS4=; b=eM9Dv2SkJLGN7qCEEDhkRN6P3v7wErnzwhWErt N0adx0U35L07dNEXoaotetDkGE74PLhdlM/Z3Bkh9Ng3N3zTDTAhUru78JCdngmd fGv1xUTS4PYk0xR010VOWyUcpYSwhqrs45PKxubGqqPL59uKgpethVKbE6/l5lC8 y/maGr0J1S3OAJIWTpo3/G55yrew1+SOmrNHJZsQeGD530FXPy12qpJcAnN8lRwJ MQSJyDKBoCqVHjvumehwVzrmRZNrjjbRru9UriW2KXO/QXFXnMv6ERM9aDqI4DLd YZRd9okXYuznQjYx6oWS9u/3BtYhfo46kBasoPZh3EaW6hGw== Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id 073bf6f0 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Tue, 11 Aug 2020 21:27:12 +0000 (UTC) BIMI-Selector: v=BIMI1; s=default; References: In-reply-to: Date: Tue, 11 Aug 2020 23:26:55 +0200 Message-ID: <87r1sc98m8.fsf@nckx> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.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" Reply-to: Tobias Geerinckx-Rice , Tobias Geerinckx-Rice via Guix-patches From: Tobias Geerinckx-Rice via Guix-patches via X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=tobias.gr header.s=2018 header.b=eM9Dv2Sk; dmarc=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: -1.61 X-TUID: bI93pLEbyI20 --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Morgan, Morgan.J.Smith@outlook.com =E5=86=99=E9=81=93=EF=BC=9A > * etc/guix-install.sh: Add support for openrc \o/ thanks! > I also removed the --warning=3Dno-timestamp tar flag My understanding was that this silenced a scary but harmless=20 warning from older (GNU?) tar versions. I'm happy to see it go if=20 it actually breaks others. > and changed grep to use > extended regex instead of perl regex since these flags where not=20 > supported on > the alpine linux image I was using to test (3.12.0-x86_64). Both Alpine compatibility changes are very welcome but should be=20 in a separate commit. Keep commits confined to one logical change=20 whenever possible. > --- 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=3D"sysv-init" > return 0 > + elif [[ $(openrc --version 2>/dev/null) =3D~ \(OpenRC\) ]];=20 > then OK. I didn't realise the script still had severe bashism. > + _msg "${INF}init system is: OpenRC" > + INIT_SYS=3D"openrc" Add a =E2=80=98return 0=E2=80=99 line here for consistency with the rest of= the=20 code. > latest_ver=3D"$(echo "$bin_ver_ls" \ > - | grep -oP "([0-9]{1,2}\.){2}[0-9]{1,2}"=20 > \ > + | grep -oE=20 > "([[:digit:]]{1,2}\.){2}[[:digit:]]{1,2}" \ [[:digit:]] wasn't strictly required here, right? I understand=20 that it's more =E2=80=98correct=E2=80=99 but can't imagine any locale actua= lly=20 breaking either one. Is there a practical chance that some ancient-but-supported grep=20 out there supports [0-9] but *not* [[:digit:]]? If not: OK! > @@ -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=20 > "${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" > + ;; I'll defer to your expertise on the OpenRC incantations :-) Minor nitpick: =E2=80=98; }=E2=80=99. > diff --git a/etc/openrc/guix-daemon b/etc/openrc/guix-daemon I like the subdirectory. > new file mode 100644 > index 0000000000..436673f169 > --- /dev/null > +++ b/etc/openrc/guix-daemon > @@ -0,0 +1,11 @@ > +#!/sbin/openrc-run > + > +export=20 > GUIX_LOCPATH=3D/var/guix/profiles/per-user/root/guix-profile/lib/locale > +export LC_ALL=3Den_US.utf8 > +command=3D"/var/guix/profiles/per-user/root/current-guix/bin/guix-daemon" > +command_args=3D"--build-users-group=3Dguixbuild" > +command_background=3D"yes" > +pidfile=3D"/var/run/guix-daemon.pid" > + > +output_log=3D"/var/log/guix-daemon-stdout.log" > +error_log=3D"/var/log/guix-daemon-stderr.log" Please rename this to guix-daemon.in & add it to nix/local.mk so=20 we can use @localstatedir@ here. If you could send a revised patch series it would be much=20 appreciated; otherwise I'll make the above changes when I get=20 around to it (...). Thanks! T G-R --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQT12iAyS4c9C3o4dnINsP+IT1VteQUCXzMNIAAKCRANsP+IT1Vt eeTFAQDVbJp6mrFok0pbCCYy92hGtv08T0zY8pq4ikBHmHdOtwEApZWejNdqO1Xi QyJfPpZHIkonY4uuzExMDdKaT0ma/Qw= =fojb -----END PGP SIGNATURE----- --=-=-=--