Re: [systemd-devel] Unbuffered stderr for my systemd service?

2013-07-16 Thread Kay Sievers
On Tue, Jul 16, 2013 at 5:30 AM, WANG Chao chaow...@redhat.com wrote:

 (Humm, please do not use -- on a single line in the middle of an
 email, that's indication for many MUAs that this is where the signature
 starts, and they chop this off when replying...)

 Sorry about --, never thought that would be an issue. Thanks for
 telling!

It would only happen on _really_ broken mail programs, because the
convention includes a trailing space character which you didn't add.
The delimiter line is defined as -- .

  http://tools.ietf.org/html/rfc3676#section-4.3

Kay
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Unbuffered stderr for my systemd service?

2013-07-16 Thread Kay Sievers
On Tue, Jul 16, 2013 at 5:30 AM, WANG Chao chaow...@redhat.com wrote:
 On 07/15/13 at 10:46pm, Lennart Poettering wrote:
 On Mon, 15.07.13 17:56, WANG Chao (chaow...@redhat.com) wrote:

  I have a service (a script) running under systemd and need its stderr to
  be output'd immediately, not line buffered. I tried serveral ways but
  didn't work out. I hope to get some feedback here :)

 This is not supported. Logging doesn't deal in individual
 characters, really, but in log lines. Syslog doesn't do that, and
 neither does the Journal.

 And we will never support that, as allowing this would require us to
 always store the context a character was printed in so that lines could
 later be reassembled. But we cannot really do that.

 So, I fear I have to tell you that this is not supported and never
 will...

 I understand that. Record the context of a character is printed would
 never be a good idea. But still, I feel pity about line buffered stderr
 stream in Journal :(

It is the right thing to buffer just buffer them to full lines.

For the kernel counterpart, we added unbuffered console magic to the
kernel. It is really nasty and broken hack and really makes not much
sense in th eend. The code does work in the most common case, but just
does stupid things as soon as things start to compete about the log.

 
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=084681d14e429cb6192262ac7437f00e2c02f26a
 
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=eab072609e11a357181806ab5a5c309ef6eb76f5

Pretending to support pushing animations through a log system is a
pretty bad idea and relies on technical promises nobody can really
hold without inventing something that isn't logging anymore. But we
have that already, it's the console. :)

Kay
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Unbuffered stderr for my systemd service?

2013-07-16 Thread WANG Chao
On 07/16/13 at 01:39pm, Kay Sievers wrote:
 On Tue, Jul 16, 2013 at 5:30 AM, WANG Chao chaow...@redhat.com wrote:
 
  (Humm, please do not use -- on a single line in the middle of an
  email, that's indication for many MUAs that this is where the signature
  starts, and they chop this off when replying...)
 
  Sorry about --, never thought that would be an issue. Thanks for
  telling!
 
 It would only happen on _really_ broken mail programs, because the
 convention includes a trailing space character which you didn't add.
 The delimiter line is defined as -- .
 
   http://tools.ietf.org/html/rfc3676#section-4.3

Great to know!

I'm curious about what mail client Lennart has been using. Surely he
deserves a better one :P

WANG Chao
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Unbuffered stderr for my systemd service?

2013-07-16 Thread WANG Chao
On 07/16/13 at 02:00pm, Kay Sievers wrote:
 On Tue, Jul 16, 2013 at 5:30 AM, WANG Chao chaow...@redhat.com wrote:
  On 07/15/13 at 10:46pm, Lennart Poettering wrote:
  On Mon, 15.07.13 17:56, WANG Chao (chaow...@redhat.com) wrote:
 
   I have a service (a script) running under systemd and need its stderr to
   be output'd immediately, not line buffered. I tried serveral ways but
   didn't work out. I hope to get some feedback here :)
 
  This is not supported. Logging doesn't deal in individual
  characters, really, but in log lines. Syslog doesn't do that, and
  neither does the Journal.
 
  And we will never support that, as allowing this would require us to
  always store the context a character was printed in so that lines could
  later be reassembled. But we cannot really do that.
 
  So, I fear I have to tell you that this is not supported and never
  will...
 
  I understand that. Record the context of a character is printed would
  never be a good idea. But still, I feel pity about line buffered stderr
  stream in Journal :(
 
 It is the right thing to buffer just buffer them to full lines.

Yes. Or buffer wouldn't be called buffer.

 
 For the kernel counterpart, we added unbuffered console magic to the
 kernel. It is really nasty and broken hack and really makes not much
 sense in th eend. The code does work in the most common case, but just
 does stupid things as soon as things start to compete about the log.
 
  
 http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=084681d14e429cb6192262ac7437f00e2c02f26a
  
 http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=eab072609e11a357181806ab5a5c309ef6eb76f5
 
 Pretending to support pushing animations through a log system is a
 pretty bad idea and relies on technical promises nobody can really
 hold without inventing something that isn't logging anymore. But we
 have that already, it's the console. :)

I couldn't agree more. Log system can't really record animations in a
common way. So in my case, console is right thing to use. Thanks for
your information here. Have a good day!

WANG Chao
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Unbuffered stderr for my systemd service?

2013-07-15 Thread Lennart Poettering
On Mon, 15.07.13 17:56, WANG Chao (chaow...@redhat.com) wrote:

 Hi,
 
 I have a service (a script) running under systemd and need its stderr to
 be output'd immediately, not line buffered. I tried serveral ways but
 didn't work out. I hope to get some feedback here :)

This is not supported. Logging doesn't deal in individual
characters, really, but in log lines. Syslog doesn't do that, and
neither does the Journal.

And we will never support that, as allowing this would require us to
always store the context a character was printed in so that lines could
later be reassembled. But we cannot really do that.

So, I fear I have to tell you that this is not supported and never
will... 

 Here's my foobar.service:

(Humm, please do not use -- on a single line in the middle of an
email, that's indication for many MUAs that this is where the signature
starts, and they chop this off when replying...)

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Unbuffered stderr for my systemd service?

2013-07-15 Thread Lennart Poettering
On Mon, 15.07.13 10:32, Vivek Goyal (vgo...@redhat.com) wrote:

 CCing Lennart.
 
 This is important functionality for us. makeudmpfile utility (utility which 
 filters kernel crash dump and shows the progress bar), run in kdump
 kernel. For large machines it displays the progress bar in kernel. Right
 now all the code runs from initramfs in the context of a service and
 we don't get progress messages. Just we get a 100% message at the end.
 
 Right now we bypassed journal by sending everything to /dev/console but
 it is a generic question that any serivce displaying some kind of
 progress bar, how is it handled with current journal mechanism.

if you want to do fancier output then do facnier ouput directly on the
console, but do not pumpt this through a log system, that's really not
what it is for...

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Unbuffered stderr for my systemd service?

2013-07-15 Thread WANG Chao
On 07/15/13 at 10:46pm, Lennart Poettering wrote:
 On Mon, 15.07.13 17:56, WANG Chao (chaow...@redhat.com) wrote:
 
  Hi,
  
  I have a service (a script) running under systemd and need its stderr to
  be output'd immediately, not line buffered. I tried serveral ways but
  didn't work out. I hope to get some feedback here :)
 
 This is not supported. Logging doesn't deal in individual
 characters, really, but in log lines. Syslog doesn't do that, and
 neither does the Journal.
 
 And we will never support that, as allowing this would require us to
 always store the context a character was printed in so that lines could
 later be reassembled. But we cannot really do that.
 
 So, I fear I have to tell you that this is not supported and never
 will... 

I understand that. Record the context of a character is printed would
never be a good idea. But still, I feel pity about line buffered stderr
stream in Journal :(

 
  Here's my foobar.service:
 
 (Humm, please do not use -- on a single line in the middle of an
 email, that's indication for many MUAs that this is where the signature
 starts, and they chop this off when replying...)

Sorry about --, never thought that would be an issue. Thanks for
telling!

WANG Chao
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel