next up previous contents
Next: 9.14.2 メールに注意 Up: 9.14 INN 運用上の注意 Previous: 9.14 INN 運用上の注意

9.14.1 自動起ち上げと終了

以上のように設定された INN をマシン起ち上げ時に自動的に 起動するようにするには次のようなスクリプトを /etc/rc2.d/ 内に作成して下さい。

(Solaris 以外なら /etc/rc.local です)

#
# Start INN news service - Internet News Daemon (innd)
#
if [ -f /pub/usr/news/bin/rc.news ]; then
    /pub/usr/news/bin/rc.news; echo "Starting INN news service"
fi

 
 

また、INN は非常にファイルアクセスの多いプログラムです。 ですから、INN が動作している時に sync は絶対にかけないでください。 sync をかけると多くの情報が紛失してしまいます。 システムを落とすときも必ず INN を終了してからにしてください。

終了の仕方は以下の通りです。

$ /pub/usr/news/bin/ctlinnd shutdown x

あるいは以下のようなスクリプトを書いてシャットダウン時にきちんと 後始末するように /etc/rc0.d/ 内においておくのも有効だと思われます。

#!/bin/sh
PATH=/usr/bin:/usr/ucb:/usr/etc
export PATH
umask 22
cd /
if [ -f /pub/var/news/run/innwatch.pid ] ; then
    pid="`cat /pub/var/news/run/innwatch.pid`"
    # kill the innwatch shell script
    kill $pid
    pid="`ps -jae | 
    sed -e \"/^ *$pid /!d\" -e \"s/^ *$pid *//\" -e \"s/ .*//\"` "
    # then kill any child processes of innwatch
    if [ $pid ] ; then
        kill $pid
    fi
fi
if [ "`ls /pub/var/news/lib/innd`" ] ; then
    /pub/usr/news/bin/ctlinnd throttle "Preparing to shut down."
    /pub/usr/news/bin/ctlinnd readers no "Preparing to shut down."
    sleep 5
    /pub/usr/news/bin/ctlinnd shutdown "as requested."
fi | sed '/^Ok$/d'



Noriyo Kanayama