INN commit: branches/2.6/scripts (rc.news.in)

INN Commit rra at isc.org
Mon Jan 11 21:33:06 UTC 2021


    Date: Monday, January 11, 2021 @ 13:33:06
  Author: iulius
Revision: 10505

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:
  branches/2.6/scripts/rc.news.in

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

Modified: rc.news.in
===================================================================
--- rc.news.in	2021-01-11 21:31:55 UTC (rev 10504)
+++ rc.news.in	2021-01-11 21:33:06 UTC (rev 10505)
@@ -157,8 +157,12 @@
 fi
 
 ##  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} && {
@@ -173,7 +177,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.' \
@@ -188,3 +192,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