public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/autossh] epel10: Add sysusers.d config file to allow rpm to create users/groups automatically
@ 2026-10-11 14:41 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-10-11 14:41 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/autossh
            Branch : epel10
            Commit : b7a9a10a941046c561598c9722b0f8d818f3432f
            Author : Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
            Date   : 2025-02-11T14:36:18+01:00
            Stats  : +12/-8 in 1 file(s)
            URL    : https://src.fedoraproject.org/rpms/autossh/c/b7a9a10a941046c561598c9722b0f8d818f3432f?branch=epel10

            Log:
            Add sysusers.d config file to allow rpm to create users/groups automatically

See https://fedoraproject.org/wiki/Changes/RPMSuportForSystemdSysusers.

---
diff --git a/autossh.spec b/autossh.spec
index 28f8096..f8ff608 100644
--- a/autossh.spec
+++ b/autossh.spec
@@ -1,7 +1,7 @@
 Summary: Utility to autorestart SSH tunnels
 Name: autossh
 Version: 1.4g
-Release: 17%{?dist}
+Release: 18%{?dist}
 # Automatically converted from old format: BSD - review is highly recommended.
 License: LicenseRef-Callaway-BSD
 URL: https://www.harding.motd.ca/autossh/
@@ -14,7 +14,6 @@ BuildRequires: /usr/bin/ssh
 BuildRequires: systemd
 BuildRequires: make
 %{?systemd_requires}
-Requires(pre): shadow-utils
 Requires: /usr/bin/ssh
 
 %description
@@ -26,6 +25,11 @@ dies or stops passing traffic, autossh will automatically restart it.
 %patch -P0 -p1
 cp -p %{SOURCE2} .
 
+# Create a sysusers.d config file
+cat >autossh.sysusers.conf <<EOF
+u autossh - 'autossh service account' %{_sysconfdir}/autossh -
+EOF
+
 %build
 %configure
 make %{?_smp_mflags}
@@ -47,12 +51,8 @@ cp -p autossh.1 $RPM_BUILD_ROOT%{_mandir}/man1
 
 install -m 0644 -p %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}
 
-%pre
-getent group autossh >/dev/null || groupadd -r autossh
-getent passwd autossh >/dev/null || \
-    useradd -r -g autossh -d %{_sysconfdir}/autossh -s %{_sbindir}/nologin \
-    -c "autossh service account" autossh
-exit 0
+install -m0644 -D autossh.sysusers.conf %{buildroot}%{_sysusersdir}/autossh.conf
+
 
 %post
 %systemd_post autossh@.service
@@ -80,8 +80,12 @@ fi
 %attr(750,autossh,autossh) %dir %{_sysconfdir}/autossh/
 %{_mandir}/man1/*
 %{_unitdir}/*
+%{_sysusersdir}/autossh.conf
 
 %changelog
+* Tue Feb 11 2025 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.4g-18
+- Add sysusers.d config file to allow rpm to create users/groups automatically
+
 * Thu Jan 16 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.4g-17
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-11 14:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-11 14:41 [rpms/autossh] epel10: Add sysusers.d config file to allow rpm to create users/groups automatically 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox