From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxim Cournoyer Subject: Re: need help with debugging gopherd (geomyidae) service Date: Tue, 16 May 2017 00:44:20 -0700 Message-ID: <87y3txz1nv.fsf@gmail.com> References: <20170510012753.wvipxt75ecc6hhvl@abyayala> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48120) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dAX9f-0008EX-HV for guix-devel@gnu.org; Tue, 16 May 2017 03:44:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dAX9e-0006pO-EX for guix-devel@gnu.org; Tue, 16 May 2017 03:44:27 -0400 Received: from mail-pf0-x22b.google.com ([2607:f8b0:400e:c00::22b]:35054) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dAX9e-0006p6-5I for guix-devel@gnu.org; Tue, 16 May 2017 03:44:26 -0400 Received: by mail-pf0-x22b.google.com with SMTP id n23so71122736pfb.2 for ; Tue, 16 May 2017 00:44:26 -0700 (PDT) Received: from apteryx ([2601:647:4a02:70e3:c2f8:daff:fe5d:2f2f]) by smtp.gmail.com with ESMTPSA id t22sm23589162pfi.89.2017.05.16.00.44.23 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 May 2017 00:44:24 -0700 (PDT) In-Reply-To: <20170510012753.wvipxt75ecc6hhvl@abyayala> (ng0@pragmatique.xyz's message of "Wed, 10 May 2017 01:27:53 +0000") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable ng0 writes: > When I start this via the arguments I pass (well, any arguments), > without the service it starts and I can access the server. > > The service never starts (and due to its simplistic nature, no > "BOOM CRASH THIS IS WHY I REFUSE TO START" is seen. > In this version I added 'networking' to requirements, still no change. > > Anyone got an idea what could be missing from making this simple service > functional? > [...] > diff --git a/gnu/services/web.scm b/gnu/services/web.scm > index f85b41215..2cfa835a7 100644 > --- a/gnu/services/web.scm > +++ b/gnu/services/web.scm > @@ -1,7 +1,7 @@ > ;;; GNU Guix --- Functional package management for GNU > ;;; Copyright =C2=A9 2015 David Thompson > ;;; Copyright =C2=A9 2015, 2016, 2017 Ludovic Court=C3=A8s > -;;; Copyright =C2=A9 2016 ng0 > +;;; Copyright =C2=A9 2016, 2017 ng0 > ;;; Copyright =C2=A9 2016, 2017 Julien Lepiller > ;;; Copyright =C2=A9 2017 Christopher Baines > ;;; > @@ -41,7 +41,12 @@ > nginx-named-location-configuration > nginx-named-location-configuration? > nginx-service > - nginx-service-type)) > + nginx-service-type > + > + geomyidae-service > + geomyidae-service-type > + geomyidae-configuration > + geomyidae-configuration?)) >=20=20 > ;;; Commentary: > ;;; > @@ -305,3 +310,111 @@ files in LOG-DIRECTORY, and stores temporary runtim= e files in RUN-DIRECTORY." > (server-blocks server-list) > (upstream-blocks upstream-list) > (file config-file)))) > + > +;;; > +;;; geomyidae > +;;; > + > +(define-record-type* > + geomyidae-configuration make-geomyidae-configuration > + geomyidae-configuration? > + (package geomyidae-configuration-package ;package > + (default geomyidae)) > + (logfile geomyidae-configuration-logfile ;string > + (default "/var/log/geomyidae.log")) > + (loglevel geomyidae-configuration-loglevel ;number > + (default 7)) > + (htdocs geomyidae-configuration-htdocs ;string > + (default "/srv/gopher")) > + (port geomyidae-configuration-port ;number > + (default 70)) > + (sport geomyidae-configuration-sport ;number > + (default 70)) > + (host geomyidae-configuration-host ;string > + (default "localhost")) > + (ip geomyidae-configuration-ip ;string > + (default #f))) > + > +(define geomyidae-shepherd-service > + (match-lambda > + (($ > + package logfile loglevel htdocs port > + sport host ip);;user group > + (let* ((geomyidae (file-append package "/bin/geomyidae")) > + (cmd `(,geomyidae > + "-d" > + ,@(if logfile > + `(,(string-append "-l " logfile)) > + '()) > + ,@(if loglevel > + `(,(string-append > + "-v " (number->string loglevel))) > + '()) > + ,@(if htdocs > + `(,(string-append "-b " htdocs)) > + '()) > + ,@(if port > + `(,(string-append > + "-p " (number->string port))) > + '()) > + ,@(if sport > + `(,(string-append > + "-o " (number->string sport))) > + '()) > + ,@(if host > + `(,(string-append "-h " host)) > + '()) > + ,@(if ip > + `(,(string-append "-i " ip)) > + '())))) > + (list (shepherd-service > + (documentation "Run the gopherd geomyidae") > + (provision '(geomyidae)) > + (requirement '(user-processes loopback networking)) > + (start #~(make-forkexec-constructor > + '#$cmd Why is there a single quote in front of #$cmd ? I think Ludo once explained how to manually exercise the service script; I'm not sure, but maybe you could gather more clues as to what might be failing from there if you could manage to run the service manually at the REPL. Maxim --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEFVwTvgZwWPWnh370K8v/MDHLu9sFAlkardQACgkQK8v/MDHL u9vkVA/+N5Vt7mSYa1xyL6E9C2tUTykGBqWVzvs2+Wx8UFLYzN+h2pi5Z8osNbaD TQHPJkwNggtSl77Y3WWJNo+sFyizbJx7NSOV6mmU+4YEHRcNk+UOFRw77wZ/U/dR n9edfAt5cL4GjMilqHwJu7BqDPlXob+SV8iddT48UH5ZS9MF5wEIRNoApGbXNhZP h/sqBziqM6BIYnpQObGcl6ymnq7UFMrms+yMpNDxxZWSKa5v22zu0t9BSuSB0MDt u/8g8UEAmJa8kODH9tlS6ErxsY1sx8lIWpha2iDvUU8WGiDqW7uh0k2vM1xvKK4L YidM4oOTkhIHtp1fmNyMaYFyYD9Mf/uLJIuBXYMpy1V4+VIApNX+9vrHFhont61M yQyFu3lMe48IckghyF2ksFp8isaOb5KdCeAsy4iy/1Iku2i4smbnjMQwkzEuAPGk 9PNI1JkFh0o9AoiFEPiu3vOzErcW/zMFIW2ucZgN8BOPG2WYgwG+m5cnUP1/h1Yr 9aJJTDO5/oDLmCM0bV5gocp3/tflfKbh4IFrZLf5dcDfx3RbNz5W3caDZlT8CQ2/ UqwEksVGpgKX8H2IBPsCxz1GdnQeOp5WjSwwJIAoHdLiwMd3lhKwUjUJgo/N6gg0 MEVOJ9eGKCl0/b4RTLyH/Qps36FCNvPoWjrC6uF3+xxQJ+CPz14= =CFrI -----END PGP SIGNATURE----- --=-=-=--