summaryrefslogtreecommitdiffstats
path: root/initramfs/initrd-stuff/etc/functions
diff options
context:
space:
mode:
authorDirk von Suchodoletz2006-10-31 18:31:31 +0100
committerDirk von Suchodoletz2006-10-31 18:31:31 +0100
commit1d3b9e8d5c0bb0058106e2fb7e5a2754b6e62a82 (patch)
treed98b0bf88d45badf0577257e6db3cdce1c3fbac5 /initramfs/initrd-stuff/etc/functions
parent* removed legacy attributes which are managed by external (diff)
downloadcore-1d3b9e8d5c0bb0058106e2fb7e5a2754b6e62a82.tar.gz
core-1d3b9e8d5c0bb0058106e2fb7e5a2754b6e62a82.tar.xz
core-1d3b9e8d5c0bb0058106e2fb7e5a2754b6e62a82.zip
configuration of syslog-ng for SuSE should work now ... (added new
function for writing the config file - sysngwriter in functions) git-svn-id: http://svn.openslx.org/svn/openslx/trunk@499 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initramfs/initrd-stuff/etc/functions')
-rw-r--r--initramfs/initrd-stuff/etc/functions37
1 files changed, 36 insertions, 1 deletions
diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions
index 17bb1053..4cb18574 100644
--- a/initramfs/initrd-stuff/etc/functions
+++ b/initramfs/initrd-stuff/etc/functions
@@ -2,7 +2,7 @@
# (included by init, hwautocfg, servconfig, ... within OpenSLX initial
# ramfs)
#
-# Dirk von Suchodoletz <dvs@OpenSLX.com>, 13-10-2006
+# Dirk von Suchodoletz <dvs@OpenSLX.com>, 31-10-2006
# Felix Endres, 30-04-2006
# <mj0@uni-freiburg.de> (xenbr), 27-09-2006
# Tobias Maier
@@ -484,6 +484,41 @@ testmkd () {
}
#############################################################################
+# function for writing a syslog-ng.conf file. First parameter is absolute
+# destination (incl. /mnt prefix)
+# sysngwriter $dest $start_syslog
+sysngwriter () {
+syslogngcfg=$1
+# logging servers might be specified in $log_servers (from e.g. dhcp)
+# fixme!? only first logserver from dhcp variable is used
+[ -n "$log_servers" ] && start_syslog="syslog://${log_servers% *}:514/udp"
+echo -e "# File written by $0 within InitRamFS\n\
+source src {\n\tfile(\"/proc/kmsg\") log_prefix(\"kernel: \");\n\
+\tunix-stream(\"/dev/log\");\n\tinternal();\n};\ndestination console_all {\
+file(\"/dev/tty10\"); };" >$syslogngcfg
+case "$start_syslog" in
+ yes|Yes|YES)
+ : # already defined
+ ;;
+ file)
+ echo -e "destination allmessages { file(\"/var/log/allmessages\"); };\n\
+log { source(src); destination(allmessages); };" \
+ >>$syslogngcfg
+ ;;
+ *)
+ syslogsrv=$(uri_token $start_syslog server)
+ syslogport=$(uri_token $start_syslog port)
+ syslogprot=$(uri_token $start_syslog path)
+ [ -z ${syslogport} ] && syslogport=514
+ [ -z ${syslogprot} ] && syslogprot=udp
+ echo -e "destination loghost {\n\t${syslogprot}(\"${syslogsrv}\" \
+port(${syslogport}));\n};\nlog {\n\tsource(src); destination(loghost);\n};" \
+ >>$syslogngcfg
+ ;;
+esac
+}
+
+#############################################################################
# simple basename replacement
basename () {
local b=${1##*/}