[cpp-linbuild] 05/05: Restart httpd.service consistently in scriptlets

Codeberg noreply at shibboleth.net
Sun Feb 15 00:12:12 UTC 2026


This is an automated email from the git hooks/post-receive script.

codeberg pushed a commit to branch maint-3
in repository cpp-linbuild.

View the commit online:
https://codeberg.org/Shibboleth/cpp-linbuild/commit/5a08e4e129521a7028c6c22247212b201ea3a37a

commit 5a08e4e129521a7028c6c22247212b201ea3a37a
Author: John W. O'Brien <john at saltant.com>
AuthorDate: Sat Feb 14 21:30:58 2026 +0000

    Restart httpd.service consistently in scriptlets
    
    The guiding principle for this patch is to try restarting httpd.service
    after any action has changed the shib.conf config fragment and/or the
    Apache module.
---
 common/SPECS/shibboleth.spec | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/common/SPECS/shibboleth.spec b/common/SPECS/shibboleth.spec
index bda485f..aca2843 100644
--- a/common/SPECS/shibboleth.spec
+++ b/common/SPECS/shibboleth.spec
@@ -221,11 +221,13 @@ exit 0
 %post
 /sbin/ldconfig
 
-# Generate two keys on new installs.
+# Generate two keys and restart Apache on new installs.
 if [ $1 -eq 1 ] ; then
     cd %{_sysconfdir}/shibboleth
     /bin/sh ./keygen.sh -b -n sp-signing -u %{runuser} -g %{runuser}
     /bin/sh ./keygen.sh -b -n sp-encrypt -u %{runuser} -g %{runuser}
+
+    %{!?_without_builtinapache:/usr/bin/systemctl try-restart httpd.service 1>/dev/null}
 fi
 
 if [ $1 -gt 1 ] ; then
@@ -252,23 +254,19 @@ if [ $1 -gt 1 ] ; then
 fi
 
 %preun
-# On final removal, stop shibd and remove service, restart Apache if running.
+# On final removal, stop shibd and remove service
 %systemd_preun shibd.service
 
-if [ $1 -eq 0 ] ; then
-    %{!?_without_builtinapache:/usr/bin/systemctl try-restart httpd.service 1>/dev/null}
-    exit 0
-fi
 exit 0
 
 %postun
 /sbin/ldconfig
 # On upgrade, restart components if they're already running.
 %systemd_postun_with_restart shibd.service
-if [ $1 -ge 1 ] ; then
-    %{!?_without_builtinapache:/usr/bin/systemctl try-restart httpd.service 1>/dev/null}
-    exit 0
-fi
+
+# On upgrade/downgrade and final removal, restart Apache
+%{!?_without_builtinapache:/usr/bin/systemctl try-restart httpd.service 1>/dev/null}
+exit 0
 
 %posttrans
 exit 0
@@ -323,6 +321,7 @@ exit 0
 %changelog
 * Sat Feb 14 2026 John W. O'Brien <john at saltant.com> - 3.5.2-2
 - Use systemctl directly in scriptlets
+- Restart httpd.service consistently in scriptlets
 
 * Tue Dec 16 2025 Scott Cantor <cantor.2 at osu.edu> - 3.5.2-1
 - Bump version.

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list