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>
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>
- 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>
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>
We already print the services in dependency order, for each target
individually. There is no need to print the depencies and the target
for each service.
In addtion, printing name and description in one line shortens the
resulting list.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
Some systems don't have a hardware real time clock and don't know the time
after bootin. An obvious soulution for this is to use time from an ntp
server. Unfortunately that requires domain name resolution, which resolvers
like unbound won't do for us, if the DNSSEC certificates aren't valid, which
they aren't if we start out with a time around 1970-1-1.
The "software clock" service tries to provide a workaround by restoring a
reasonably valid time from a backup file during boot, which we update when
shuting down. If we wan't a more correct time, we have to update it from
NTP in between.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit adds a "truncate" flag that can be added to a service
description between the "tty" keyword and the path string.
If the flag is set, the output file is truncated to 0 after opening.
This probably requires some remodeling in the future as the tty keyword
no longer deals with just tty devices.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
Add a service file and helper script to shut down all network interfaces
during shutdown or reboot.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
- 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>
This can can be used by shell scripts to produce syslog messages,
as well as aiding in debugging the usyslogd daemon.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>