INN commit: branches/2.5/contrib (sample.init.script)

INN Commit rra at isc.org
Wed Aug 10 20:07:03 UTC 2011


    Date: Wednesday, August 10, 2011 @ 13:07:02
  Author: iulius
Revision: 9338

improve the sample init script

Based on the Debian package. (Current maintainer: Marco d'Itri.)

Modified:
  branches/2.5/contrib/sample.init.script

--------------------+
 sample.init.script |   47 ++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 42 insertions(+), 5 deletions(-)

Modified: sample.init.script
===================================================================
--- sample.init.script	2011-08-10 20:06:01 UTC (rev 9337)
+++ sample.init.script	2011-08-10 20:07:02 UTC (rev 9338)
@@ -1,20 +1,57 @@
-#!/sbin/sh
+#! /bin/sh
 
+# $Id$
+#
 # This is a simple, bare-bones example of a SysV-style init.d script for INN.
 # It tries to increase the file descriptor limits to the maximum allowed by
 # the system since INN and related programs can be file descriptor hogs.
 
-case $1 in
+test -f '<pathbin>/rc.news' || exit 0
 
+start () {
+    ulimit -n unlimited
+    # Start INN.
+    su news -c '<pathbin>/rc.news' >> <pathlog>/rc.news 2>&1
+    # Start another nnrpd daemon, handling initial TLS connections, on port 563.
+    # (The preferred way would be to use port 119 and STARTTLS but not all news
+    # readers support it yet.)
+    #su news -c '<pathbin>/nnrpd -D -p 563 -S' >> <pathlog>/rc.news 2>&1
+}
+
+case "$1" in
+
 start)
-    ulimit -n unlimited
-    su news -c /usr/local/news/bin/rc.news
+    start
     ;;
 
 stop)
-    su news -c '/usr/local/news/bin/rc.news stop'
+    # Stop INN.
+    su news -c '<pathbin>/rc.news stop' >> <pathlog>/rc.news 2>&1
+    # Stop possible other nnrpd daemons.  One of the two following commands is enough.
+    #start-stop-daemon --stop --name nnrpd --quiet --oknodo
+    #su news -c 'killall nnrpd' >> <pathlog>/rc.news 2>&1
     ;;
 
+reload|force-reload)
+    # Reload INN.
+    <pathbin>/ctlinnd -t 20 reload '' 'reload asked'
+    ;;
+
+restart)
+    # Restart INN.
+    if [ -f '<pathrun>/innd.pid' ]; then
+        <pathbin>/ctlinnd -t 20 throttle 'restart asked' > /dev/null || true
+        <pathbin>/ctlinnd -t 20 xexec innd > /dev/null || start
+    else
+        start
+    fi
+    ;;
+
+*)
+    echo "Recognized arguments:  start|stop|reload|force-reload|restart" >&2
+    exit 1
+    ;;
+
 esac
 
 exit 0




More information about the inn-committers mailing list