supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Sergiusz Pawlowicz <sergiusz.pawlowicz@gmail.com>
To: SV List <supervision@list.skarnet.org>
Subject: [magic sv logging]
Date: Fri, 21 Sep 2012 00:35:23 +0100	[thread overview]
Message-ID: <CADJ+r00nWxjP8S25a-qbRi-kaewX0a9LtKAZsbJ8kzPV0oedTA@mail.gmail.com> (raw)

Hi,
I am trying to write a python script which can be put in place of
svlogd/multilog, but I am stuck just at the beginning.

The test script is pretty simple, it just forwards stdin to stdout:

def main():

    while True:
        try:
            line = raw_input()
            print 'got', line
        except EOFError:
            print 'done'
            pass

  if __name__ == '__main__':
    main()

It works, but not as desired, as the script is being restarted by runsv
constantly, it seems after it finishes reading stdin. Could you
please help me how can run that continuously listening to stdin?

cheers,
Serge
-- 
https://pawlowicz.name/


             reply	other threads:[~2012-09-20 23:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-20 23:35 Sergiusz Pawlowicz [this message]
2012-09-21  2:25 ` Mike Buland
2012-09-21 15:29   ` Lorenzo Beretta
2012-09-21 15:32     ` Mike Buland
2012-09-21 15:35       ` Jason Dusek
2012-09-21 15:38         ` Mike Buland
2012-09-22  4:18       ` Laurent Bercot
2012-09-22  5:58         ` Jason Dusek

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=CADJ+r00nWxjP8S25a-qbRi-kaewX0a9LtKAZsbJ8kzPV0oedTA@mail.gmail.com \
    --to=sergiusz.pawlowicz@gmail.com \
    --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).