rsyslog: preserve existing configuration
Signed-off-by: Giacomo Sanchietti <giacomo.sanchietti@nethesis.it>
This commit is contained in:
parent
d7084eae60
commit
a3cea3655f
4 changed files with 53 additions and 48 deletions
|
@ -72,8 +72,8 @@ define Package/rsyslog/install
|
||||||
$(INSTALL_CONF) ./files/rsyslog.conf $(1)/etc
|
$(INSTALL_CONF) ./files/rsyslog.conf $(1)/etc
|
||||||
$(INSTALL_DIR) $(1)/etc/init.d
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
$(INSTALL_BIN) ./files/rsyslog.init $(1)/etc/init.d/rsyslog
|
$(INSTALL_BIN) ./files/rsyslog.init $(1)/etc/init.d/rsyslog
|
||||||
$(INSTALL_DIR) $(1)/etc/config
|
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||||
$(INSTALL_CONF) ./files/rsyslog $(1)/etc/config
|
$(INSTALL_CONF) ./files/20_rsyslog $(1)/etc/uci-defaults
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/rsyslog/config
|
define Package/rsyslog/config
|
||||||
|
|
33
admin/rsyslog/files/20_rsyslog
Normal file
33
admin/rsyslog/files/20_rsyslog
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
[ "$(sed -e '/^#/d' -e '/^\s*$/d' /etc/rsyslog.conf)" != "" ] && exit 0
|
||||||
|
[ "$(uci -q get rsyslog.syslog)" == "syslog" ] && exit 0
|
||||||
|
|
||||||
|
uci -q import rsyslog << EOI
|
||||||
|
config syslog 'syslog'
|
||||||
|
option tcp_input_port '514'
|
||||||
|
option udp_input '1'
|
||||||
|
option tcp_input '0'
|
||||||
|
option udp_input_port '514'
|
||||||
|
option default_template 'RSYSLOG_TraditionalFileFormat'
|
||||||
|
list modules 'imuxsock'
|
||||||
|
list modules 'imklog'
|
||||||
|
|
||||||
|
config selector
|
||||||
|
option source '*.info;mail.none;authpriv.none;cron.none'
|
||||||
|
option destination '/var/log/messages'
|
||||||
|
|
||||||
|
config selector
|
||||||
|
option source 'authpriv.*'
|
||||||
|
option destination '/var/log/secure'
|
||||||
|
|
||||||
|
config selector
|
||||||
|
option source 'mail.*'
|
||||||
|
option destination '/var/log/maillog'
|
||||||
|
|
||||||
|
config selector
|
||||||
|
option source 'cron.*'
|
||||||
|
option destination '/var/log/cron'
|
||||||
|
|
||||||
|
config selector
|
||||||
|
option source 'local7.*'
|
||||||
|
option destination '/var/log/boot.log'
|
||||||
|
EOI
|
|
@ -1,28 +0,0 @@
|
||||||
config syslog syslog
|
|
||||||
option tcp_input '0'
|
|
||||||
option tcp_input_port '514'
|
|
||||||
option udp_input '1'
|
|
||||||
option udp_input_port '514'
|
|
||||||
option default_template 'RSYSLOG_TraditionalFileFormat'
|
|
||||||
list modules 'imuxsock'
|
|
||||||
list modules 'imklog'
|
|
||||||
|
|
||||||
config selector
|
|
||||||
option source '*.info;mail.none;authpriv.none;cron.none'
|
|
||||||
option destination '/var/log/messages'
|
|
||||||
|
|
||||||
config selector
|
|
||||||
option source 'authpriv.*'
|
|
||||||
option destination '/var/log/secure'
|
|
||||||
|
|
||||||
config selector
|
|
||||||
option source 'mail.*'
|
|
||||||
option destination '/var/log/maillog'
|
|
||||||
|
|
||||||
config selector
|
|
||||||
option source 'cron.*'
|
|
||||||
option destination '/var/log/cron'
|
|
||||||
|
|
||||||
config selector
|
|
||||||
option source 'local7.*'
|
|
||||||
option destination '/var/log/boot.log'
|
|
|
@ -1,18 +1,18 @@
|
||||||
module(load="imuxsock")
|
#
|
||||||
module(load="imklog")
|
# The preferred way to configure rsyslogd is now UCI.
|
||||||
module(load="imudp")
|
#
|
||||||
input(type="imudp" port="514")
|
# This file can be still used and will be included
|
||||||
#module(load="imtcp")
|
# on top of the final configuration inside /var/etc/rsyslog.conf
|
||||||
#input(type="imtcp" port="514")
|
#
|
||||||
|
# Example of default configuration:
|
||||||
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
|
#
|
||||||
|
# module(load="imuxsock")
|
||||||
*.info;mail.none;authpriv.none;cron.none /var/log/messages
|
# module(load="imklog")
|
||||||
|
# module(load="imudp")
|
||||||
authpriv.* /var/log/secure
|
# input(type="imudp" port="514")
|
||||||
|
# $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
|
||||||
mail.* /var/log/maillog
|
# *.info;mail.none;authpriv.none;cron.none /var/log/messages
|
||||||
|
# authpriv.* /var/log/secure
|
||||||
cron.* /var/log/cron
|
# mail.* /var/log/maillog
|
||||||
|
# cron.* /var/log/cron
|
||||||
local7.* /var/log/boot.log
|
# local7.* /var/log/boot.log
|
||||||
|
|
Loading…
Reference in a new issue