Skip to content
Commit 5e2bb87e authored by Ioan-Adrian Ratiu's avatar Ioan-Adrian Ratiu Committed by Armin Kuster
Browse files

syslog-ng.inc: fix prerm script & class includes



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: default avatarIoan-Adrian Ratiu <adrian.ratiu@ni.com>
Signed-off-by: default avatarMartin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: default avatarOtavio Salvador <otavio@ossystems.com.br>
Signed-off-by: default avatarArmin Kuster <akuster808@gmail.com>
parent 9f34a856
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment