updte user/group management using sysusers files for rpm 4.19; other server scripts improvements [release 5.1-4mamba;Sat May 18 2024]

This commit is contained in:
Silvan Calarco 2024-05-18 19:54:06 +02:00
parent 33077767a4
commit 3972a5a14c
3 changed files with 39 additions and 37 deletions

View File

@ -0,0 +1,7 @@
# See systemd-sysusers(8) sysusers.d(5)
g stapusr -
g stapsys -
g stapdev -
g stapunpriv -
u stapunpriv - "systemtap unprivileged user" /var/lib/stapunpriv /sbin/nologin
m stapunpriv stapunpriv

View File

@ -0,0 +1,4 @@
# See systemd-sysusers(8) sysusers.d(5)
g stap-server 155
u stap-server 155 "systemtap compiler server" /var/lib/stap-server /sbin/nologin
m stap-server stap-server

View File

@ -1,11 +1,7 @@
%define with_docs 0 %define with_docs 0
%if %with_docs
%define with_publican 0
%endif
Name: systemtap Name: systemtap
Version: 5.1 Version: 5.1
Release: 2mamba Release: 4mamba
Summary: An instrumentation system for Linux systems Summary: An instrumentation system for Linux systems
Group: System/Tools Group: System/Tools
Vendor: openmamba Vendor: openmamba
@ -13,6 +9,8 @@ Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it> Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://sourceware.org/systemtap/ URL: https://sourceware.org/systemtap/
Source0: http://sourceware.org/systemtap/ftp/releases/systemtap-%{version}.tar.gz Source0: http://sourceware.org/systemtap/ftp/releases/systemtap-%{version}.tar.gz
Source1: systemtap-sysusers-runtime.conf
Source2: systemtap-sysusers-server.conf
License: GPL License: GPL
## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel BuildRequires: glibc-devel
@ -37,7 +35,7 @@ BuildRequires: perl-DBI
BuildRequires: perl-HTML-Parser BuildRequires: perl-HTML-Parser
BuildRequires: perl-devel BuildRequires: perl-devel
## AUTOBUILDREQ-END ## AUTOBUILDREQ-END
BuildRequires: librpm-devel >= 4.16.1.2-1mamba BuildRequires: librpm-devel >= 4.19.1.1-2mamba
BuildRequires: libnss-tools BuildRequires: libnss-tools
BuildRequires: crash-devel BuildRequires: crash-devel
BuildRequires: libz-devel BuildRequires: libz-devel
@ -51,9 +49,6 @@ BuildRequires: latex2html
BuildRequires: tetex-dvips BuildRequires: tetex-dvips
BuildRequires: tetex-latex BuildRequires: tetex-latex
BuildRequires: xmlto BuildRequires: xmlto
#%if %with_publican
#TODO BuildRequires: publican
#%endif
%endif %endif
Requires: gcc Requires: gcc
# suggest kernel debuginfo # suggest kernel debuginfo
@ -113,7 +108,6 @@ Group: System/Tools
Summary: Instrumentation System Server Summary: Instrumentation System Server
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
Requires: %{name}-runtime = %{?epoch:%epoch:}%{version}-%{release} Requires: %{name}-runtime = %{?epoch:%epoch:}%{version}-%{release}
#Requires: avahi
Requires: coreutils Requires: coreutils
Requires: libnss Requires: libnss
Requires: libnss-tools Requires: libnss-tools
@ -153,10 +147,6 @@ Python bindings to Systemtap.
--enable-crash \ --enable-crash \
%if %with_docs %if %with_docs
--enable-docs \ --enable-docs \
%if %with_publican
--enable-publican \
--with-publican-brand=openmamba \
%endif
%else %else
--disable-docs \ --disable-docs \
%endif %endif
@ -187,20 +177,19 @@ cp -rp testsuite %{buildroot}%{_datadir}/systemtap
mkdir docs.installed mkdir docs.installed
mv %{buildroot}%{_datadir}/doc/systemtap/*.pdf docs.installed/ mv %{buildroot}%{_datadir}/doc/systemtap/*.pdf docs.installed/
mv %{buildroot}%{_datadir}/doc/systemtap/tapsets docs.installed/ mv %{buildroot}%{_datadir}/doc/systemtap/tapsets docs.installed/
%if %with_publican
mv %{buildroot}%{_datadir}/doc/systemtap/SystemTap_Beginners_Guide docs.installed/
%endif
%endif %endif
#install -m 755 initscript/stap-server %{buildroot}%{_sysconfdir}/rc.d/init.d/ install -D -m0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/systemtap-runtime.conf
mkdir -p %{buildroot}%{_sysconfdir}/stap-server install -D -m0644 %{SOURCE2} %{buildroot}%{_sysusersdir}/systemtap-server.conf
mkdir -p %{buildroot}%{_sysconfdir}/stap-server/conf.d mkdir -p %{buildroot}%{_sysconfdir}/stap-server/conf.d
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig install -D -m 644 initscript/systemtap.service %{buildroot}%{_unitdir}/systemtap.service
install -m 644 initscript/config.stap-server %{buildroot}%{_sysconfdir}/sysconfig/stap-server install -D -m 644 initscript/logrotate.stap-server %{buildroot}%{_sysconfdir}/logrotate.d/stap-server
install -D -m 644 stap-server.service %{buildroot}%{_unitdir}/stap-server.service
install -D -m 644 stap-server.conf %{buildroot}%{_tmpfilesdir}/stap-server.conf
mkdir -p %{buildroot}%{_localstatedir}/log/stap-server mkdir -p %{buildroot}%{_localstatedir}/log/stap-server
touch %{buildroot}%{_localstatedir}/log/stap-server/log touch %{buildroot}%{_localstatedir}/log/stap-server/log
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
install -m 644 initscript/logrotate.stap-server %{buildroot}%{_sysconfdir}/logrotate.d/stap-server
%find_lang %{name} %find_lang %{name}
@ -211,16 +200,12 @@ install -m 644 initscript/logrotate.stap-server %{buildroot}%{_sysconfdir}/logro
getent group stap-server >/dev/null || groupadd -g 155 -r stap-server || groupadd -r stap-server getent group stap-server >/dev/null || groupadd -g 155 -r stap-server || groupadd -r stap-server
%pre runtime %pre runtime
getent group stapdev >/dev/null || groupadd -r stapdev %sysusers_create_compat %{SOURCE1}
getent group stapusr >/dev/null || groupadd -r stapusr :
exit 0
%pre server %pre server
getent passwd stap-server >/dev/null || \ %sysusers_create_compat %{SOURCE2}
/usr/sbin/useradd -c "Systemtap Compile Server" -u 155 -g stap-server -d %{_localstatedir}/lib/stap-server -m -r -s /sbin/nologin stap-server || \ :
/usr/sbin/useradd -c "Systemtap Compile Server" -g stap-server -d %{_localstatedir}/lib/stap-server -m -r -s /sbin/nologin stap-server
test -e ~stap-server && chmod 755 ~stap-server
exit 0
%post server %post server
test -e %{_localstatedir}/log/stap-server/log || { test -e %{_localstatedir}/log/stap-server/log || {
@ -231,7 +216,6 @@ chown stap-server:stap-server %{_localstatedir}/log/stap-server/log
if test ! -e ~stap-server/.systemtap/ssl/server/stap.cert; then if test ! -e ~stap-server/.systemtap/ssl/server/stap.cert; then
runuser -s /bin/sh - stap-server -c %{_libexecdir}/%{name}/stap-gen-cert >/dev/null runuser -s /bin/sh - stap-server -c %{_libexecdir}/%{name}/stap-gen-cert >/dev/null
%{_bindir}/stap-authorize-server-cert ~stap-server/.systemtap/ssl/server/stap.cert %{_bindir}/stap-authorize-server-cert ~stap-server/.systemtap/ssl/server/stap.cert
%{_bindir}/stap-authorize-signing-cert ~stap-server/.systemtap/ssl/server/stap.cert %{_bindir}/stap-authorize-signing-cert ~stap-server/.systemtap/ssl/server/stap.cert
fi fi
@ -259,6 +243,7 @@ fi
%{_libexecdir}/systemtap/HelperSDT.jar %{_libexecdir}/systemtap/HelperSDT.jar
%{_libexecdir}/systemtap/stapbm %{_libexecdir}/systemtap/stapbm
%{_libexecdir}/systemtap/libHelperSDT.so %{_libexecdir}/systemtap/libHelperSDT.so
%{_unitdir}/systemtap.service
%dir %{_datadir}/systemtap %dir %{_datadir}/systemtap
%dir %{_datadir}/systemtap/interactive-notebook %dir %{_datadir}/systemtap/interactive-notebook
%{_datadir}/systemtap/interactive-notebook/* %{_datadir}/systemtap/interactive-notebook/*
@ -291,6 +276,7 @@ fi
%{_libexecdir}/systemtap/stap-env %{_libexecdir}/systemtap/stap-env
%{_libexecdir}/systemtap/stap-authorize-cert %{_libexecdir}/systemtap/stap-authorize-cert
%{_libdir}/systemtap/staplog.so* %{_libdir}/systemtap/staplog.so*
%{_sysusersdir}/systemtap-runtime.conf
%{_mandir}/man8/staprun.8* %{_mandir}/man8/staprun.8*
%files sdt-devel %files sdt-devel
@ -301,13 +287,10 @@ fi
%dir %{_datadir}/systemtap/examples/ %dir %{_datadir}/systemtap/examples/
%{_datadir}/systemtap/examples/* %{_datadir}/systemtap/examples/*
%{_mandir}/man1/dtrace.1* %{_mandir}/man1/dtrace.1*
#%doc NEWS
%if %with_docs %if %with_docs
%doc docs.installed/*.pdf %doc docs.installed/*.pdf
%doc docs.installed/tapsets %doc docs.installed/tapsets
%if %with_publican #%doc NEWS
%doc docs.installed/SystemTap_Beginners_Guide
%endif
%endif %endif
%files exporter %files exporter
@ -331,7 +314,9 @@ fi
%{_libexecdir}/systemtap/stap-stop-server %{_libexecdir}/systemtap/stap-stop-server
%{_libexecdir}/systemtap/stap-gen-cert %{_libexecdir}/systemtap/stap-gen-cert
%{_libexecdir}/systemtap/stap-sign-module %{_libexecdir}/systemtap/stap-sign-module
%config(noreplace) %{_sysconfdir}/sysconfig/stap-server %{_sysusersdir}/systemtap-server.conf
%{_tmpfilesdir}/stap-server.conf
%{_unitdir}/stap-server.service
%dir %attr(0755,stap-server,stap-server) %{_localstatedir}/log/stap-server %dir %attr(0755,stap-server,stap-server) %{_localstatedir}/log/stap-server
%ghost %config %attr(0644,stap-server,stap-server) %{_localstatedir}/log/stap-server/log %ghost %config %attr(0644,stap-server,stap-server) %{_localstatedir}/log/stap-server/log
%{_mandir}/man7/error::*.7stap* %{_mandir}/man7/error::*.7stap*
@ -352,6 +337,12 @@ fi
%{_libexecdir}/systemtap/python/stap-resolve-module-function.py %{_libexecdir}/systemtap/python/stap-resolve-module-function.py
%changelog %changelog
* Sat May 18 2024 Silvan Calarco <silvan.calarco@mambasoft.it> 5.1-4mamba
- updte user/group management using sysusers files for rpm 4.19; other server scripts improvements
* Thu May 16 2024 Automatic Build System <autodist@mambasoft.it> 5.1-3mamba
- rebuilt by autoport with build requirements: librpm-devel>=4.19.1.1-2mamba
* Mon May 13 2024 Silvan Calarco <silvan.calarco@mambasoft.it> 5.1-2mamba * Mon May 13 2024 Silvan Calarco <silvan.calarco@mambasoft.it> 5.1-2mamba
- rebuild with only python3 - rebuild with only python3