iopsys-feed/logmngr/files/10-logmngr_config_generate
Rahul Thakur 91e9278cba logmngr: add logread and default uci config
* all logging packages have a custom implmentation for logread,
  which is a command that can be invoked to view the logs. Hence,
  it makes sense for logmngr to have a logread to accompany it
  as well. Support for the same is added via this commit.
* the approach is simplistic and follows syslog-ng with the
  slight enhancement of reading the logfile from logmngr uci
* support to generate default uci config for logmngr which is
  to write logs to /var/log/messages
2024-07-23 10:32:18 +00:00

22 lines
476 B
Bash

#!/bin/sh
if [ -s "/etc/config/logmngr" ]; then
if uci -q get logmngr.@globals[0] >/dev/null; then
# return if there is any valid content
exit
else
rm -f /etc/config/logmngr
fi
fi
touch /etc/config/logmngr
uci set logmngr.globals=globals
uci set logmngr.globals.enable=1
uci set logmngr.a1=action
uci set logmngr.a1.name="ac1"
uci set logmngr.lf1=log_file
uci set logmngr.lf1.enable=1
uci set logmngr.lf1.action="ac1"
uci set logmngr.lf1.file="/var/log/messages"