From 71ae5ce544f5ec8ec9856d930cbca6b3a5a7a3bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 16 May 2021 20:13:14 +0200 Subject: [PATCH] units: generate ReadWritePaths= in the template --- meson.build | 7 +------ units/systemd-localed.service.in | 5 ++++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index 171c3dda737..8b1871523f1 100644 --- a/meson.build +++ b/meson.build @@ -828,15 +828,10 @@ endif conf.set_quoted('SYSTEMD_DEFAULT_LOCALE', default_locale) localegen_path = get_option('localegen-path') -have = false -writable = '' if localegen_path != '' conf.set_quoted('LOCALEGEN_PATH', localegen_path) - have = true - writable = ' /usr/lib/locale' endif -conf.set_quoted('SERVICE_LOCALEGEN_WRITABLE', writable) -conf.set10('HAVE_LOCALEGEN', have) +conf.set10('HAVE_LOCALEGEN', localegen_path != '') conf.set_quoted('GETTEXT_PACKAGE', meson.project_name()) diff --git a/units/systemd-localed.service.in b/units/systemd-localed.service.in index abd32266aeb..f9a92fef7be 100644 --- a/units/systemd-localed.service.in +++ b/units/systemd-localed.service.in @@ -33,7 +33,10 @@ ProtectKernelLogs=yes ProtectKernelModules=yes ProtectKernelTunables=yes ProtectSystem=strict -ReadWritePaths=/etc{{SERVICE_LOCALEGEN_WRITABLE}} +ReadWritePaths=/etc +{% if HAVE_LOCALEGEN %} +ReadWritePaths=/usr/lib/locale +{% endif %} RestrictAddressFamilies=AF_UNIX RestrictNamespaces=yes RestrictRealtime=yes