public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jon Ciesla <limburgher@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/postgrey] epel10.3: Migrate to systemd.
Date: Mon, 30 Nov 2026 12:53:16 GMT [thread overview]
Message-ID: <179604319634.1.6160884634192015668.rpms-postgrey-497f8ed26b3c@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/postgrey
Branch : epel10.3
Commit : 497f8ed26b3cfb05a49897a622d98a6889193b24
Author : Jon Ciesla <limburgher@gmail.com>
Date : 2012-03-20T08:33:46-05:00
Stats : +73/-14 in 3 file(s)
URL : https://src.fedoraproject.org/rpms/postgrey/c/497f8ed26b3cfb05a49897a622d98a6889193b24?branch=epel10.3
Log:
Migrate to systemd.
---
diff --git a/postgrey.service b/postgrey.service
new file mode 100644
index 0000000..4cb5ede
--- /dev/null
+++ b/postgrey.service
@@ -0,0 +1,23 @@
+[Unit]
+Description=Postfix Greylisting Service
+Before=postfix.service
+
+[Service]
+Type=forking
+
+EnvironmentFile=-/etc/sysconfig/postgrey
+ExecStartPre=-/bin/rm -f /var/run/postgrey.pid
+
+PIDFile=/var/run/postgrey.pid
+
+ExecStart=/usr/sbin/postgrey \
+ --unix=/var/spool/postfix/postgrey/socket \
+ --pidfile=/var/run/postgrey.pid \
+ --daemonize \
+ $POSTGREY_OPTS
+
+Restart=always
+RestartSec=1
+
+[Install]
+WantedBy=multi-user.target
diff --git a/postgrey.spec b/postgrey.spec
index f20f61f..433c217 100644
--- a/postgrey.spec
+++ b/postgrey.spec
@@ -3,23 +3,27 @@
Summary: Postfix Greylisting Policy Server
Name: postgrey
Version: 1.34
-Release: 2%{?dist}
+Release: 3%{?dist}
# File headers only state "GNU GPL", but the LICENSE sections state v2 and "any
# later version"
License: GPLv2+
Group: System Environment/Daemons
URL: http://postgrey.schweikert.ch/
Source0: http://postgrey.schweikert.ch/pub/postgrey-%{version}.tar.gz
-Source1: postgrey.init
+Source1: postgrey.service
Source2: README-rpm
+Source3: postgrey.sysconfig
Patch0: postgrey-1.28-group.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
# We require postfix for its directories and gid
Requires: postfix
Requires(pre): /usr/sbin/useradd
-Requires(post): /sbin/chkconfig
-Requires(preun): /sbin/service, /sbin/chkconfig
-Requires(postun): /sbin/service
+#Requires(post): /sbin/chkconfig
+#Requires(preun): /sbin/service, /sbin/chkconfig
+#Requires(postun): /sbin/service
+Requires(post): systemd-units
+Requires(preun): systemd-units
+Requires(postun): systemd-units
BuildArch: noarch
%description
@@ -63,8 +67,12 @@ echo "# Clients that should not be greylisted. See postgrey(8)." \
%{__mkdir_p} %{buildroot}%{_var}/spool/postfix/postgrey
# Init script
-%{__install} -D -p -m 0755 %{SOURCE1} \
- %{buildroot}%{_sysconfdir}/rc.d/init.d/postgrey
+%{__install} -D -p -m 0644 %{SOURCE1} \
+ %{buildroot}%{_unitdir}/postgrey.service
+
+# Sysconfig
+%{__install} -D -p -m 0644 %{SOURCE3} \
+ %{buildroot}%{_sysconfdir}/sysconfig/postgrey
# Man page
%{__install} -D -p -m 0644 postgrey.8 \
@@ -84,24 +92,48 @@ echo "# Clients that should not be greylisted. See postgrey(8)." \
-M -r postgrey &>/dev/null || :
%post
-/sbin/chkconfig --add postgrey
+#/sbin/chkconfig --add postgrey
+if [ $1 -eq 1 ] ; then
+ # Initial installation
+ /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+fi
%preun
-if [ $1 -eq 0 ]; then
- /sbin/service postgrey stop &>/dev/null || :
- /sbin/chkconfig --del postgrey
+#if [ $1 -eq 0 ]; then
+# /sbin/service postgrey stop &>/dev/null || :
+# /sbin/chkconfig --del postgrey
+#fi
+if [ $1 -eq 0 ] ; then
+ # Package removal, not upgrade
+ /bin/systemctl --no-reload disable postgrey.service > /dev/null 2>&1 || :
+ /bin/systemctl stop postgrey.service > /dev/null 2>&1 || :
fi
%postun
-if [ $1 -ge 1 ]; then
- /sbin/service postgrey condrestart &>/dev/null || :
+#if [ $1 -ge 1 ]; then
+# /sbin/service postgrey condrestart &>/dev/null || :
+#fi
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+if [ $1 -ge 1 ] ; then
+ # Package upgrade, not uninstall
+ /bin/systemctl try-restart postgrey.service >/dev/null 2>&1 || :
fi
+%triggerun -- postgrey < 1.34-3
+# Save the current service runlevel info
+# User must manually run systemd-sysv-convert --apply postgrey
+# to migrate them to systemd targets
+/usr/bin/systemd-sysv-convert --save postgrey >/dev/null 2>&1 ||:
+
+# Run these because the SysV package being removed won't do them
+/sbin/chkconfig --del postgrey >/dev/null 2>&1 || :
+/bin/systemctl try-restart postgrey.service >/dev/null 2>&1 || :
%files
%defattr(-,root,root,-)
%doc Changes COPYING README README-rpm
-%{_sysconfdir}/rc.d/init.d/postgrey
+%{_unitdir}/postgrey.service
+%{_sysconfdir}/sysconfig/postgrey
%config(noreplace) %{confdir}/postgrey_whitelist_clients
%config(noreplace) %{confdir}/postgrey_whitelist_recipients
%config(noreplace) %{confdir}/postgrey_whitelist_clients.local
@@ -112,6 +144,9 @@ fi
%changelog
+* Tue Mar 20 2012 Jon Ciesla <limburgher@gmail.com> - 1.34-3
+- Migrate to systemd, BZ 714430.
+
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.34-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
diff --git a/postgrey.sysconfig b/postgrey.sysconfig
new file mode 100644
index 0000000..f735afd
--- /dev/null
+++ b/postgrey.sysconfig
@@ -0,0 +1 @@
+POSTGREY_OPTS="--delay=60"
reply other threads:[~2026-11-30 12:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179604319634.1.6160884634192015668.rpms-postgrey-497f8ed26b3c@fedoraproject.org \
--to=limburgher@gmail.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox