summaryrefslogtreecommitdiffstats
path: root/meta-networking
diff options
context:
space:
mode:
authorKai Kang <kai.kang@windriver.com>2022-11-17 21:54:00 +0800
committerKhem Raj <raj.khem@gmail.com>2022-11-18 11:10:25 -0800
commit172c707251fd1a646b8e63854b5f4c04ff044ce3 (patch)
tree373fbf21da6986be9936d549a75ec67c02d90ef3 /meta-networking
parent5d5e8854718dab02c2737e3faf288f830a514841 (diff)
downloadmeta-openembedded-172c707251fd1a646b8e63854b5f4c04ff044ce3.tar.gz
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>
Diffstat (limited to 'meta-networking')
-rw-r--r--meta-networking/recipes-connectivity/freeradius/files/radiusd.service3
-rw-r--r--meta-networking/recipes-connectivity/freeradius/freeradius_3.0.21.bb30
2 files changed, 32 insertions, 1 deletions
diff --git a/meta-networking/recipes-connectivity/freeradius/files/radiusd.service b/meta-networking/recipes-connectivity/freeradius/files/radiusd.service
index 37a2eb3d7..7969bfb69 100644
--- a/meta-networking/recipes-connectivity/freeradius/files/radiusd.service
+++ b/meta-networking/recipes-connectivity/freeradius/files/radiusd.service
@@ -4,10 +4,11 @@ After=syslog.target network.target
4 4
5[Service] 5[Service]
6Type=forking 6Type=forking
7EnvironmentFile=-/etc/sysconfig/radiusd
7PIDFile=/run/radiusd/radiusd.pid 8PIDFile=/run/radiusd/radiusd.pid
8ExecStartPre=-@BASE_BINDIR@/chown -R radiusd:radiusd /run/radiusd 9ExecStartPre=-@BASE_BINDIR@/chown -R radiusd:radiusd /run/radiusd
9ExecStartPre=@SBINDIR@/radiusd -C 10ExecStartPre=@SBINDIR@/radiusd -C
10ExecStart=@SBINDIR@/radiusd -d @SYSCONFDIR@/raddb 11ExecStart=@SBINDIR@/radiusd -d @SYSCONFDIR@/${MLPREFIX}raddb
11ExecReload=@SBINDIR@/radiusd -C 12ExecReload=@SBINDIR@/radiusd -C
12ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID 13ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
13 14
diff --git a/meta-networking/recipes-connectivity/freeradius/freeradius_3.0.21.bb b/meta-networking/recipes-connectivity/freeradius/freeradius_3.0.21.bb
index 1407b798b..b459412e0 100644
--- a/meta-networking/recipes-connectivity/freeradius/freeradius_3.0.21.bb
+++ b/meta-networking/recipes-connectivity/freeradius/freeradius_3.0.21.bb
@@ -199,7 +199,37 @@ pkg_postinst:${PN} () {
199 # Fix ownership for /etc/raddb/*, /var/lib/radiusd 199 # Fix ownership for /etc/raddb/*, /var/lib/radiusd
200 chown -R radiusd:radiusd ${raddbdir} 200 chown -R radiusd:radiusd ${raddbdir}
201 chown -R radiusd:radiusd ${localstatedir}/lib/radiusd 201 chown -R radiusd:radiusd ${localstatedir}/lib/radiusd
202
203 # for radiusd.service with multilib
204 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
205 install -d ${sysconfdir}/sysconfig
206 echo "MLPREFIX=${MLPREFIX}" > ${sysconfdir}/sysconfig/radiusd
207 fi
208 else
209 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
210 install -d $D${sysconfdir}/sysconfig
211 echo "MLPREFIX=${MLPREFIX}" > $D${sysconfdir}/sysconfig/radiusd
212 fi
213 fi
214}
215
216pkg_postrm:${PN} () {
217 # only try to remove ${sysconfdir}/sysconfig/radiusd for systemd
218 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'false', 'true', d)}; then
219 exit 0
220 fi
221
222 if [ -d ${sysconfdir}/raddb ]; then
223 exit 0
202 fi 224 fi
225 for variant in ${MULTILIB_GLOBAL_VARIANTS}; do
226 if [ -d ${sysconfdir}/${variant}-raddb ]; then
227 exit 0
228 fi
229 done
230
231 rm -f ${sysconfdir}/sysconfig/radiusd
232 rmdir --ignore-fail-on-non-empty ${sysconfdir}/sysconfig
203} 233}
204 234
205# We really need the symlink :( 235# We really need the symlink :(