rsyslog: include original config file
authorGiacomo Sanchietti <giacomo.sanchietti@nethesis.it>
Thu, 9 Jun 2022 10:47:28 +0000 (12:47 +0200)
committerRosen Penev <rosenp@gmail.com>
Thu, 7 Jul 2022 17:34:58 +0000 (10:34 -0700)
Allow advanced configurations from /etc/rsyslog.conf file

Signed-off-by: Giacomo Sanchietti <giacomo.sanchietti@nethesis.it>
admin/rsyslog/files/rsyslog.init

index 6d6d31caf258257842051d43ba5bd11582553b6d..a4e31b1fd6750d46dd0dcd43d7f82d0dbfa3e2f3 100644 (file)
@@ -7,6 +7,7 @@ USE_PROCD=1
 
 UCI_CONF="rsyslog"
 CONFIG_FILE="/var/etc/rsyslog.conf"
+BASE_CONFIG_FILE="/etc/rsyslog.conf"
 
 modules=""
 selectors=""
@@ -74,7 +75,9 @@ expand_config() {
     config_foreach handle_selector selector
     config_foreach handle_forwarder forwarder
 
+    mkdir -p $(dirname ${CONFIG_FILE})
     > ${CONFIG_FILE}
+    echo "include(file=\"${BASE_CONFIG_FILE}\" mode=\"optional\")" >> ${CONFIG_FILE}
     for m in ${modules}; do
         echo "module(load=\"${m}\")" >> ${CONFIG_FILE}
     done