supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* runsv/svlogd handling of STDOUT
@ 2004-04-04 22:56 Ian Stokes-Rees
  2004-04-04 23:12 ` Lukas Beeler
  0 siblings, 1 reply; 2+ messages in thread
From: Ian Stokes-Rees @ 2004-04-04 22:56 UTC (permalink / raw)


I have the strange problem that STDOUT from my "service/run" script is 
not appearing in the logs generated by svlogd.

The service I'm running is a python script, and I'm guessing that Python 
is doing something tricky and noticing that it's output is being 
redirected and so is not flushing on every line, but it *never* seems to 
flush unless I go and put in explicity flush statements, which is 
impractical.  "echo" statements in the "run" script do appear in the logs.

Can anyone suggest what might be causing this and how I might fix it?

FWIW, here are example "service/run" and "service/log/run" scripts:

service/run:

#!/bin/sh
echo starting Python Service
exec 2>&1
PYTHONPATH=/localdisk1/DIRAC/python
exec /usr/local/bin/service.py http://localhost:9130 production

service/log/run:

#!/bin/sh
exec svlogd -tt ./main


-- 
Ian Stokes-Rees              i.stokes-rees@physics.ox.ac.uk
Particle Physics, Oxford     http://www-pnp.physics.ox.ac.uk/~stokes



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: runsv/svlogd handling of STDOUT
  2004-04-04 22:56 runsv/svlogd handling of STDOUT Ian Stokes-Rees
@ 2004-04-04 23:12 ` Lukas Beeler
  0 siblings, 0 replies; 2+ messages in thread
From: Lukas Beeler @ 2004-04-04 23:12 UTC (permalink / raw)


* Ian Stokes-Rees <i.stokes-rees1@physics.ox.ac.uk>:
> The service I'm running is a python script, and I'm guessing that Python 
> is doing something tricky and noticing that it's output is being 
> redirected and so is not flushing on every line, but it *never* seems to 
> flush unless I go and put in explicity flush statements, which is 
> impractical.  "echo" statements in the "run" script do appear in the logs.

Google says:

python -u

-u     : unbuffered binary stdout and stderr (also PYTHONUNBUFFERED=x)
         see man page for details on internal buffering relating to '-u'


-- 
Today is the first day of the rest of our lives.
http://www.suug.ch


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-04-04 23:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-04 22:56 runsv/svlogd handling of STDOUT Ian Stokes-Rees
2004-04-04 23:12 ` Lukas Beeler

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).