Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
Some people use "eth0.machine.example.com" instead of
"machine.example.com" as reverse dns names.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
We hit the maximum file limit. 75% of that seems to be from active
machines, but we may also have stale ones that we needlessly keep open.
It is fairly cheap to close them once an hour.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
Getopt parameter was forgotten. Silly.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
Only print a message when dns resolution changed - usually once when the
machine logs for the first time. Also print a human-readable ip
address. The hex number was pretty much unusable.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
clean target missed btree.o. And for some strange reason cancd fails to
compile on an older ubuntu system unless ld gets "-Wl,--no-as-needed"
passed in.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
Open fd stays valid for 60s. It will actually stick around forever,
there is no garbage collection for stale files yet.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
Sometimes there are a few noisy machines generating 100GB+ per day,
filling up the disk and preventing logrotate from cleaning things up.
Manual intervention is required and several hours or days of logs are
lost - depending on how timely the humans respond.
Having a fixed limit of 1GB or some other reasonable value ensures we
lose logs from the noisy machines, but not from the well-behaving ones
due to full disk.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
Using an unsigned long * to a u32 gives 32 random bits. Not a good
identifier.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
Allows other user without write access to read logfiles.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
After about four month, we never noticed this rather obvious bug. Tells
you something about the frequency of short writes.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
When having to deal with b0rken reverse DNS and trying to figure out
what machine happens to be called FOO by reverse DNS, while no machine
FOO exists in forward DNS, a small amount of paper trail might be
useful. The format isn't as nice as it could be.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
Turns TESTHOST07.bla.com into testhost07.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
Also remove the "optimization" strcmp, as it was buggy.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
We no longer allow complicated name structures, so this code has become
pointless.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
When possible we should use DNS hostnames instead of IP addresses as
logfile names. But gethostbyaddr() can block indefinitely, so run that
command from a dedicated thread. If it blocks, we just write to the ip
address name.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
Currently used for newlines and filename.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
Already defined in libc by now.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
Also remove AGGRESSIVE_COMPACTION, as we won't need it and silence a
(wrong) compiler warning.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
It will be used to store per-ip data, like reverse dns lookups, whether
we previously had a newline, etc.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
Actual netconsole packets can be shorter than a line. So instead of
creating a new line plus timestamp for every fragment, remember whether
we had a newline before and only add a timestamp in those cases.
Currently this is still semi-broken. We have no memory across packets,
so timestamps are never printed for the first line of a packet.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
There is no point in depending on page size or supporting machines where
sizeof(char) is not one. Also warn if ever the buffer is too small, so
people have an indication to go and increase it. And just in case 32k
is not enough, bump the size to 1M. Memory is cheap enough these days.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
Last commit clearly was untested. Don't commit on an airport, ever.
- NUL-terminate string before handing it off to strchrnul().
- Fix off-by-one (NUL byte).
- Fix spelling.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
Make this look more like syslog.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
A good candidate for a libc function, if ever there was one.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
It only ever returned 0 - making the return code fairly pointless.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
No more funny business with time/date. We expect a lot of output, not
just the rare kernel panic. Having literally millions of files around
simply doesn't fly.
Also, I believe the old code failed to NUL-terminate the string.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
If all callers use the same parameter, don't bother passing it.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
The usage of strncat is a textbook case of when to use strlcat instead.
The double strlen is just wasting performance, assuming no buffer
overflows in strncat before. And lastly, the program already cd'd into
the proper directory. So for a relative path "foo" we created files
under "foo/foo/", not under "foo/".
Quite a number of bugs to fix by removing so little code.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
Tarball sais 0.1.0, so match that.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
And sort the includes, while at it.
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
Signed-off-by: Joern Engel <joern@logfs.org>
|
|
Signed-off-by: Joern Engel <joern@logfs.org>
|