Adding rsyslog script (Closes: #711170).
authorDaniel Baumann <mail@daniel-baumann.ch>
Wed, 5 Jun 2013 08:31:31 +0000 (10:31 +0200)
committerDaniel Baumann <mail@daniel-baumann.ch>
Wed, 5 Jun 2013 08:53:04 +0000 (10:53 +0200)
examples/preseed.cfg
scripts/debconfig/0080-rsyslog [new file with mode: 0755]
scripts/debconfig/0080-rsyslog.templates [new file with mode: 0644]

index 43618b5..415987f 100644 (file)
@@ -1,4 +1,4 @@
-# live-debconfig (4.0~a22-1)
+# live-debconfig (4.0~a24-1)
 
 live-debconfig live-debconfig/scripts multiselect 
 
@@ -79,7 +79,10 @@ live-debconfig live-debconfig/util-linux/hwclockaccess boolean
 
 # procps
 live-debconfig live-debconfig/procps/net.ipv4.ip_forward boolean 
-live-debconfig live-debconfig/procps/vm.swappiness boolean 
+live-debconfig live-debconfig/procps/vm.swappiness string 
+
+# rsyslog
+live-debconfig live-debconfig/rsyslog/imklog boolean 
 
 # selinux
 live-debconfig live-debconfig/selinux/enable boolean 
diff --git a/scripts/debconfig/0080-rsyslog b/scripts/debconfig/0080-rsyslog
new file mode 100755 (executable)
index 0000000..c7a05c2
--- /dev/null
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+## live-debconfig(7) - System Configuration Scripts
+## Copyright (C) 2006-2013 Daniel Baumann <mail@daniel-baumann.ch>
+##
+## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
+## This is free software, and you are welcome to redistribute it
+## under certain conditions; see COPYING for details.
+
+
+set -e
+
+DEBCONF_SYSTEMRC="/var/lib/live/debconfig/systemrc"
+export DEBCONF_SYSTEMRC
+
+. /usr/share/debconf/confmodule
+
+Defaults ()
+{
+       if [ -z "${_IMKLOG}" ]
+       then
+               for _FILE in /etc/rsyslog.conf /etc/rsyslog.d/*
+               do
+                       #if [ -e "${_FILE}" ] && grep -Eqs '^ *\$ModLoad *imklog' "${_FILE}" && ! grep -Eqs '^ *#\$ModLoad *imklog' "${_FILE}"
+                       if [ -e "${_FILE}" ] && grep -Eqs '^ *\$ModLoad *imklog' "${_FILE}"
+                       then
+                               _IMKLOG="${_IMKLOG:-true}"
+                       else
+                               _IMKLOG="${_IMKLOG:-false}"
+                       fi
+               done
+
+               _IMKLOG="${_IMKLOG:-true}"
+       fi
+}
+
+db_get live-debconfig/rsyslog/imklog
+_IMKLOG="${RET}" # boolean
+
+Defaults
+
+db_set live-debconfig/rsyslog/imklog "${_IMKLOG}"
+db_fset live-debconfig/rsyslog/imklog seen false
+
+db_settitle live-debconfig/title
+db_input high live-debconfig/rsyslog/imklog || true
+db_go
+
+db_get live-debconfig/rsyslog/imklog
+_IMKLOG="${RET}" # boolean
+
+Defaults
+
+db_stop
+
+for _FILE in /etc/rsyslog.conf /etc/rsyslog.d/*
+do
+       if [ -e "${_FILE}" ]
+       then
+               case "${_IMKLOG}" in
+                       true)
+                               sed -i -e 's|^ *#$ModLoad *imklog|$ModLoad imklog|' "${_FILE}"
+                               ;;
+
+                       false)
+                               sed -i -e 's|^ *$ModLoad *imklog|#$ModLoad imklog|' "${_FILE}"
+                               ;;
+               esac
+       fi
+done
diff --git a/scripts/debconfig/0080-rsyslog.templates b/scripts/debconfig/0080-rsyslog.templates
new file mode 100644 (file)
index 0000000..b29f5d1
--- /dev/null
@@ -0,0 +1,15 @@
+Template: live-debconfig/title
+Type: title
+Description: live-debconfig: System Configuration
+
+Template: live-debconfig/rsyslog/imklog
+Type: boolean
+Default:
+Description: live-debconfig: log kernel messages?
+ Is it desired to log kernel messages?
+ .
+ On normal systems the kernel messages should be logged. However, on Linux
+ Containers (LXC) by default the kernel messages should not be logged within the
+ container.
+ .
+ The default value is yes.