Install rpm-ostree sysusers config and countme units

Install the systemd unit, timer and sysusers configuration for Count Me
support. We do not enable or pull as a dependency those units by default
as this is a decision that should be taken at the distribution level and
needs support on the infrastructure side.

To enable those units in a disctribution package, you can add the
following symlink:
$ ln -snf /usr/lib/systemd/system/rpm-ostree-countme.timer /usr/lib/systemd/system/rpm-ostreed.service.wants/

or add the following config snippet to the rpm-ostreed.service unit:
Wants=rpm-ostree-countme.timer
This commit is contained in:
Timothée Ravier 2021-02-25 12:14:36 +01:00 committed by OpenShift Merge Robot
parent 1c826e993b
commit 101d531f3b
5 changed files with 12 additions and 2 deletions

View File

@ -59,10 +59,14 @@ systemdunit_service_in_files = \
$(srcdir)/src/daemon/rpm-ostreed.service.in \
$(srcdir)/src/daemon/rpm-ostreed-automatic.service.in \
$(srcdir)/src/daemon/rpm-ostree-bootstatus.service.in \
$(srcdir)/src/daemon/rpm-ostree-countme.service.in \
$(NULL)
systemdunit_service_files = $(systemdunit_service_in_files:.service.in=.service)
systemdunit_timer_files = $(srcdir)/src/daemon/rpm-ostreed-automatic.timer
systemdunit_timer_files = \
$(srcdir)/src/daemon/rpm-ostreed-automatic.timer \
$(srcdir)/src/daemon/rpm-ostree-countme.timer \
$(NULL)
systemdunit_DATA = \
$(systemdunit_service_files) \
@ -78,6 +82,9 @@ endif
$(systemdunit_service_files): Makefile
$(SED_SUBST) $(daemon_asan_options) $@.in > $@
systemdsysusers_DATA = $(srcdir)/src/daemon/rpm-ostree.conf
systemdsysusersdir = $(prefix)/lib/sysusers.d
# We keep this stub script around to have SELinux labeling work,
# plus some backwards compatibility.
libexec_SCRIPTS = rpm-ostreed
@ -107,6 +114,7 @@ EXTRA_DIST += \
$(service_in_files) \
$(systemdunit_service_in_files) \
$(systemdunit_timer_files) \
$(systemdsysusers_conf_files) \
$(NULL)
CLEANFILES += \

View File

@ -175,6 +175,7 @@ $PYTHON autofiles.py > files \
'%{_datadir}/dbus-1/system.d/*' \
'%{_sysconfdir}/rpm-ostreed.conf' \
'%{_prefix}/lib/systemd/system/*' \
'%{_prefix}/lib/sysusers.d*' \
'%{_libexecdir}/rpm-ostree*' \
'%{_datadir}/polkit-1/actions/*.policy' \
'%{_datadir}/dbus-1/system-services' \

View File

@ -9,4 +9,4 @@ User=rpm-ostree
DynamicUser=yes
StateDirectory=rpm-ostree-countme
StateDirectoryMode=750
ExecStart=/usr/bin/rpm-ostree countme
ExecStart=@bindir@/rpm-ostree countme

View File

@ -0,0 +1 @@
u rpm-ostree - "Unprivileged rpm-ostree user"