From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id mH1KGPzOoWM1RAAAbAwnHQ (envelope-from ) for ; Tue, 20 Dec 2022 16:04:28 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id MAtSGPzOoWNxKgEA9RJhRA (envelope-from ) for ; Tue, 20 Dec 2022 16:04:28 +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 269E16DDD for ; Tue, 20 Dec 2022 16:04:28 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p7eA2-0000NM-9M; Tue, 20 Dec 2022 10:04:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p7eA0-0000Mr-JP for guix-patches@gnu.org; Tue, 20 Dec 2022 10:04:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p7e9y-0005nD-Fe for guix-patches@gnu.org; Tue, 20 Dec 2022 10:04:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p7e9x-0005Yp-W5 for guix-patches@gnu.org; Tue, 20 Dec 2022 10:04:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59845] [PATCH 0/4] Add PMB (Integrated Library System) Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 20 Dec 2022 15:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59845 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Yarl Baudig Cc: 59845@debbugs.gnu.org Received: via spool by 59845-submit@debbugs.gnu.org id=B59845.167154862221364 (code B ref 59845); Tue, 20 Dec 2022 15:04:01 +0000 Received: (at 59845) by debbugs.gnu.org; 20 Dec 2022 15:03:42 +0000 Received: from localhost ([127.0.0.1]:45356 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7e9e-0005YW-7G for submit@debbugs.gnu.org; Tue, 20 Dec 2022 10:03:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7e9d-0005YO-EW for 59845@debbugs.gnu.org; Tue, 20 Dec 2022 10:03:41 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p7e9P-0005kk-LQ; Tue, 20 Dec 2022 10:03:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=Ob4+M/dWbVo58HQCuFcTyyj7zFjUTJnWPtfPYidxWsg=; b=AtSMMTKgUYAL8PRgGaTB wuxaJkT4eqbznBAPVfvmeYvW801p4CK7WvM65m9FrhbZKZ60Zn0Ds8QVW9QTNECJnc6sK9nUG8Ra7 Ndl7SeamAGcuGU+cB7UzeEU47s67xVvDa9ZNIkGEfdRYcSI55di6bSVBjO5e0Oabjas27vCe1dNBc RPIGrB0p0EZiU6nARVoC/bv1zKB/jy5Av9hj5UXqHbbyP1NtNtx7LP/jYz+IuvHhTadbnyH+ts4pn CYRFs9Wj+p1PIp9LhpxFldXPif6GmJDhCBRYJeCmm788M5AVq6FRBaES2s+Sb8z8EXU6MxnYarA9C 79IY2hXjcs5MCQ==; Received: from [193.50.110.60] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p7e9O-00036b-Fc; Tue, 20 Dec 2022 10:03:27 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20221209115349.5821-1-yarl-baudig@mailoo.org> <20221209115349.5821-3-yarl-baudig@mailoo.org> Date: Tue, 20 Dec 2022 16:03:24 +0100 In-Reply-To: <20221209115349.5821-3-yarl-baudig@mailoo.org> (Yarl Baudig's message of "Fri, 9 Dec 2022 12:53:48 +0100") Message-ID: <87359a6rsz.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=AtSMMTKg; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1671548668; a=rsa-sha256; cv=none; b=bH1SdQrZmRXqGUyMDXKNc9eVeeGu/Xf+mffB7ME+yRO48H30W24LoWUf85d/mFrnAAF6CP mguEhpU0Q6yS1tpgTtCVPDhQjFiomCxv8/EN7UZBgaMYUXXX52C8+E+uCvftJ1E2YGz2w2 /KAYwF4oLOTswQKazu4pL14Og4M2GpGbUxOc4bKA+C9nEKvzlsT6byxlTWbY81+lgf/vYk A7nop+GZg47Mzk6WmMGV/FfiMiq5eVTcpfsHA/XTkJ6Xh1lYz8vmEM+6xBwKQpw37aErWZ 84ICHvcQSeYKy1Kc1iq6P/Ujo+mR4LVLSpn/JfYZyM3lJKe2u+InxCLkq92lsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1671548668; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Ob4+M/dWbVo58HQCuFcTyyj7zFjUTJnWPtfPYidxWsg=; b=ZTm7qWJVp0d2kHV9+21emFByQnwq3tscXCTn44qf/xh3/NZaYAHAOY4ZGD2tSafA+jrr9G MD8REIbKLAOGDX8U4xsRhPrscsDY0rk61YqGeWDWPDEkGujJYT8uIbfa143dmkqpiFbGv7 hi3HLCZbBXXEyTbqrPHXkWaXYD2EgBHuayPwuR2/xSRnxLp/LuT/H70HmR4t1j+8ze6Jjb nS8ma10u0fAi5BgiPyJxNONgfnFuKKyNCE0VW6guPuWEznm5E4fF3LSozeq18S6j3Kpj3/ hz8Q3hEb2wgUtU0XcJsOcwCHSPeKcodglp+AcshCJJj7NvfCw3nmSJHfpyRvxA== X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=AtSMMTKg; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org X-Migadu-Spam-Score: -4.20 X-Spam-Score: -4.20 X-Migadu-Queue-Id: 269E16DDD X-TUID: 8oxzXs7IAYjX Yarl Baudig skribis: > * gnu/services/ils.scm: New file. > * gnu/local.mk: Add it. [...] > + #~(begin > + (use-modules (guix build utils)) > + (use-modules (ice-9 ftw)) > + (format #t "Copying pmb '~a' to http directory '~a'~%" > + (string-append #$pmb "/share/http/pmb") > + #$http-directory) > + (mkdir-p #$http-directory) > + ;; Please be quiet > + (call-with-output-file "/dev/null" > + (lambda (port) > + (with-output-to-port port > + (lambda () > + (copy-recursively (string-append #$pmb "/share/http/pmb") > + #$http-directory))))) Do we really need to copy these files? Keep in mind that activation snippets run each time you boot the system, and each time you reconfigure. It=E2=80=99s best to avoid doing too much w= ork there. > + (define (enter? name stat result) > + #t) > + (define (lchown obj) > + (let ((user (getpwnam #$php-fpm-user)) > + (group (getgrnam #$php-fpm-group))) > + (chown obj (passwd:uid user) (group:gid group)))) > + (define (leaf name stat result) > + (lchown name) > + result) > + (define (down name stat result) > + (lchown name) > + result) > + (define (up name stat result) result) > + (define (skip name stat result) result) > + (define (error name stat errno result) > + (warning (G_ "~a: ~a~%") > + name (strerror errno)) > + result) > + (file-system-fold enter? leaf down up skip error '() #$http-dire= ctory) This can be simplified along these lines: (for-each lchown (find-files #$http-directory #:directories? #t)) But again, that=E2=80=99s a lot of I/O. > + ;; Those are to hide installation files on a re-activation > + (if > + (file-exists? (string-append #$http-directory "/tables/noinstal= l.php")) > + (delete-file (string-append #$http-directory "/tables/install.p= hp"))) > + (if > + (file-exists? (string-append #$http-directory "/tables/noinstal= l_rep.php")) > + (delete-file (string-append #$http-directory "/tables/install_r= ep.php")))))) Or just: (false-if-exception (delete-file =E2=80=A6)) > +(define pmb-service-type > + (service-type > + (name 'guix) > + (extensions > + (list (service-extension activation-service-type > + pmb-activation))) > + (default-value (pmb-configuration)) > + (description "Install the pmb Integrated Library System"))) Should it extend =E2=80=98nginx-service-type=E2=80=99 with =E2=80=98%defaul= t-pmb-location=E2=80=99? Likewise, it looks like it=E2=80=99d be nice to extend =E2=80=98mysql-servi= ce-type=E2=80=99 with the extra config. That=E2=80=99s not currently possible but we should add = it. That way, adding (service pmb-service-type) is all it would take to get the service up and running.