23.6. 运行 INN

inn 软件包提供了一个脚本,适合在启动时启动 inn。该脚本通常被称为/usr/lib/news/bin/rc.news。该脚本从另一个脚本读取参数,该脚本通常被称为/usr/lib/news/innshellvars,其中包含 inn 将用来定位所需组件的文件名和文件路径的定义。通常认为最好使用非 root 用户的权限执行 inn,例如news.

为了确保 inn 在启动时启动,您应该检查/usr/lib/news/innshellvars已正确配置,然后调用/usr/lib/news/bin/rc.news在启动时执行的脚本中的脚本。

此外,还有一些必须定期执行的管理任务。这些任务通常配置为由 cron 命令执行。最好的方法是将相应的命令添加到您的/etc/crontab文件,或者更好的是,为/etc/cron.d目录创建一个合适的文件(如果您的发行版提供该目录)。这样一个文件的示例可能如下所示
# Example /etc/cron.d/inn file, as used in the Debian distribution.
#
SHELL=/bin/sh
PATH=/usr/lib/news/bin:/sbin:/bin:/usr/sbin:/usr/bin

# Expire old news and overview entries nightly, generate reports.

15 0 * * *      news    news.daily expireover lowmark delayrm

# Every hour, run an rnews -U. This is not only for UUCP sites, but
# also to process queued up articles put there by in.nnrpd in case
# innd wasn't accepting any articles.

10 * * * *      news    rnews -U

这些命令将确保每天自动过期旧新闻,并每小时处理任何排队的文章。另请注意,它们是以news用户的权限执行的。