public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jochen Schmitt <Jochen@herr-schmitt.de>
To: git-commits@fedoraproject.org
Subject: [rpms/inn] epel10.3: Initial migration to native systemd support
Date: Wed, 26 Aug 2026 08:54:13 GMT [thread overview]
Message-ID: <178773445318.1.2814693796533450751.rpms-inn-af00a92f6218@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/inn
Branch : epel10.3
Commit : af00a92f62188805ceefd289d445e78d6ff9bb6f
Author : Jochen Schmitt <Jochen@herr-schmitt.de>
Date : 2011-06-26T21:44:46+02:00
Stats : +54/-160 in 5 file(s)
URL : https://src.fedoraproject.org/rpms/inn/c/af00a92f62188805ceefd289d445e78d6ff9bb6f?branch=epel10.3
Log:
Initial migration to native systemd support
---
diff --git a/inn.spec b/inn.spec
index 9ad018d..8645f45 100644
--- a/inn.spec
+++ b/inn.spec
@@ -1,7 +1,7 @@
Summary: The InterNetNews system, an Usenet news server
Name: inn
Version: 2.5.2
-Release: 8%{?dist}
+Release: 9%{?dist}
#see LICENSE file for details
License: GPLv2+ and BSD and MIT and Public Domain
Group: System Environment/Daemons
@@ -11,8 +11,11 @@ Source2: inn-default-distributions
Source4: inn-cron-expire
Source5: inn-cron-rnews
Source7: inn-cron-nntpsend
-Source8: innd.init
Source10: inn-faq.tar.gz
+Source20: innd.service
+Source21: prepare-innd
+Source22: start-innd
+Source23: stop-innd
Patch1: inn-2.4.3.rh.patch
Patch4: inn-2.5.1.pie.patch
Patch6: inn-2.5.2.posix.patch
@@ -27,12 +30,14 @@ patch17: inn-2.5.2-pconf.patch
Patch18: inn-2.5.2-smp.patch
Patch19: inn-2.5.2-docrun.patch
BuildRequires: python db4-devel byacc krb5-devel pam-devel e2fsprogs-devel perl
-BuildRequires: perl(ExtUtils::Embed) flex
+BuildRequires: perl(ExtUtils::Embed) flex systemd-units
Requires(pre): shadow-utils
-Requires: chkconfig, grep, coreutils, sed
+Requires: grep, coreutils, sed
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Requires: bash >= 2.0
-Requires(post): inews
+Requires(post): systemd-units inews
+Requires(preun): systemd-units
+Requires(postun): systemd-units
# XXX white out bogus perl requirement for now
Provides: perl(::usr/lib/innshellvars.pl) = %{version}-%{release}
@@ -170,8 +175,13 @@ install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/inn-cron-expire
install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly/inn-cron-rnews
install %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly/inn-cron-nntpsend
-mkdir -p $RPM_BUILD_ROOT%{_initrddir}
-install %{SOURCE8} $RPM_BUILD_ROOT%{_initrddir}/innd
+mkdir -p $RPM_BUILD_ROOT%{_unitdir}
+install -p -m 0644 %{SOURCE20} $RPM_BUILD_ROOT%{_unitdir}
+
+install -p -m 0644 %{SOURCE21} $RPM_BUILD_ROOT/lib/systemd/
+install -p -m 0644 %{SOURCE22} $RPM_BUILD_ROOT/lib/systemd/
+install -p -m 0644 %{SOURCE23} $RPM_BUILD_ROOT/lib/systemd/
+
tar xf %{SOURCE10}
mv inn.html FAQ.html
@@ -207,8 +217,6 @@ rm -rf $RPM_BUILD_ROOT/usr/doc/
rm -rf $RPM_BUILD_ROOT
%post
-/sbin/chkconfig --add innd
-#su -m news -c '/usr/lib/news/bin/makehistory'
su -m news -c '/usr/libexec/news/makedbz -i -o'
umask 002
@@ -217,10 +225,11 @@ touch /var/log/news/news.crit
touch /var/log/news/news.err
chown -R news:news /var/log/news*
-%post libs -p /sbin/ldconfig
+if [ $1 -eq 1 ]; then
+ /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+fi
-%triggerpostun -- inn < 2.3.0
-service innd stop > /dev/null 2>&1
+%post libs -p /sbin/ldconfig
%triggerin -- rsyslog
if [ -f /etc/rsyslog.conf ]; then
@@ -272,8 +281,8 @@ fi
%preun
if [ $1 = 0 ]; then
- service innd stop > /dev/null 2>&1
- /sbin/chkconfig --del innd
+ /bin/systemctl disable innd.service >/dev/null 2>&1 || :
+ /bin/systemctl stop innd.service >/dev/null 2>&1 || :
if [ -f /var/lib/news/history.dir ]; then
rm -f /var/lib/news/history.*
fi
@@ -281,7 +290,7 @@ fi
%postun
if [ "$1" -ge 1 ]; then
- service innd condrestart > /dev/null 2>&1
+ /bin/systemctl try-restart innd.service >/dev/null 2>&1 || :
fi
%postun libs -p /sbin/ldconfig
@@ -291,11 +300,13 @@ fi
%{_bindir}/rnews
%defattr(0755,root,root,-)
# /etc config files plus cron config
-%{_initrddir}/innd
%{_sysconfdir}/cron.hourly/inn-cron-rnews
%{_sysconfdir}/cron.hourly/inn-cron-nntpsend
%{_sysconfdir}/cron.daily/inn-cron-expire
-
+%{_unitdir}/innd.service
+/lib/systemd/prepare-innd
+/lib/systemd/start-innd
+/lib/systemd/stop-innd
%defattr(-,news,news,-)
# /etc/news config files
%dir %{_sysconfdir}/news
@@ -517,6 +528,9 @@ fi
%{_mandir}/man1/inews*
%changelog
+* Sun Jun 26 2011 Jochen Schmitt <Jochen herr-schmitt de> - 2.5.2-9
+- Initial migration to native systemd support
+
* Fri Jun 17 2011 Marcela Mašláňová <mmaslano@redhat.com> - 2.5.2-8
- Perl mass rebuild
diff --git a/innd.init b/innd.init
deleted file mode 100644
index ab8ba51..0000000
--- a/innd.init
+++ /dev/null
@@ -1,143 +0,0 @@
-#!/bin/bash
-#
-# innd InterNet News System
-#
-# chkconfig: - 95 05
-# description: inn is the most popular server for Usenet news. It allows \
-# you to setup local news servers. It can be difficult to \
-# set up properly though, so be sure to read /usr/share/doc/inn* \
-# before trying.
-# processname: innd
-# pidfile: /run/news/innd.pid
-
-### BEGIN INIT INFO
-# Provides: innd
-# Required-Start: $network
-# Short-Description: InterNet News System
-# Description: inn is the most popular server for Usenet news. It allows \
-# you to setup local news servers. It can be difficult to \
-# set up properly though, so be sure to read /usr/share/doc/inn* \
-# before trying.
-### END INIT INFO
-
-# Source function library.
-. /etc/init.d/functions
-
-# Get config.
-. /etc/sysconfig/network
-
-RETVAL=0
-
-[ -d /etc/news ] || exit 1
-[ -f /etc/news/inn.conf ] || exit 6
-. /usr/libexec/news/innshellvars || exit 1
-
-start() {
- # Check that networking is up.
- [ "${NETWORKING}" = "no" ] && exit 1
- [ -d "$SPOOLDIR" ] || exit 1
- [ -f "$HISTORY" -a -f "$HISTORY.hash" ] || {
- echo $"Please run makehistory and/or makedbz before starting innd." >&2
- exit 1
- }
- echo -n $"Starting INND system: "
- # INN uses too many un-checked shell scripts
- unset LANG
- unset LC_COLLATE
- # create /run/news in tmpfs
- mkdir -p /run/news
- chown news:news /run/news
- daemon --user news /usr/libexec/news/rc.news
- RETVAL=$?
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/innd
- echo
-}
-
-stop() {
- if [ -f /run/news/innd.pid ]; then
- echo -n $"Stopping INND service (gently): "
- if "${NEWSBIN}/ctlinnd" -s -t 60 throttle shutting down &&
- sleep 30 &&
- "${NEWSBIN}/ctlinnd" -s -t 60 shutdown shutting down; then
- success $"innd shutdown"
- else
- failure $"innd shutdown"
- echo -n $"Stopping INND service (the hard way): "
- killproc innd
- fi
- else
- if ps -U news | grep innd > /dev/null; then
- echo $"Stopping INND service (PID not found, the hard way): "
- killproc innd
- fi
- RETVAL=$?
- [ $RETVAL -eq 0 ] && rm -f /run/news/innd.pid
- echo
- fi
- if [ -f /run/news/innwatch.pid ]; then
- echo -n $"Stopping INNWatch service: "
- killproc innwatch -9
- RETVAL=$?
- [ $RETVAL -eq 0 ] && rm -f /run/news/innwatch.pid
- echo
- fi
- if [ -f /run/news/innfeed.pid ]; then
- echo -n $"Stopping INNFeed service: "
- killproc innfeed -9
- RETVAL=$?
- [ $RETVAL -eq 0 ] && rm -f /run/news/innfeed.pid
- echo
- fi
- if [ -f /run/news/actived.pid ]; then
- echo -n $"Stopping INN actived service: "
- killproc actived -9
- RETVAL=$?
- [ $RETVAL -eq 0 ] && rm -f /run/news/actived.pid
- echo
- fi
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/innd /var/lock/news/*
-}
-
-reload() {
- echo -n $"Reloading INN Service: "
- killproc innd -HUP
- RETVAL=$?
-}
-
-restart() {
- stop
- start
-}
-
-# See how we were called.
-case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- status)
- status innd
- RETVAL=$?
- ;;
- reload)
- #XXX fixme, not working
- #reload
- restart
- ;;
- restart)
- restart
- ;;
- condrestart)
- if [ -f /var/lock/subsys/innd ]; then
- restart
- fi
- ;;
- *)
- echo $"Usage: $0 {start|stop|status|restart|condrestart}"
- exit 3
- ;;
-esac
-
-exit $RETVAL
diff --git a/prepare-innd b/prepare-innd
new file mode 100644
index 0000000..c3a97c0
--- /dev/null
+++ b/prepare-innd
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+mkdir -p /run/news
+chown news:news /run/news
diff --git a/start-innd b/start-innd
new file mode 100644
index 0000000..7e36f9b
--- /dev/null
+++ b/start-innd
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+. /usr/libexec/news/innshellvars
+
+unset LANG
+unset Lc_COLLATE
+
+runuser -s /bin/bash news /usr/libexec/news/rc.news
+
diff --git a/stop-innd b/stop-innd
new file mode 100644
index 0000000..087ba09
--- /dev/null
+++ b/stop-innd
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+. /usr/libexec/news/innshellvars
+
+if [ -f /run/news/innd.pid ]; then
+ "${NEWSBIN}/ctlinnd" -s -t 60 throttle shutting down
+ sleep 30
+ "${NEWSBIN}/ctlinnd" -s -t 60 shutdown shutting down
+fi
+
\ No newline at end of file
reply other threads:[~2026-08-26 8:54 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=178773445318.1.2814693796533450751.rpms-inn-af00a92f6218@fedoraproject.org \
--to=jochen@herr-schmitt.de \
--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