Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - ftpd and logging using slogger...: (8 Items)
   
ftpd and logging using slogger...  
Hi,

don't know if this really fits into this forum category but didn't find anything better...

I'm trying to run ftpd on our target. Problem is, it tries to log via syslog, and we're running slogger.

Of course we could run syslogd in parallel - but we'd really prefer all logs to be in one place: slogger's logfile. Also
 syslog is not really tailored towards running on an embedded target where the majority of directories is not writable.

Any suggestions? I thought syslog() messages go to /dev/slog anyway on QNX, but it seems this is not true for all 
applications/deamons?

I've tried to make syslog log to the console (which should be logged by slogger?), using "*.* /dev/console" in /etc/
syslog.conf... I read somehwere this will be logged by slogger...  but instead, this is printed to the serial console, 
not slogger..

Greetings,
 Marc
Re: ftpd and logging using slogger...  
On Tue, Aug 25, 2009 at 09:06:23AM -0400, Marc Roessler wrote:
> Hi,
> 
> don't know if this really fits into this forum category but didn't find anything better...
> 
> I'm trying to run ftpd on our target. Problem is, it tries to log via syslog, and we're running slogger.
> 
> Of course we could run syslogd in parallel - but we'd really prefer all logs to be in one place: slogger's logfile. 
Also syslog is not really tailored towards running on an embedded target where the majority of directories is not 
writable.
> 
> Any suggestions? I thought syslog() messages go to /dev/slog anyway on QNX, but it seems this is not true for all 
applications/deamons?
> 
> I've tried to make syslog log to the console (which should be logged by slogger?), using "*.* /dev/console" in /etc/
syslog.conf... I read somehwere this will be logged by slogger...  but instead, this is printed to the serial console, 
not slogger..

Try:

# ln -sP slog /dev/log

-seanb
RE: ftpd and logging using slogger...  
 

> -----Original Message-----
> From: Sean Boudreau [mailto:community-noreply@qnx.com] 
> Sent: August 25, 2009 10:46 AM
> To: ostech-core_os
> Subject: Re: ftpd and logging using slogger...
> 
> On Tue, Aug 25, 2009 at 09:06:23AM -0400, Marc Roessler wrote:
> > Hi,
> > 
> > don't know if this really fits into this forum category but 
> didn't find anything better...
> > 
> > I'm trying to run ftpd on our target. Problem is, it tries 
> to log via syslog, and we're running slogger.
> > 
> > Of course we could run syslogd in parallel - but we'd 
> really prefer all logs to be in one place: slogger's logfile. 
> Also syslog is not really tailored towards running on an 
> embedded target where the majority of directories is not writable.
> > 
> > Any suggestions? I thought syslog() messages go to 
> /dev/slog anyway on QNX, but it seems this is not true for 
> all applications/deamons?
> > 
> > I've tried to make syslog log to the console (which should 
> be logged by slogger?), using "*.* /dev/console" in 
> /etc/syslog.conf... I read somehwere this will be logged by 
> slogger...  but instead, this is printed to the serial 
> console, not slogger..
> 
> Try:
> 
> # ln -sP slog /dev/log
> 
> -seanb

I'm curious why /dev/console isn't working.  If you do "echo test >
/dev/console", do you get output in sloginfo?  If  yes, then it's
something in syslogd, if not, something's wrong with the slogger setup.
Also, if you do "ls -li /dev/console /dev/slog", do they both have the
same inode?  If not, then something else may have registered
/dev/console.

David


> 
> 
> 
> _______________________________________________
> 
> OSTech
> http://community.qnx.com/sf/go/post36624
> 
> 
Re: RE: ftpd and logging using slogger...  
David, echoing to /dev/console prints to slogger, so this seems to work.
So the problem is likely with syslogd... will take a deeper dig into this.

What I don't get yet is: how is /dev/console actually used within QNX?
Anything started in the bsh startup skript prints to the serial console,
and starting with an appended "2>&1 > /dev/console" doesn't seem to work in the bsh boot skript (probably as it's not a "
real" shell).

Greetings,
 Marc
RE: RE: ftpd and logging using slogger...  
 

> -----Original Message-----
> From: Marc Roessler [mailto:community-noreply@qnx.com] 
> Sent: August 25, 2009 11:19 AM
> To: ostech-core_os
> Subject: Re: RE: ftpd and logging using slogger...
> 
> David, echoing to /dev/console prints to slogger, so this 
> seems to work.
> So the problem is likely with syslogd... will take a deeper 
> dig into this.
> 
> What I don't get yet is: how is /dev/console actually used within QNX?
> Anything started in the bsh startup skript prints to the 
> serial console, and starting with an appended "2>&1 > 
> /dev/console" doesn't seem to work in the bsh boot skript 
> (probably as it's not a "real" shell).

/dev/console is owned by slogger.  It's a plain-text input to slogger
(as opposed to /dev/slog, which looks for a header).  Any text sent to
/dev/console is simply added to the slog buffer.

> 
> Greetings,
>  Marc
> 
> 
> 
> 
> _______________________________________________
> 
> OSTech
> http://community.qnx.com/sf/go/post36635
> 
> 
Re: ftpd and logging using slogger...  
Thanks Sean... works - almost:

Aug 25 17:06:27    6 354080   1047 7:06:27 ftpd[12302-1]: using conservative LOG
IN_NAME_MAX valuedd<Aug J”7:06:27 ftpd[16397-1]: failed to write a pid file: No
such file or directory
....

Seems the log entries written by ftpd arrive at slogger somewhat garbled... it seems it sometimes tries to write 
multiple syslog entries within one slogger entry... the special characters printed seem to cause the serial terminal 
settings to be garbled when sloginfo is called within the terminal window.

Any ideas?

Greetings,
 Marc
RE: ftpd and logging using slogger...  
 

> -----Original Message-----
> From: Marc Roessler [mailto:community-noreply@qnx.com] 
> Sent: August 25, 2009 11:10 AM
> To: ostech-core_os
> Subject: Re: ftpd and logging using slogger...
> 
> Thanks Sean... works - almost:
> 
> Aug 25 17:06:27    6 354080   1047 7:06:27 ftpd[12302-1]: 
> using conservative LOG
> IN_NAME_MAX valuedd<Aug J"7:06:27 ftpd[16397-1]: failed to 
> write a pid file: No such file or directory ....
> 
> Seems the log entries written by ftpd arrive at slogger 
> somewhat garbled... it seems it sometimes tries to write 
> multiple syslog entries within one slogger entry... the 
> special characters printed seem to cause the serial terminal 
> settings to be garbled when sloginfo is called within the 
> terminal window.
> 
> Any ideas?


/dev/slog makes assumptions about the format of the arriving data.
/dev/console assumes it's just receiving plain-text.  Try changing the
symlink to point to /dev/console instead of /dev/slog.

> 
> Greetings,
>  Marc
> 
> 
> 
> _______________________________________________
> 
> OSTech
> http://community.qnx.com/sf/go/post36633
> 
Re: RE: ftpd and logging using slogger...  
Okay...
It works..

Solution:
- /dev/console was a pointer to /dev/ser1 in the BSP... which later was shadowed by slogger's /dev/console but seemed to
 cause problems nevertheless. Changed it, works better now.
- syslog.conf was faulty, used a space instead of a tab as separator... the strange error message was somewhat 
misguiding me

Can this (i.e. the whole slogger vs. syslogd issue) be found in the docu somewhere? Would be nice if this was added, as 
it's a rather standard problem i suppose...

Thanks & Greetings,
 Marc