rsyslog: add UPDATE_ALTERNATIVE for syslog-service

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

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
This commit is contained in:
Chen Qi 2014-09-19 16:11:49 +08:00 committed by Martin Jansa
parent e335110e1e
commit 2b32463cfc

View File

@ -97,9 +97,16 @@ RDEPENDS_${PN} += "logrotate"
# 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_LINK_NAME', 'syslog-init', '%s/init.d/syslog' % (sysconfdir))
d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-init', '%s/init.d/syslog.%s' % (d.getVar('sysconfdir', True), d.getVar('BPN', True)))
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/rsyslog.service' % (d.getVar('systemd_unitdir', True)))
}