From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56657) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0QjO-0004LE-QQ for guix-patches@gnu.org; Mon, 26 Mar 2018 07:56:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0QjK-000236-Df for guix-patches@gnu.org; Mon, 26 Mar 2018 07:56:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:45783) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f0QjK-00022Z-7R for guix-patches@gnu.org; Mon, 26 Mar 2018 07:56:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f0QjJ-0000M5-TF for guix-patches@gnu.org; Mon, 26 Mar 2018 07:56:01 -0400 Subject: [bug#30950] [PATCH shepherd]: Update required guile version, and remove some hacks Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0Qig-0004BZ-FF for guix-patches@gnu.org; Mon, 26 Mar 2018 07:55:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0Qib-0001D0-Ag for guix-patches@gnu.org; Mon, 26 Mar 2018 07:55:22 -0400 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:37654) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f0Qia-0001CE-Q6 for guix-patches@gnu.org; Mon, 26 Mar 2018 07:55:17 -0400 Received: by mail-pf0-x241.google.com with SMTP id t16so3184333pfh.4 for ; Mon, 26 Mar 2018 04:55:16 -0700 (PDT) Received: from pidgey (210-1-202-160-cpe.spintel.net.au. [210.1.202.160]) by smtp.gmail.com with ESMTPSA id z6sm28572406pfe.9.2018.03.26.04.55.12 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Mar 2018 04:55:14 -0700 (PDT) From: Carlo Zancanaro Date: Mon, 26 Mar 2018 22:55:03 +1100 Message-ID: <87lgefuk4o.fsf@zancanaro.id.au> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 30950@debbugs.gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; format=flowed These patches bring the Shepherd's Guile dependencies in line with Guix, and remove some hacks that were required for old Guile problems. I'm not very familiar with autotools, but I think I got the configure incantation right (I stole it from Guix). --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Update-Guile-dependency-to-2.0.13-or-later.patch Content-Transfer-Encoding: quoted-printable From=208c812534137a5dc17dd8073706983c451d26f2db Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Mon, 26 Mar 2018 14:44:18 +1100 Subject: [PATCH 1/3] Update Guile dependency to 2.0.13 or later * README (Requirements): Change 2.x to 2.0.13 or later. * configure.ac: Check for 2.0.13 or later if Guile 2.0 is detected. =2D-- README | 7 ++++--- configure.ac | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README b/README index 88613aa..1237e2c 100644 =2D-- a/README +++ b/README @@ -16,9 +16,10 @@ daemon-managing daemon. ** Requirements =20 This program requires Guile (the GNU Ubiquitous Intelligent Language =2Dfor Extension), version 2.x. It uses GOOPS, but as GOOPS is part of =2DGuile, a normal Guile installation is sufficient. It also uses =2Dreadline, though it does not really depend on it. +for Extension), version 2.0.13 or later (including 2.2.x). It uses +GOOPS, but as GOOPS is part of Guile, a normal Guile installation is +sufficient. It also uses readline, though it does not really depend +on it. =20 GNU Make is required to build the Shepherd. =20 diff --git a/configure.ac b/configure.ac index d768885..9d8c2aa 100644 =2D-- a/configure.ac +++ b/configure.ac @@ -27,6 +27,10 @@ GUILE_PKG([2.2 2.0]) dnl Checks for programs. GUILE_PROGS =20 +if test "x$GUILE_EFFECTIVE_VERSION" =3D "x2.0"; then + PKG_CHECK_MODULES([GUILE], [guile-2.0 >=3D 2.0.13]) +fi + guilemoduledir=3D"${datarootdir}/guile/site/$GUILE_EFFECTIVE_VERSION" guileobjectdir=3D"${libdir}/guile/$GUILE_EFFECTIVE_VERSION/site-ccache" AC_SUBST([guilemoduledir]) =2D-=20 2.16.2 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0002-Remove-EINTR-safe-and-all-references-to-it.patch Content-Transfer-Encoding: quoted-printable From=20e11708aba0fbafd4c83273ee1fa5147e54d1c80e Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Mon, 26 Mar 2018 14:49:18 +1100 Subject: [PATCH 2/3] Remove EINTR-safe, and all references to it. * modules/shepherd/support.scm (EINTR-safe): Remove procedure and its expor= t. * modules/shepherd/service.scm (system*, system*): Remove now-unnecessary procedures. (waitpid*): Remove references to EINTR-safe. * modules/shepherd.scm (main): Remove references to EINTR-safe. =2D-- modules/shepherd.scm | 7 +------ modules/shepherd/service.scm | 35 +++++++++++++---------------------- modules/shepherd/support.scm | 14 -------------- 3 files changed, 14 insertions(+), 42 deletions(-) diff --git a/modules/shepherd.scm b/modules/shepherd.scm index fede338..5d97598 100644 =2D-- a/modules/shepherd.scm +++ b/modules/shepherd.scm @@ -241,12 +241,7 @@ ;; Get commands from the standard input port. (process-textual-commands (current-input-port)) ;; Process the data arriving at a socket. =2D (let ((sock (open-server-socket socket-file)) =2D =2D ;; With Guile <=3D 2.0.9, we can get a system-error exce= ption for =2D ;; EINTR, which happens anytime we receive a signal, suc= h as =2D ;; SIGCHLD. Thus, wrap the 'accept' call. =2D (accept (EINTR-safe accept))) + (let ((sock (open-server-socket socket-file))) =20 ;; Possibly write out our PID, which means we're ready to acce= pt ;; connections. XXX: What if we daemonized already? diff --git a/modules/shepherd/service.scm b/modules/shepherd/service.scm index 7b062a1..93d3779 100644 =2D-- a/modules/shepherd/service.scm +++ b/modules/shepherd/service.scm @@ -590,13 +590,6 @@ results." (apply action service the-action args)) which-services)))) =20 =2D;; EINTR-safe versions of 'system' and 'system*'. =2D =2D(define system* =2D (EINTR-safe (@ (guile) system*))) =2D =2D(define system =2D (EINTR-safe (@ (guile) system))) =20 =20 @@ -981,21 +974,19 @@ returned in unspecified." (hashq-ref %services name '())) =20 (define waitpid* =2D (let ((waitpid (EINTR-safe waitpid))) =2D (lambda (what flags) =2D "Like 'waitpid', but EINTR-safe, and return (0 . _) when there's no =2Dchild left." =2D (catch 'system-error =2D (lambda () =2D (waitpid what flags)) =2D (lambda args =2D ;; Did we get ECHILD or something? If we did, that's a proble= m, =2D ;; because this procedure is supposed to be called only upon =2D ;; SIGCHLD. =2D (let ((errno (system-error-errno args))) =2D (local-output "warning: 'waitpid' ~a failed unexpectedly: ~a" =2D what (strerror errno)) =2D '(0 . #f))))))) + (lambda (what flags) + "Like 'waitpid', and return (0 . _) when there's no child left." + (catch 'system-error + (lambda () + (waitpid what flags)) + (lambda args + ;; Did we get ECHILD or something? If we did, that's a problem, + ;; because this procedure is supposed to be called only upon + ;; SIGCHLD. + (let ((errno (system-error-errno args))) + (local-output "warning: 'waitpid' ~a failed unexpectedly: ~a" + what (strerror errno)) + '(0 . #f)))))) =20 (define (handle-SIGCHLD signum) "Handle SIGCHLD, possibly by respawning the service that just died, or diff --git a/modules/shepherd/support.scm b/modules/shepherd/support.scm index 380866e..9f02719 100644 =2D-- a/modules/shepherd/support.scm +++ b/modules/shepherd/support.scm @@ -30,7 +30,6 @@ =20 catch-system-error with-system-error-handling =2D EINTR-safe with-atomic-file-output mkdir-p with-directory-excursion @@ -127,19 +126,6 @@ turned into user error messages." (lambda () body ...))) =20 =2D(define (EINTR-safe proc) =2D "Wrap PROC so that if a 'system-error' exception with EINTR is raised = (that =2Dwas possible up to Guile 2.0.9 included) the call to PROC is restarted." =2D (lambda args =2D (let loop () =2D (catch 'system-error =2D (lambda () =2D (apply proc args)) =2D (lambda args =2D (if (=3D EINTR (system-error-errno args)) =2D (loop) =2D (apply throw args))))))) =2D (define (with-atomic-file-output file proc) ;copied from Guix "Call PROC with an output port for the file that is going to replace FIL= E. Upon success, FILE is atomically replaced by what has been written to the =2D-=20 2.16.2 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0003-Remove-SIGALRM-hack.patch Content-Transfer-Encoding: quoted-printable From=2063bc9339d88d8f1bd8a9b366774ce8e33d76dd00 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Mon, 26 Mar 2018 14:55:32 +1100 Subject: [PATCH 3/3] Remove SIGALRM hack. * modules/shepherd.scm (main): Remove SIGALRM hack for guile <=3D 2.0.9. =2D-- modules/shepherd.scm | 9 --------- 1 file changed, 9 deletions(-) diff --git a/modules/shepherd.scm b/modules/shepherd.scm index 5d97598..69fd69d 100644 =2D-- a/modules/shepherd.scm +++ b/modules/shepherd.scm @@ -207,15 +207,6 @@ (apply format #f (gettext (cadr args)) (caddr args)) (quit 1)))) =20 =2D (when (provided? 'threads) =2D ;; XXX: This terrible hack allows us to make sure that signal ha= ndlers =2D ;; get a chance to run in a timely fashion. Without it, after a= n EINTR, =2D ;; we could restart the accept(2) call below before the correspo= nding =2D ;; async has been queued. See the thread at =2D ;; . =2D (sigaction SIGALRM (lambda _ (alarm 1))) =2D (alarm 1)) =2D ;; Stop everything when we get SIGINT. When running as PID 1, that = means ;; rebooting; this is what happens when pressing ctrl-alt-del, see ;; ctrlaltdel(8). =2D-=20 2.16.2 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE1lpncq7JnOkt+LaeqdyPv9awIbwFAlq435cACgkQqdyPv9aw IbzM3BAAn0w/UcEcrJV7Du8/VsBr+8N47RMfMJBXAEq5GmnqDOJlWrbJ8BoqgQnA dcL71fcFtr04XS2cjZr3+Rgxp93XBUzH3z2K38FIY5f5geYr0JHuXV4/JIMY+5Ik ehByTgCFjb4jw1mTmHx199biEpM1LlKmK/ijEczOEUcQZectvzLsQAgDdooNaffC 9xAEBfZWOGBfCx/2ebIq+d1OSJibcdJpoSxmksVkzcGBn/vNgMulZHavIGayR0Xt BXFA01y/ttOHkTC64yLhN74fI2UZ3nhFdWdnNFnzIDBQmrIaWFJSalwW0mGAfVuR Rbb5ZOpvONxeLbKZt5t4IIHnFgO4C+GfWmuA36rktpIWU5ETXXlnsKXovMANksUg 1vN4j8RTmI5wQ9yXyBdBWpLjNOAXiku/VfZRvAuRSALLNNv6YiMVE8RdDY+qYXNb LGVKrFGUqKF8vsva2rgl+DN07Dczy4MGNcNv056INx/cmUgMVR8qCd/YCdwfWtKx za3v9FSFCfA2+95eeTKpvWiC4FV2K2Pg6rIBdsNXJiKF/FcB9TaOJu9X3t17PQ/R yNzpyS2CXt3CKDOeJOVrDWzpKEHJC0szw0/OFdZe0H4QZ7tNatKcNiE27z6kMWH9 eUID2yUyNFwc1Pz3AJq9WWJ9ZMrzJZWXhOt/iVtZnwPtExtbZWM= =VkiZ -----END PGP SIGNATURE----- --==-=-=--