diff options
author | Kai Kang <kai.kang@windriver.com> | 2022-11-17 21:54:00 +0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2022-11-18 11:10:25 -0800 |
commit | 172c707251fd1a646b8e63854b5f4c04ff044ce3 (patch) | |
tree | 373fbf21da6986be9936d549a75ec67c02d90ef3 /meta-networking | |
parent | 5d5e8854718dab02c2737e3faf288f830a514841 (diff) | |
download | meta-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.service | 3 | ||||
-rw-r--r-- | meta-networking/recipes-connectivity/freeradius/freeradius_3.0.21.bb | 30 |
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] |
6 | Type=forking | 6 | Type=forking |
7 | EnvironmentFile=-/etc/sysconfig/radiusd | ||
7 | PIDFile=/run/radiusd/radiusd.pid | 8 | PIDFile=/run/radiusd/radiusd.pid |
8 | ExecStartPre=-@BASE_BINDIR@/chown -R radiusd:radiusd /run/radiusd | 9 | ExecStartPre=-@BASE_BINDIR@/chown -R radiusd:radiusd /run/radiusd |
9 | ExecStartPre=@SBINDIR@/radiusd -C | 10 | ExecStartPre=@SBINDIR@/radiusd -C |
10 | ExecStart=@SBINDIR@/radiusd -d @SYSCONFDIR@/raddb | 11 | ExecStart=@SBINDIR@/radiusd -d @SYSCONFDIR@/${MLPREFIX}raddb |
11 | ExecReload=@SBINDIR@/radiusd -C | 12 | ExecReload=@SBINDIR@/radiusd -C |
12 | ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID | 13 | ExecReload=@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 | |||
216 | pkg_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 :( |