mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-07-27 07:57:27 +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>
This commit is contained in:
@@ -4,10 +4,11 @@ After=syslog.target network.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=forking
|
Type=forking
|
||||||
|
EnvironmentFile=-/etc/sysconfig/radiusd
|
||||||
PIDFile=/run/radiusd/radiusd.pid
|
PIDFile=/run/radiusd/radiusd.pid
|
||||||
ExecStartPre=-@BASE_BINDIR@/chown -R radiusd:radiusd /run/radiusd
|
ExecStartPre=-@BASE_BINDIR@/chown -R radiusd:radiusd /run/radiusd
|
||||||
ExecStartPre=@SBINDIR@/radiusd -C
|
ExecStartPre=@SBINDIR@/radiusd -C
|
||||||
ExecStart=@SBINDIR@/radiusd -d @SYSCONFDIR@/raddb
|
ExecStart=@SBINDIR@/radiusd -d @SYSCONFDIR@/${MLPREFIX}raddb
|
||||||
ExecReload=@SBINDIR@/radiusd -C
|
ExecReload=@SBINDIR@/radiusd -C
|
||||||
ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
|
ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
|
||||||
|
|
||||||
|
|||||||
@@ -199,9 +199,39 @@ pkg_postinst:${PN} () {
|
|||||||
# Fix ownership for /etc/raddb/*, /var/lib/radiusd
|
# Fix ownership for /etc/raddb/*, /var/lib/radiusd
|
||||||
chown -R radiusd:radiusd ${raddbdir}
|
chown -R radiusd:radiusd ${raddbdir}
|
||||||
chown -R radiusd:radiusd ${localstatedir}/lib/radiusd
|
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
|
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 :(
|
# We really need the symlink :(
|
||||||
INSANE_SKIP:${PN} = "dev-so"
|
INSANE_SKIP:${PN} = "dev-so"
|
||||||
INSANE_SKIP:${PN}-krb5 = "dev-so"
|
INSANE_SKIP:${PN}-krb5 = "dev-so"
|
||||||
|
|||||||
Reference in New Issue
Block a user