mirror of
git://git.openembedded.org/meta-openembedded
synced 2026-05-18 22:51:53 +00:00
freeradius: fix multilib systemd service start failure
It fails to start radiusd.service from lib32-freeradius that the configure directory is /etc/lib32-raddb rather than /etc/raddb. So add an environment file to export a variable MLPREFIX for the service file to make it start successfully. Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> (cherry picked from commit 172c707251fd1a646b8e63854b5f4c04ff044ce3) Signed-off-by: Armin Kuster <akuster808@gmail.com>
This commit is contained in:
parent
31b4858256
commit
c76cc68d15
@ -4,10 +4,11 @@ After=syslog.target network.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
EnvironmentFile=-/etc/sysconfig/radiusd
|
||||
PIDFile=/run/radiusd/radiusd.pid
|
||||
ExecStartPre=-@BASE_BINDIR@/chown -R radiusd:radiusd /run/radiusd
|
||||
ExecStartPre=@SBINDIR@/radiusd -C
|
||||
ExecStart=@SBINDIR@/radiusd -d @SYSCONFDIR@/raddb
|
||||
ExecStart=@SBINDIR@/radiusd -d @SYSCONFDIR@/${MLPREFIX}raddb
|
||||
ExecReload=@SBINDIR@/radiusd -C
|
||||
ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
|
||||
|
||||
|
||||
@ -199,9 +199,39 @@ pkg_postinst:${PN} () {
|
||||
# Fix ownership for /etc/raddb/*, /var/lib/radiusd
|
||||
chown -R radiusd:radiusd ${raddbdir}
|
||||
chown -R radiusd:radiusd ${localstatedir}/lib/radiusd
|
||||
|
||||
# for radiusd.service with multilib
|
||||
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
|
||||
install -d ${sysconfdir}/sysconfig
|
||||
echo "MLPREFIX=${MLPREFIX}" > ${sysconfdir}/sysconfig/radiusd
|
||||
fi
|
||||
else
|
||||
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
|
||||
install -d $D${sysconfdir}/sysconfig
|
||||
echo "MLPREFIX=${MLPREFIX}" > $D${sysconfdir}/sysconfig/radiusd
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_postrm:${PN} () {
|
||||
# only try to remove ${sysconfdir}/sysconfig/radiusd for systemd
|
||||
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'false', 'true', d)}; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -d ${sysconfdir}/raddb ]; then
|
||||
exit 0
|
||||
fi
|
||||
for variant in ${MULTILIB_GLOBAL_VARIANTS}; do
|
||||
if [ -d ${sysconfdir}/${variant}-raddb ]; then
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
|
||||
rm -f ${sysconfdir}/sysconfig/radiusd
|
||||
rmdir --ignore-fail-on-non-empty ${sysconfdir}/sysconfig
|
||||
}
|
||||
|
||||
# We really need the symlink :(
|
||||
INSANE_SKIP:${PN} = "dev-so"
|
||||
INSANE_SKIP:${PN}-krb5 = "dev-so"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user