All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH] syslog-ng.inc: fix prerm script & class includes
@ 2016-04-29 12:38 Ioan-Adrian Ratiu
  0 siblings, 0 replies; only message in thread
From: Ioan-Adrian Ratiu @ 2016-04-29 12:38 UTC (permalink / raw)
  To: openembedded-devel

The order of class includes is very important because it's the order in
which classes are evaluated. Both update-rc.d and update-alternatives
write to the prerm script, so the class order decides the script code
ordering. As they are now, prerm is:

 #!/bin/sh
        update-alternatives --remove  syslog-init /etc/init.d/syslog.syslog-ng
if [ -z "$D" ]; then
        /etc/init.d/syslog stop
fi

This causes errors because when syslog-ng is the only alternative it is
removed and then the script tries to stop it (No such file or directory)
but even if there are other alternatives, the script tries to stop
something other than syslog-ng which was removed.

By reversing the include order, prerm gets generated correctly and it
tries to stop syslog-ng before removing it:

if [ -z "$D" ]; then
        /etc/init.d/syslog stop
fi
update-alternatives --remove  syslog-init /etc/init.d/syslog.syslog-ng

Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
---
 meta-oe/recipes-support/syslog-ng/syslog-ng.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng.inc b/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
index 382dc5e..4e0f697 100644
--- a/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
+++ b/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
@@ -22,7 +22,7 @@ SRC_URI = "http://www.balabit.com/downloads/files/syslog-ng/sources/${PV}/source
            file://configure.ac-add-option-enable-thread-tls-to-manage-.patch \
 "
 
-inherit autotools systemd pkgconfig update-rc.d update-alternatives
+inherit autotools systemd pkgconfig update-alternatives update-rc.d
 
 EXTRA_OECONF = " \
     --enable-dynamic-linking \
-- 
2.8.0



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-04-29 12:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-29 12:38 [meta-oe][PATCH] syslog-ng.inc: fix prerm script & class includes Ioan-Adrian Ratiu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.