HP3000-L Archives

May 2002, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Bixby <[log in to unmask]>
Reply To:
Mark Bixby <[log in to unmask]>
Date:
Wed, 1 May 2002 17:43:32 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (122 lines)
Jeff Woods wrote:

> Howdy, folks.
>
> Is anyone out there using syslogd on MPE?


Yes.  ;-)

> I've found some things that
> surprise me when trying to use it with stunnel (which I've essentially
> finished porting to MPE [6.5 and later only] and will have a more official
> announcement when it's packaged up better... i.e., Real Soon Now).


You're breaking new ground with stunnel + syslog.


> The SYSLOG account and files in it (syslog.h, libsyslog.a, syslog.conf,
> etc.) exist on the 6.5 and 7.0 systems which I have here, which makes me
> suspect it came with FOS.


IIRC it's been in FOS since 6.0.

> However, the syslog.conf file looks (at least to
> me) like it's more of an example of how *not* to configure syslogd than
> anything close to a reasonable default configuration.  Or am I
> misunderstanding something (probably something fundamental) that makes the
> "out of the box" syslog.conf on MPE make sense?


The distributed syslog.conf is more of an example of what is possible with
syslog, rather than something you want to put into production use unmodified.

I was still a customer back then, and if I had been the one to productize it
for FOS I might have called it syslog.conf.sample and changed the contents around.


> On an A400 with MPE 7.0.1+patches, whenever writing to /dev/console (either
> through syslogd or directly from stunnel (compiled with GCC 3.0.4) I am
> getting three copies of each message on the system console, instead of just
> one.  Oddly, writing to /dev/console from syslogd or stunnel *does* send
> messages (in triplicate remember!) to the console EVEN THOUGH /dev/console
> doesn't seem to exist as a device file (or any other file type) on the
> system.  However, :TELLOP messages appear one time on the console (as
> expected).  Why are /dev/console messages being duplicated?  Why (or perhaps
> how) does opening /dev/console through the C API (from GCC) get messages to
> the console when no file named /dev/console even exists?
>
> On a 918LX with MPE 6.5.2+patches, writing directly to /dev/console from
> stunnel just creates a bytestream file (just as if I'd directed it to
> /tmp/console or any other previously nonexistent filename) which is what I
> would expect since no file named /dev/console previously existed.  However,
> when syslogd is directed to /dev/console it writes to the logical console,
> but the lines are truncated after 72 bytes (plus the typical console message
> prefix with time, jobnum and pin; e.g., "12;34/#S99/123/").  (Note that on
> the 7.0 machine mentioned in the preceding paragraph the messages are not
> being truncated.)


When I ported syslog back in the days of MPE 5.5, there was no /dev/console.

I elected to make syslogd smart enough that if it saw the string /dev/console
listed in syslog.conf, it would use vanilla MPE methods to write to the
console.  /dev/console is never opened as a POSIX file or as an MPE file.

I don't see /dev/console existing on two 7.0 systems of mine.  What do you get
when you do :LISTFILE /dev/console,5 on your machines?

If this was actually implemented as a real POSIX device file, nobody ever told
me about it!


> Is syslogd actually doing a :TELLOP or more likely PRINTOP() when it sees
> /dev/console in the configuration?


(rummaging through source code repositories...)

Syslogd is calling the undocumented priv-mode procedure genmsg(), which is the
same thing that :TELLOP/PRINTOP() uses.  My memory is hazy, but I think I
resorted to genmsg() to be able to send long lines to the console without
truncation.


> Also, on both MPE 6.5 and 7.0, /SYSLOG/PUB/syslog.h has all the constants
> that need to be defined to use the syslog API from C, but the prototypes for
> openlog(), syslog() and closelog() aren't there.  Why not?  And where are
> they?  [FWIW: The same problem exists in /usr/include/time.h where (among
> other things) the prototype for the select() function is supposed to be
> defined according to the Berkeley Sockets manual.]


I plead insanity regarding leaving the function prototypes out of syslog.h.
The open source INN package where this syslog came from didn't include the
prototypes in syslog.h, and I believe I just kept that file intact when I
ported syslog to MPE.

Lots of open source apps that I've worked on have the autoconfig smarts or
manual -D defines for generating the syslog function prototypes if they are
missing from syslog.h.

So while the missing prototypes haven't caused me any nasty problems in my
porting, if I had to port syslog all over again I would probably include them
in syslog.h.


> If anyone has some useful or enlightening comments about why these things
> are the way they are and how to make them behave better, I'd love to hear
> them.


If your life lacks meaning after finishing stunnel, you could port Linux syslog
to MPE and make it behave better than my original syslog.  ;-)
--
[log in to unmask]
Remainder of .sig suppressed to conserve expensive California electrons...

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2