diff options
authorChen Qi <Qi.Chen@windriver.com>2014-09-11 04:55:03 -0400
committerChen Qi <Qi.Chen@windriver.com>2014-09-19 16:07:25 +0800
commitd3c30a19101eacd3c339a31578f9bcae81cc08fe (patch)
parentf6a39cc957bf85ff43513f0b76afc3b2c9c906b6 (diff)
systemd: enable syslog.socket by default
The syslog daemon behaviour in our systemd system should be like the following 1. If ForwardToSyslog is disabled, no daemon should be started. 2. If ForwardToSyslog is enabled, daemon should be started via socket activation. This is very important for OE based system. Because unlike other distros, OE allows serveral syslog packages installed into one image, using ALTERNATIVE mechanism to manage them. If the syslog service is started regardless of socket activation, things crash. For example, if there's 'WantedBy=multi-user.target' in the '[Install]' section of busybox-syslog.service file, then this service would be started anyway, even if syslog.service doesn't point to it. In this case, /sbin/syslogd in busybox-syslog.service might be from other syslog packages like sysklogd or rsyslog. This patch is series of patches to implement the above behaviour. The syslog.socket needs to be enabled by default so that other syslog service could correctly be activated via socket activation at runtime. Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
1 files changed, 2 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd_216.bb b/meta/recipes-core/systemd/systemd_216.bb
index 331da994795..e3a0760a40f 100644
--- a/meta/recipes-core/systemd/systemd_216.bb
+++ b/meta/recipes-core/systemd/systemd_216.bb
@@ -148,6 +148,8 @@ do_install() {
# Enable journal to forward message to syslog daemon
sed -i -e 's/.*ForwardToSyslog.*/ForwardToSyslog=yes/' ${D}${sysconfdir}/systemd/journald.conf
+ # Enable syslog.socket by default, this is specific to our system
+ ln -sf ../syslog.socket ${D}${systemd_unitdir}/system/sockets.target.wants/syslog.socket
do_install_ptest () {