1
0
Fork 0
mirror of https://github.com/pygos/init.git synced 2024-11-16 08:47:10 +01:00
Commit graph

15 commits

Author SHA1 Message Date
David Oberhollenzer
532f5e6819 Normalize syslog message line endings
Most syslog messages have a line feed at the end, but some don't. This patch
removes trailing spaces from all syslog messages that have one and always adds
a line feed in the logging back end.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-08-23 09:07:10 +02:00
David Oberhollenzer
73404a09d4 usyslogd: minor header restructuring/file structure cleanup
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-08-20 12:31:51 +02:00
David Oberhollenzer
325f919847 usyslogd: chroot into log dir and drop privileges
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-08-20 07:44:15 +02:00
David Oberhollenzer
61bc850984 usyslogd: merge log files for the same service
If a service provides an identifier string, write all messages for that
service itno a file named after that identifier instread of splitting it
up by facility ID in a sub directory.

This is supposed to cleanup and simplify the clutter created in /var/log.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-08-20 07:44:15 +02:00
David Oberhollenzer
f51dca0878 usyslogd: report error if file operation fails
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-08-19 10:14:19 +02:00
David Oberhollenzer
e7121bf467 usyslogd: at least create files/sockets relative to prefix path
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-08-16 22:48:55 +02:00
David Oberhollenzer
29e4fc5607 usyslogd: more control over log rotate behaviour, command line processing
- Add more fine grained control over how log rotation is supposed to behave
 - Add command line option processing to usyslogd
 - Expose log rotation control via command line switches
 - Add default values to usyslogd service for pygos use case

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-08-16 22:48:55 +02:00
David Oberhollenzer
21b88d9352 usyslogd: keep track of log file size
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-08-16 18:20:27 +02:00
David Oberhollenzer
d62ee95689 Implement simple log rotation
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-08-16 13:59:02 +02:00
David Oberhollenzer
4311b9a2f1 usyslogd: create abstraction for log stream management
This commit seperates the formating and printing of log messages to files
more cleanly from the message pump that retrieves the log messages.

At a later point, other backends could be added more easiyl (e.g. forward
the log message to some server).

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-08-16 13:31:13 +02:00
David Oberhollenzer
0624f95de6 usyslogd: cleanup log file filename handling
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-08-13 22:06:34 +02:00
David Oberhollenzer
9878e69ebe usyslogd: store logs in subdirectory based on service identifier
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-06-17 18:20:53 +02:00
David Oberhollenzer
8a8f49a501 usyslogd: do logfile lookup by facility number
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-06-17 16:27:26 +02:00
David Oberhollenzer
f1cc12f55e [usyslogd] split off syslog parsing
- Add proto.{h,c} for parsing of syslog message
 - Also parse time stamp in addition to priority

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-06-11 19:47:52 +02:00
David Oberhollenzer
f52c7ea9d0 Add minimalistic syslog daemon
For now this daemon simply dumps all syslog messages into seperate log
files and doesn't do much parsing. Since the messages are readable ASCII
anyway, this should not be to much of a problem and sufficient for
debugging.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-06-11 19:45:42 +02:00