Commit Graph

13 Commits

Author SHA1 Message Date
Peter Wemm a30a31bb3f put on my flame resistant suit and tempt fate by attempting to fix some of
the races in my previous commits here, and fix some other problems with
syslogd as well.

- if the child process exited early (eg: could not bind to the socket),
  the boot process would hang for 30 seconds.  The parent was not noticing
  that the child had exited.  (my fault)
- when writing to tty devices, instead of treating them like files that
  need \r\n instead of \n, actually use ttymsg() which has specific code
  intended to write to potentially blocking ttys safely.  I had a machine
  lock up last night because /dev/console on a serial port got flow control
  blocked.  Setting comcontrol drainwait fixed everything but syslogd which
  was going into a spin trying to write to the console and completely
  ignoreing everything else.
- fix a couple of nonsensical bits of code while here..  eg: wait3 takes
  a pointer to an int.  There is no sense in declaring it as 'union wait',
  then casting the pointer to (int *), then forgetting about it.
1996-11-18 21:48:29 +00:00
Joerg Wunsch 1c0899bbb0 Back out the entire change from rev 1.11 of syslogd.c. It was bogus.
Correct the man page to reflect the new reality.
1996-10-28 08:25:13 +00:00
Julian Elischer 36be1f6be9 Reviewed by: various (mailing list feedback)
Submitted by:	whistle communications

move the socket from /dev to /var/run by default
TRANSITIONALLY make syslog add a symlink..
I PROMISE I'll remove that as soon as I have the makefiles etc fixed as well.
1996-10-23 20:17:57 +00:00
Peter Wemm 4ed8e95bc0 syslogd has always bugged me with it's async startup at boot time.
For me, more often than not, the backgrounded syslogd daemon is not
yet ready to process log messages before other things (such as named)
want to log a heap of them.  It seems that it's the O_SYNC writes of
the stuff coming in from /dev/klog that's the slowdown.

Anyway, instead of using the libc daemon, roll a modified version.  This
one has a timeout.  The child will wait for either the timeout to expire
or the child process to signal it to let it know that it's "ready" and
the /dev/log socket is set up and active, so it's safe to continue the
boot.  It adds a small fraction of a second pause to the boot time, but on
the other hand the overall boot time is *quicker* since the disk is not
being thrashed while the log messages are getting written out synchronously
one by one while other daemons are loading in parallel.

The timeout is in case the child segfaults or something before becoming
fully operational.
1996-10-05 15:20:51 +00:00
Paul Traina a13e99514d Bring in some fixes from NetBSD and re-hack our syslogd to be option-compatible
with theirs (change the -I option to -s (but leave -I in for backwards compat.)
Also eliminate an make sane some magic numbers, and fix a small bug where we'd
send to an unopened socket.

Reviewed by:	wollman
Obtained from:	NetBSD
1996-07-22 16:35:50 +00:00
Peter Wemm be467afaff With the recent 'make install' change in the kernel build makefiles, an
`interesting' feature of syslogd turned up.  It calls getbootfile() for each
log entry.  Since the kernel makefile now changes kern.bootfile when doing
a 'make install', it's quite startling to see the syslog lines change.

This change makes it call getbootfile() once at startup and cache it,
saving a syscall per loop, and keeping something a little more asthetically
pleasing in /var/log/messages...
1995-11-14 23:39:39 +00:00
Garrett Wollman a2029046fd Add a command-line option `-I' to disable logging from UDP.
Document `-d' and `-I'.  Add a BUGS section noting that
logging from UDP is an unauthenticated remote disk-filling service,
and probably should be disabled by default in the absence of some sort
of authentication.
1995-10-12 17:18:39 +00:00
Paul Richards df1e48c2bb Remove unconditional unlink at startup and conditionalised the unlink at exit
so that it only unlinks the file if syslogd knows it created it.

If the path specified for the socket already exists then syslogd
will now exit with an "address already in use" error which is more
sensible than blindly unlinking the existing filename.  This stops
syslogd -d foo/bar from unlinking foo/bar if it's a real file.
1995-09-11 13:55:11 +00:00
Paul Traina d9edc66fba Fix up warning about const being lost. 1995-08-23 04:54:49 +00:00
Rodney W. Grimes 709e8f9ae1 Remove trailing whitespace. 1995-05-30 03:57:47 +00:00
Garrett Wollman d9dc765848 Extend syslogd to allow selection of log destinations by program.
Use getbootfile() to determine the kernel name.

Submitted by: Peter da Silva
1994-12-29 22:02:25 +00:00
David Greenman b3bfc7199e Converted 'vmunix' to 'kernel'. 1994-08-05 09:14:37 +00:00
Rodney W. Grimes dea673e932 BSD 4.4 Lite usr.sbin Sources 1994-05-26 05:23:31 +00:00