supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Larry Doolittle <ldoolitt@recycle.lbl.gov>
To: supervision@list.skarnet.org
Subject: svlogd research
Date: Fri, 16 Nov 2007 11:57:17 -0800	[thread overview]
Message-ID: <20071116195717.GA10933@recycle.lbl.gov> (raw)

Gerrit and friends -

I'm trying to create a tricky (for me) setup for svlogd, and have
some questions.  I want both a reliable local log, and an encrypted
(via stunnel) remote log, where I can't control the reliability
of the remote logging machine (or the network path to it).  My
environment is Debian sid amd64, currently runit 1.8.0-1.

So my /etc/runit/proggie/log/run file must look something like

#!/bin/sh
exec svlogd -t /var/log/proggie_local /var/log/proggie_remote

where /var/log/proggie_local is familiar territory.
/var/log/proggie_remote doesn't look too bad.  Every couple of
minutes I want to dump the accumulated logs (if any) to the remote
server, so I have lines in that directory's config file like

t120
! /usr/sbin/stunnel blah blah blah -r syslog.example.org:5140

My core question is what happens when stunnel fails or stalls.
The svlogd man page says

  A  processor  is  run  in  the background.  If svlogd sees a previously
  started processor still running when trying to start a new one for  the
  same  log, it blocks until the currently running processor has finished
  successfully.  Only the HUP signal works in that situation.  Note that
  this may block any program feeding its log data to svlogd.

That would be bad, since the same svlogd process is also responsible for
the local log.  Network stalls shouldn't affect proggie or its local logging.
When I look in the code for how this is supposed to work, I see the check
for a still-running processor for the previous data set

  if (ld->ppid) {
    warnx("processor already running", ld->name);
    return(0);
  }

but no caller to this routine checks for an exit code, and nothing
retries the call to processorstart().  So it looks like if one processor
run stalls indefinitely, no additional data will ever get sent to the
processor, and the svlogd process never stalls.  This doesn't sound like
what the documentation says.  Is my analysis correct?  Am I on the right
track in general?

  - Larry


             reply	other threads:[~2007-11-16 19:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-16 19:57 Larry Doolittle [this message]
2007-11-16 20:10 ` Charlie Brady
2007-11-16 20:23   ` Larry Doolittle
2007-11-16 22:08     ` George Georgalis

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071116195717.GA10933@recycle.lbl.gov \
    --to=ldoolitt@recycle.lbl.gov \
    --cc=supervision@list.skarnet.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.
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 NNTP newsgroup(s).