INN commit: trunk/scripts (rc.news.in)

INN Commit rra at isc.org
Mon Jan 11 21:31:55 UTC 2021


    Date: Monday, January 11, 2021 @ 13:31:55
  Author: iulius
Revision: 10504

rc.news:  start innd last when using systemd

innd must be started last with exec to keep the same PID of this script.

Patch from Marco d'Itri.

Modified:
  trunk/scripts/rc.news.in

------------+
 rc.news.in |   16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

Modified: rc.news.in
===================================================================
--- rc.news.in	2021-01-07 10:57:47 UTC (rev 10503)
+++ rc.news.in	2021-01-11 21:31:55 UTC (rev 10504)
@@ -181,8 +181,12 @@
 esac
 
 ##  Start the show.
-echo 'Starting innd.'
-eval ${WHAT} ${RFLAG} ${INNFLAGS}
+##  When using systemd, the daemon must be started last with exec to keep
+##  the same PID of this script.
+if [ "x$NOTIFY_SOCKET" = "x" ] && [ "x$LISTEN_PID" = "x" ]; then
+    echo 'Starting innd.'
+    eval ${WHAT} ${RFLAG} ${INNFLAGS}
+fi
 
 # Gee, looks like lisp, doesn't it?
 ${DOINNWATCH} && {
@@ -197,7 +201,7 @@
 
 RMFILE=${MOST_LOGS}/expire.rm
 for F in ${RMFILE} ${RMFILE}.*; do
-    if [ -f $F -a -s $F ] ; then
+    if [ -f $F ] && [ -s $F ]; then
 	echo "Removing articles from pre-downtime expire run (${F})."
 	(
 	    echo 'System shut down during expire.' \
@@ -212,3 +216,9 @@
 if [ -f ${PATHBIN}/rc.news.local ] ; then
     ${PATHBIN}/rc.news.local start
 fi
+
+##  Start innd last when using systemd.
+if [ "x$NOTIFY_SOCKET" != "x" ] || [ "x$LISTEN_PID" != "x" ]; then
+    echo 'Starting innd.'
+    eval exec ${WHAT} -f ${RFLAG} ${INNFLAGS}
+fi



More information about the inn-committers mailing list