diff options
author | Armin Kuster <akuster808@gmail.com> | 2021-11-05 05:33:59 -0700 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2021-11-07 11:26:49 -0800 |
commit | b654040fad922cdd486f43167ca689bef4058ca2 (patch) | |
tree | f16ac51c3c700633c53709ee0f2bece643bf0807 /recipes-security | |
parent | 696651d0c32258b789ab768bb506bc0a1fdc9a31 (diff) | |
download | meta-security-b654040fad922cdd486f43167ca689bef4058ca2.tar.gz |
sssd: Create /var/log/sssd in runtime
/var/log is normally a link to /var/volatile/log and /var/volatile is a
tmpfs mount. So anything created in /var/log will not be available when
the tmpfs is mounted.
[Thanks to Peter Kjellerstedt for example]
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'recipes-security')
-rw-r--r-- | recipes-security/sssd/sssd_2.5.2.bb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/recipes-security/sssd/sssd_2.5.2.bb b/recipes-security/sssd/sssd_2.5.2.bb index ed8af5e..8bc8787 100644 --- a/recipes-security/sssd/sssd_2.5.2.bb +++ b/recipes-security/sssd/sssd_2.5.2.bb | |||
@@ -86,13 +86,23 @@ do_install () { | |||
86 | rmdir --ignore-fail-on-non-empty "${D}/${bindir}" | 86 | rmdir --ignore-fail-on-non-empty "${D}/${bindir}" |
87 | install -d ${D}/${sysconfdir}/${BPN} | 87 | install -d ${D}/${sysconfdir}/${BPN} |
88 | install -m 600 ${WORKDIR}/${BPN}.conf ${D}/${sysconfdir}/${BPN} | 88 | install -m 600 ${WORKDIR}/${BPN}.conf ${D}/${sysconfdir}/${BPN} |
89 | install -D -m 644 ${WORKDIR}/volatiles.99_sssd ${D}/${sysconfdir}/default/volatiles/99_sssd | 89 | |
90 | # /var/log/sssd needs to be created in runtime. Use rmdir to catch if | ||
91 | # upstream stops creating /var/log/sssd, or adds something else in | ||
92 | # /var/log. | ||
93 | rmdir ${D}${localstatedir}/log/${BPN} ${D}${localstatedir}/log | ||
94 | rmdir --ignore-fail-on-non-empty ${D}${localstatedir} | ||
90 | 95 | ||
91 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | 96 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
92 | install -d ${D}${sysconfdir}/tmpfiles.d | 97 | install -d ${D}${sysconfdir}/tmpfiles.d |
93 | echo "d /var/log/sssd 0750 - - - -" > ${D}${sysconfdir}/tmpfiles.d/sss.conf | 98 | echo "d /var/log/sssd 0750 - - - -" > ${D}${sysconfdir}/tmpfiles.d/sss.conf |
94 | fi | 99 | fi |
95 | 100 | ||
101 | if [ "${@bb.utils.filter('DISTRO_FEATURES', 'sysvinit', d)}" ]; then | ||
102 | install -d ${D}${sysconfdir}/default/volatiles | ||
103 | echo "d ${SSSD_UID}:${SSSD_GID} 0755 ${localstatedir}/log/${BPN} none" > ${D}${sysconfdir}/default/volatiles/99_${BPN} | ||
104 | fi | ||
105 | |||
96 | # Remove /run as it is created on startup | 106 | # Remove /run as it is created on startup |
97 | rm -rf ${D}/run | 107 | rm -rf ${D}/run |
98 | 108 | ||
@@ -106,6 +116,8 @@ fi | |||
106 | chown ${SSSD_UID}:${SSSD_GID} ${sysconfdir}/${BPN}/${BPN}.conf | 116 | chown ${SSSD_UID}:${SSSD_GID} ${sysconfdir}/${BPN}/${BPN}.conf |
107 | } | 117 | } |
108 | 118 | ||
119 | FILES:${PN} += "${nonarch_libdir}/tmpfiles.d" | ||
120 | |||
109 | CONFFILES:${PN} = "${sysconfdir}/${BPN}/${BPN}.conf" | 121 | CONFFILES:${PN} = "${sysconfdir}/${BPN}/${BPN}.conf" |
110 | 122 | ||
111 | INITSCRIPT_NAME = "sssd" | 123 | INITSCRIPT_NAME = "sssd" |