rsyslogd: don't start without actions

Rsyslog is currently used only for remote logging. The daemon would run
though (started by systemd) even when remote logging has not been
configured. In other words, it would run without any actions.

With Yocto 2.6, rsyslogd won't run without any actions. Hence, start
rsyslogd on demand - only when remote logging is configured.

Change-Id: Iec37c5624818716a533b0e3ddcfe7ed7b10f0b38
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
diff --git a/recipes-extended/rsyslog/files/rsyslog-override.conf b/recipes-extended/rsyslog/files/rsyslog-override.conf
index d5084b1..faeeae0 100644
--- a/recipes-extended/rsyslog/files/rsyslog-override.conf
+++ b/recipes-extended/rsyslog/files/rsyslog-override.conf
@@ -2,3 +2,5 @@
 # This service is restarted when an rsyslog property is set, so
 # disable rate limiting to allow it to always be restarted.
 StartLimitIntervalSec=0
+# This file exists only if remote logging has been configured
+ConditionPathExists=/etc/rsyslog.d/server.conf
diff --git a/recipes-extended/rsyslog/rsyslog/server.conf b/recipes-extended/rsyslog/rsyslog/server.conf
deleted file mode 100644
index 5c8161b..0000000
--- a/recipes-extended/rsyslog/rsyslog/server.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# Remote Logging (we use TCP for reliable delivery)
-#*.* @@remote-host:port
diff --git a/recipes-extended/rsyslog/rsyslog_%.bbappend b/recipes-extended/rsyslog/rsyslog_%.bbappend
index 0a2fb33..3901844 100644
--- a/recipes-extended/rsyslog/rsyslog_%.bbappend
+++ b/recipes-extended/rsyslog/rsyslog_%.bbappend
@@ -2,15 +2,9 @@
 
 SRC_URI += " \
     file://rsyslog.conf \
-    file://server.conf \
 "
 
 PACKAGECONFIG ??= " \
     rsyslogd rsyslogrt inet regexp uuid \
     ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
 "
-
-do_install_append(){
-    install -m 0644 -D ${WORKDIR}/server.conf \
-        ${D}${sysconfdir}/rsyslog.d/server.conf
-}