Skip to contentSkip to conversation

syslog-ng: add UPDATE_ALTERNATIVE for syslog-service

PATCH In review Steffen Sledz 1 participant 2 messages Nov 11, 2015 – Nov 12, 2015 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 syslog-ng: add UPDATE_ALTERNATIVE for syslog-service

Use ALTERNATIVE mechanism in OE to manage the syslog service to avoid conflicts with other syslog implementations like rsyslog or busybox.

---
 meta-oe/recipes-support/syslog-ng/syslog-ng.inc | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
meta-oe/recipes-support/syslog-ng/syslog-ng.inc +7 -1
index a990bf8..54f6920 100644
@@ -96,12 +96,18 @@ SYSTEMD_SERVICE_${PN} = "${BPN}.service"
 
 # no syslog-init for systemd
 python () {
-    if 'sysvinit' in d.getVar("DISTRO_FEATURES", True).split():
+    if bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
         pn = d.getVar('PN', True)
         sysconfdir = d.getVar('sysconfdir', True)
         d.appendVar('ALTERNATIVE_%s' % (pn), ' syslog-init')
         d.setVarFlag('ALTERNATIVE_PRIORITY', 'syslog-init', '200')
         d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-init', '%s/init.d/syslog' % (sysconfdir))
+
+    if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
+        pn = d.getVar('PN', True)
+        d.appendVar('ALTERNATIVE_%s' % (pn), ' syslog-service')
+        d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-service', '%s/systemd/system/syslog.service' % (d.getVar('sysconfdir', True)))
+        d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-service', '%s/system/${BPN}.service' % (d.getVar('systemd_unitdir', True)))
 }
 
 INITSCRIPT_NAME = "syslog"
Signature · 1 line
2.6.3
#2 lore raw

This fixes [YOCTO-8688].

Signature · 7 lines
DResearch Fahrzeugelektronik GmbH
Otto-Schmirgal-Str. 3, 10319 Berlin, Germany
Tel: +49 30 515932-237 mailto:[email protected]
Fax: +49 30 515932-299
Geschäftsführer: Dr. Michael Weber, Werner Mögle;
Amtsgericht Berlin Charlottenburg; HRB 130120 B;
Ust.-IDNr. DE273952058