#!/bin/sh -e ### BEGIN INIT INFO # Provides: inn2 # Required-Start: $local_fs $remote_fs $syslog # Required-Stop: $local_fs $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: INN news server # Description: The InterNetNews news server. ### END INIT INFO # # Start/stop the news server. # test -f /usr/lib/news/bin/rc.news || exit 0 start () { if [ ! -d /var/run/news ]; then mkdir -p /var/run/news chown news:news /var/run/news chmod 775 /var/run/news fi su news -c /usr/lib/news/bin/rc.news > /var/log/news/rc.news 2>&1 # su news -c '/usr/lib/news/bin/nnrpd -D -c /etc/news/readers-ssl.conf -p 563 -S' } stop () { su news -c '/usr/lib/news/bin/rc.news stop' >> /var/log/news/rc.news 2>&1 # start-stop-daemon --stop --name nnrpd --quiet --oknodo } case "$1" in start) echo -n "Starting news server: " start echo "done." ;; stop) echo -n "Stopping news server: " stop echo "done." ;; reload|force-reload) echo -n "Reloading most INN configuration files: " ctlinnd -t 20 reload '' /etc/init.d/inn2 ;; restart) echo -n "Restarting innd: " if [ -f /var/run/news/innd.pid ]; then ctlinnd -t 20 throttle "init script" > /dev/null || true ctlinnd -t 20 xexec inndstart > /dev/null || start else start fi echo "done." ;; *) echo "Usage: /etc/init.d/inn start|stop|restart|reload">&2 exit 1 ;; esac exit 0