From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 20 10:13:28 2022 Received: (at 59845) by debbugs.gnu.org; 20 Dec 2022 15:13:28 +0000 Received: from localhost ([127.0.0.1]:45425 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7eJ6-0005fW-1B for submit@debbugs.gnu.org; Tue, 20 Dec 2022 10:13:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35260) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7eJ4-0005fL-17 for 59845@debbugs.gnu.org; Tue, 20 Dec 2022 10:13:26 -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 1p7eIy-0007pk-L5; Tue, 20 Dec 2022 10:13:20 -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=Gi22lJCLc3va2NcJI6jW57RCFx6KSLoBWuWDurWyHXs=; b=cUePXmf4SXQEBvGnH0zv BnB/wcBLqQ3iU4vOTYC76tVprPT0i3cqyxMTMP12ejZRZBuJEHSVSzrCLYOS+x33zTKqdsgIqzql+ PhgccyWyVRgoManEDwUiCnh9096UNeKBQsNly17LVCIyP1+mHdxHKOzM8+hOsK38wmITumE/CSfMC Did3HegZod/gR9/edEmWanROVMAHl+1CoES4cmNn0K4xMZpsrodZMQp0YR1zl7gt6dHNt+ZOtapty wc4Q2HCk4BixYPjhlScLbOmi42P2oPOkiD5lmvv9s+ZI3slq2C0xo7k+wn0bUTlB6hJKoo1hlwM34 Qh5ASebBinOO+Q==; 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 1p7eIt-0004YR-Tt; Tue, 20 Dec 2022 10:13:20 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Yarl Baudig Subject: Re: bug#59845: [PATCH 0/4] Add PMB (Integrated Library System) References: <20221209115349.5821-1-yarl-baudig@mailoo.org> <20221209115349.5821-4-yarl-baudig@mailoo.org> Date: Tue, 20 Dec 2022 16:13:13 +0100 In-Reply-To: <20221209115349.5821-4-yarl-baudig@mailoo.org> (Yarl Baudig's message of "Fri, 9 Dec 2022 12:53:49 +0100") Message-ID: <87tu1q5cs6.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-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 59845 Cc: 59845@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Yarl Baudig skribis: > doc/guix.texi (System Configuration, Services): Add Integrated Library Sy= stem Services section. > doc/guix.texi (System Configuration, Services, Integrated Library System = Services): Add PMB. Neat! Note that this should go in the same commit that adds the service. Likewise, we also expect system tests for each new service. This should also come in the same commit. Here the system test would check that the web server is up and running and that PMB correctly responds to basic HTTP requests. See =E2=80=98gnu/tests=E2=80=99 for example and do not hesi= tate to ask on IRC if you have any questions. > +@node Integrated Library System Services > +@subsection Integrated Library System Services > + > +@cindex PMB Service > +@subsubheading PMB Service > + Please add a couple of introductory sentences to give context. > +@defvr {Scheme Variable} pmb-service-type > +Service type for the @uref{https://www.sigb.net/,PMB} Integrated Library= System. > +The value for this service type is a @code{} record. > + > +The PMB service needs a web server, @code{mariadb}/@code{mysql}, @code{p= hp} and > +is only responsible for copying and changing ownership of files from the > +@code{pmb} package. > +@end defvr > + > +Let's start with a demonstration. Here is a sample system configuration = (@file{pmb.scm}): > + > +@lisp > +(use-modules (gnu)) > +(use-service-modules ils web networking databases) > +(use-package-modules databases) > + > +(operating-system > + (host-name "pmb") I think we shouldn=E2=80=99t have to provide full OS declarations to illust= rate use of the service. But as I wrote in a previous message, it we can boil down configuration to (service pmb-service-type), then the example will be much more concise. > +We import the @code{mariadb} package so that we will have access to the = program > +@command{mysql}. This will be useful to set the password of the database= 's Please leave two spaces after end-of-sentence periods (this gives a hint to Texinfo and to Emacs). > +Now let's run @command{guix system container -N pmb.scm} (@pxref{Invokin= g guix system}). > +Run the resulting @file{/gnu/store/...run-container}. > +Note that we want to keep the state of the database and the php files (b= ecause during > +the application setup (see below), the php files will be slightly modifi= ed. That is also why > +the PMB files need to be copied (and chowned) outside the store), we nee= d to create > +two folders, say @file{/mnt/data/pmb} and @file{/mnt/data/mysql} and pas= s @option{--share} > +two times. @command{nsenter} into it to set the database's administrator= password. > + > +@example > +# mkdir /mnt/data/mysql /mnt/data/pmb > +# /gnu/store/...run-container --share=3D/mnt/data/pmb=3D/srv/http/pmb \ > +--share=3D/mnt/data/mysql=3D/var/lib/mysql > +# nsenter -a -t > +# mysql > +> SET PASSWORD FOR 'root'@'localhost' =3D PASSWORD('guixisgreat'); > +@end example Neat. We should clarify that this is in case one wants to run it in a container (there=E2=80=99s no obligation; one might want to run it on the b= are metal). WDYT? Ludo=E2=80=99.