unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Danny Milosavljevic <dannym@scratchpost.org>
Cc: 23064@debbugs.gnu.org
Subject: bug#23064: herd has incomplete status reporting, not so helpful
Date: Mon, 21 Mar 2016 09:35:41 +0100	[thread overview]
Message-ID: <87shzkcjoi.fsf@gnu.org> (raw)
In-Reply-To: <20160319223921.107f27bc@scratchpost.org> (Danny Milosavljevic's message of "Sat, 19 Mar 2016 22:39:21 +0100")

[-- Attachment #1: Type: text/plain, Size: 1250 bytes --]

Danny Milosavljevic <dannym@scratchpost.org> skribis:

>> Sounds like postgresql died and shepherd did not notice?  Or maybe it
>> keeps trying to respawn it?  What did /var/log/shepherd.log say?
>
> 2016-03-19 10:34:48 Service postgres has been started.
> 2016-03-19 10:34:49 Respawning postgres.

OK.

>> However, daemons can usually be told to write to syslog, which is more
>> appropriate than writing things to stdout/stderr anyway.  
>
> It can always be unable to open syslog for some reason. 
>
> If shepherd can't/doesn't redirect stderr on its own, it would be nice to have init write it somewhere and everyone else inherit it as default. Just throwing it away is not nice. 

Agreed.

> But I agree, the chance of being able to write it to syslog is high. Btw: How does guixsd know to start the syslog service before the postgres service?

Syslogd is another Shepherd service, so all we need is to express this
dependency.

>>What’s the right command-line/configuration option to have postgresql use syslog?
>
> The option is
>
>    log_destination = 'syslog'
>
> in postgresql.conf
>
> which is generated in gnu/services/databases.scm (%default-postgres-config).

Could you try this and report back?


[-- Attachment #2: Type: text/x-patch, Size: 1266 bytes --]

diff --git a/gnu/services/databases.scm b/gnu/services/databases.scm
index 6c3b829..690375e 100644
--- a/gnu/services/databases.scm
+++ b/gnu/services/databases.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 David Thompson <davet@gnu.org>
-;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015, 2016 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -56,6 +56,7 @@ host	all	all	::1/128 	trust"))
 
 (define %default-postgres-config
   (mixed-text-file "postgresql.conf"
+                   "log_destination = 'syslog'\n"
                    "hba_file = '" %default-postgres-hba "'\n"
                    "ident_file = '" %default-postgres-ident "'\n"))
 
@@ -116,7 +117,7 @@ host	all	all	::1/128 	trust"))
        (list (shepherd-service
               (provision '(postgres))
               (documentation "Run the PostgreSQL daemon.")
-              (requirement '(user-processes loopback))
+              (requirement '(user-processes loopback syslogd))
               (start #~(make-forkexec-constructor #$start-script))
               (stop #~(make-kill-destructor))))))))
 

[-- Attachment #3: Type: text/plain, Size: 232 bytes --]


> Does shepherd back off from respawing it eventually (if it respawns too fast) or will it log the same messages into syslog once every 0.1 s until my disk is full? :->

Yes, it avoids respawning too fast.

Thanks,
Ludo’.

  reply	other threads:[~2016-03-21  8:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-19 15:13 bug#23064: herd has incomplete status reporting, not so helpful Danny Milosavljevic
2016-03-19 15:25 ` Danny Milosavljevic
2016-03-19 21:15 ` Ludovic Courtès
2016-03-19 21:39   ` Danny Milosavljevic
2016-03-21  8:35     ` Ludovic Courtès [this message]
2016-03-22 19:29       ` Danny Milosavljevic
2016-03-22 23:23         ` Ludovic Courtès
2016-03-23 21:44         ` 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=87shzkcjoi.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=23064@debbugs.gnu.org \
    --cc=dannym@scratchpost.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).