Re: How is syslog output printed on TTY?

2015-07-03 Thread Laurent Bercot

On 03/07/2015 13:53, john smith wrote:

I wonder then where does this text come from? It may be specific to
NOOBS but I am not sure.


 When syslogd is not running, syslog() will send its output to
/dev/console, which is what you are observing.

--
 Laurent

___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: How is syslog output printed on TTY?

2015-07-03 Thread john smith
On 7/3/15, Laurent Bercot ska-dietl...@skarnet.org wrote:
 On 03/07/2015 13:53, john smith wrote:
 I wonder then where does this text come from? It may be specific to
 NOOBS but I am not sure.

   When syslogd is not running, syslog() will send its output to
 /dev/console, which is what you are observing.

Oh, stupid me. I should have noticed openlog() with LOG_CONS a couple
of lines above. Still so much to learn.

One more question though: there is always a date printed before
login[PID] so that the entire line look like this:

Jan 1 00:01:36 login[515]: root login on 'tty2'

I tested opensyslog() with exactly the same parameters as in
loginutils/login.c on my Slackware box and date is not printed. There
is applet_name used as an ident argument in Busybox but AFAIK it only
contains applet name such as login without a date. So how is the
date printed?

-- 
wemp...@gmail.com
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


How is syslog output printed on TTY?

2015-07-03 Thread john smith
When I log in as root in TTY in NOOBS the following text is printed:

login[510]: root login on 'tty2'

NOOBS stands for New Out Of Box Software. It's 'An easy Operating
System install manager for the Raspberry Pi'. Anyway, I know that it
can be achieved by modifying syslog.conf but there is no syslog.conf
and syslogd is not running in NOOBS. I read Busybox source code and
the only place when this text is printed is loginutils/login.c but
they use syslog():

if (pw-pw_uid == 0)
syslog(LOG_INFO, root login%s, fromhost);

I wonder then where does this text come from? It may be specific to
NOOBS but I am not sure.
-- 
wemp...@gmail.com
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox