From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: guix-devel@gnu.org
Subject: Re: need help with debugging gopherd (geomyidae) service
Date: Tue, 16 May 2017 00:44:20 -0700 [thread overview]
Message-ID: <87y3txz1nv.fsf@gmail.com> (raw)
In-Reply-To: <20170510012753.wvipxt75ecc6hhvl@abyayala> (ng0@pragmatique.xyz's message of "Wed, 10 May 2017 01:27:53 +0000")
[-- Attachment #1: Type: text/plain, Size: 4637 bytes --]
ng0 <ng0@pragmatique.xyz> 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 © 2015 David Thompson <davet@gnu.org>
> ;;; Copyright © 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
> -;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
> +;;; Copyright © 2016, 2017 ng0 <ng0@no-reply.pragmatique.xyz>
> ;;; Copyright © 2016, 2017 Julien Lepiller <julien@lepiller.eu>
> ;;; Copyright © 2017 Christopher Baines <mail@cbaines.net>
> ;;;
> @@ -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?))
>
> ;;; Commentary:
> ;;;
> @@ -305,3 +310,111 @@ files in LOG-DIRECTORY, and stores temporary runtime files in RUN-DIRECTORY."
> (server-blocks server-list)
> (upstream-blocks upstream-list)
> (file config-file))))
> +
> +;;;
> +;;; geomyidae
> +;;;
> +
> +(define-record-type* <geomyidae-configuration>
> + 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
> + (($ <geomyidae-configuration>
> + 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next prev parent reply other threads:[~2017-05-16 7:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-10 1:27 need help with debugging gopherd (geomyidae) service ng0
2017-05-16 7:44 ` Maxim Cournoyer [this message]
2017-05-17 12:58 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y3txz1nv.fsf@gmail.com \
--to=maxim.cournoyer@gmail.com \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).