minix/commands/syslogd
Gianluca Guida cc17b27a2b Build NetBSD libc library in world in ELF mode.
3 sets of libraries are built now:
  . ack: all libraries that ack can compile (/usr/lib/i386/)
  . clang+elf: all libraries with minix headers (/usr/lib/)
  . clang+elf: all libraries with netbsd headers (/usr/netbsd/)

Once everything can be compiled with netbsd libraries and headers, the
/usr/netbsd hierarchy will be obsolete and its libraries compiled with
netbsd headers will be installed in /usr/lib, and its headers
in /usr/include. (i.e. minix libc and current minix headers set
will be gone.)

To use the NetBSD libc system (libraries + headers) before
it is the default libc, see:
   http://wiki.minix3.org/en/DevelopersGuide/UsingNetBSDCode
This wiki page also documents the maintenance of the patch
files of minix-specific changes to imported NetBSD code.

Changes in this commit:
  . libsys: Add NBSD compilation and create a safe NBSD-based libc.
  . Port rest of libraries (except libddekit) to new header system.
  . Enable compilation of libddekit with new headers.
  . Enable kernel compilation with new headers.
  . Enable drivers compilation with new headers.
  . Port legacy commands to new headers and libc.
  . Port servers to new headers.
  . Add <sys/sigcontext.h> in compat library.
  . Remove dependency file in tree.
  . Enable compilation of common/lib/libc/atomic in libsys
  . Do not generate RCSID strings in libc.
  . Temporarily disable zoneinfo as they are incompatible with NetBSD format
  . obj-nbsd for .gitignore
  . Procfs: use only integer arithmetic. (Antoine Leca)
  . Increase ramdisk size to create NBSD-based images.
  . Remove INCSYMLINKS handling hack.
  . Add nbsd_include/sys/exec_elf.h
  . Enable ELF compilation with NBSD libc.
  . Add 'make nbsdsrc' in tools to download reference NetBSD sources.
  . Automate minix-port.patch creation.
  . Avoid using fstavfs() as it is *extremely* slow and unneeded.
  . Set err() as PRIVATE to avoid name clash with libc.
  . [NBSD] servers/vm: remove compilation warnings.
  . u32 is not a long in NBSD headers.
  . UPDATING info on netbsd hierarchy
  . commands fixes for netbsd libc
2011-06-24 11:46:30 +02:00
..
CHANGELOG Remove revision IDs from files 2010-11-04 01:13:59 +00:00
Makefile Remove revision IDs from files 2010-11-04 01:13:59 +00:00
README Kick out usyslogd in favour of syslogd Giovanni's syslogd port 2006-04-03 13:07:42 +00:00
README.minix Remove revision IDs from files 2010-11-04 01:13:59 +00:00
syslogd.c Build NetBSD libc library in world in ELF mode. 2011-06-24 11:46:30 +02:00

This is just syslogd and the test programs now. syslog() is in libc 4.2
syslogd has been changed to use /proc/kmsg for kernel messages. It also
avoids making any terminal it opens its controlling terminal. Otherwise
we have a dodgy race condition between processes connecting to terminals
which can result in the terminal having the wrong group at the wrong time.
The syslog() in libc 4.2 needs changing to use O_NOCTTY on its opens as
well.

Mike Jagdis	Internet: jaggy@purplet.demon.co.uk
		FidoNet:  Mike Jagdis, 2:252/305

---------------------------------------------------------------------------

                           Syslogd and Syslog.o

These are the syslogd and syslog ported from 4.3BSD (that's the new one with
the *very* flexible config file).  

Syslogd is essentially unchanged from the 4.3BSD, with the exception that
*nothing* is ever logged to the console (BAD thing to do on a UNIXpc).  You
can configure it (via /etc/syslog.conf) to log messages in different
logfiles (depending upon the sender's facility code and the priority), log
to users' terminals (same dependancies), and if things get real bad, it can
do a wall (write-all; same dependancies).

Syslog is really only modified in that it uses UDP datagrams because I had
no luck at all using UNIX domain sockets on the 3B1.  See syslog.h for
facility codes and priorities that can be used.


BUGS:
Messages from facilities LOG_KERN, LOG_USER, and LOG_PRT never can be
wall-ed, no matter how high the priority.  I'm still trying to decide if
this is a bug or a feature. :-)


ALSO INCLUDED:

Syslog_test, sendlog (to use from shell scripts) and logger (for use in
shell script also).

NEEDED:

The resolver routines in libresolv.a are not needed, but allow you to log to
hosts not present in /etc/hosts and to accept logging from same.

-----------------------------------------------------------------------

Fixed up UNIX domain socket code, added Linux specific code to read messages
from the kernel.

The #ifdefs are now :-

SYSLOG_INET	listen on a UDP socket (syslogd)
		log via UDP (syslog library call)

SYSLOG_UNIXAF	listen on a UNIX domain socker (syslogd)
		log via UNIX domain (syslogd library)

SYSLOG_KERNEL	fork a second copy to read kernel messages using
		syslog system call.

syslogd should be built with one or more of these flags, libsyslog.a should
be built with SYSLOG_INET or SYSLOG_UNIXAF, SYSLOG_INET is used in preference
to SYSLOG_UNIXAF.

readlog is a program which reads from the kernel and records the messages
it finds in syslogd via the normal library call interface, it can be run
instead of building syslogd with SYSLOG_KERNEL.