diff --git a/Makefile b/Makefile index db022dea5..afc3ef650 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,8 @@ install: cp -R config/* $(DESTDIR)$(sysconfdir)/$(package_name) rm $(DESTDIR)$(sysconfdir)/$(package_name)/logrotate install -Dpm0644 config/logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/$(package_name) + rm $(DESTDIR)$(sysconfdir)/$(package_name)/osrt-slsa-user.conf + install -Dpm0644 config/osrt-slsa-user.conf $(DESTDIR)$(sysusersdir)/$(package_name)-user.conf for dir in dashboards datasources ; do ln -s $(pkgdatadir)/metrics/grafana/provisioning/$$dir.yaml \ $(DESTDIR)$(grafana_provisioning_dir)/$$dir/$(package_name).yaml ; done sed -i "s|OSRT_DATA_DIR|$(pkgdatadir)|" \ diff --git a/Makefile.common b/Makefile.common index 4f2758a58..630237c7a 100644 --- a/Makefile.common +++ b/Makefile.common @@ -11,3 +11,4 @@ apachevhostsdir=$(sysconfdir)/apache2/vhosts.d tmpfilesdir=$(prefix)/lib/tmpfiles.d logdir=/var/log varlibdir=/var/lib +sysusersdir=$(prefix)/lib/sysusers.d diff --git a/config/osrt-slsa-user.conf b/config/osrt-slsa-user.conf new file mode 100644 index 000000000..41be4f0fb --- /dev/null +++ b/config/osrt-slsa-user.conf @@ -0,0 +1,2 @@ +# Type Name ID GECOS [HOME] +u osrt-slsa - "User for openSUSE SLSA release tool" /var/lib/osrt-slsa diff --git a/dist/package/openSUSE-release-tools.spec b/dist/package/openSUSE-release-tools.spec index 502aab3da..601911a9a 100644 --- a/dist/package/openSUSE-release-tools.spec +++ b/dist/package/openSUSE-release-tools.spec @@ -319,6 +319,7 @@ OSC plugin for the staging workflow, see `osc staging --help`. %build %make_build +%sysusers_generate_pre config/osrt-slsa-user.conf %{name} %{name}-user.conf %install %make_install \ @@ -326,6 +327,8 @@ OSC plugin for the staging workflow, see `osc staging --help`. oscplugindir="%{osc_plugin_dir}" \ VERSION="%{version}" +%pre -f %{name}.pre + %pre announcer getent passwd osrt-announcer > /dev/null || \ useradd -r -m -s /sbin/nologin -c "user for openSUSE-release-tools-announcer" osrt-announcer @@ -370,9 +373,6 @@ exit 0 %pre slsa-build-service %service_add_pre %{services} -getent passwd osrt-slsa > /dev/null || \ - useradd -r -d /var/lib/osrt-slsa -s /sbin/nologin -c "user for openSUSE-release-tools-slsa-build-service" osrt-slsa -exit 0 %post slsa-build-service %service_add_post %{services} @@ -469,6 +469,7 @@ exit 0 %{_datadir}/%{source_dir}/verify-build-and-generatelists %{_datadir}/%{source_dir}/verify-repo-built-successful.py %{_sysconfdir}/openSUSE-release-tools/ibsapi +%{_sysusersdir}/%{name}-user.conf %{_unitdir}/osrt-pkglistgen@.service %{_unitdir}/osrt-pkglistgen@.timer %{_unitdir}/osrt-relpkggen@.service