5 ## =()<. @<_PATH_SHELLVARS>@>()=
6 . /usr/lib/news/innshellvars
8 ## Pick ${INND} or ${INNDSTART}
10 ## Set to true or false
12 MAIL="${MAILCMD} -s 'Boot-time Usenet warning on `hostname`' ${NEWSMASTER}"
14 ## RFLAG is set below; set FLAGS as appropriate.
19 if [ -f ${SERVERPID} ] ; then
20 ( echo 'INND: PID file exists -- unclean shutdown!' >/dev/console )
24 if [ ! -f ${NEWSLIB}/.news.daily ] ; then
25 echo 'No .news.daily file; need to run news.daily?' | eval ${MAIL}
27 case `find ${NEWSLIB} -name .news.daily -mtime +1 -print 2>/dev/null` in
31 echo 'Old .news.daily file; need to run news.daily?' | eval ${MAIL}
36 ## Active file recovery.
37 if [ ! -s ${ACTIVE} ] ; then
38 if [ -s ${NEWACTIVE} ] ; then
39 mv ${NEWACTIVE} ${ACTIVE}
41 if [ -s ${OLDACTIVE} ] ; then
42 cp ${OLDACTIVE} ${ACTIVE}
44 ( echo 'INND: No active file!' >/dev/console )
49 # You might want to rebuild the DBZ database, too:
50 #echo "cd ${NEWSLIB} \
52 # && mv history.n.dir history.dir \
53 # && mv history.n.pag history.pag" | su ${NEWSUSER}
56 ## Remove temporary batchfiles and lock files.
57 ( cd ${BATCH} && rm -f bch* )
58 ( cd ${LOCKS} && rm -f LOCK* )
59 ( cd ${TEMPSOCKDIR} && rm -f ${TEMPSOCK} )
60 rm -f ${NEWSCONTROL} ${NNTPCONNECT} ${SERVERPID}
63 ( echo 'Starting innd.' >/dev/console )
64 eval ${WHAT} ${RFLAG} ${FLAGS}
66 # Gee, looks like lisp, doesn't it?
68 echo "( ( sleep 60 ; ${INNWATCH} ) & )" | su ${NEWSUSER}
71 RMFILE=${MOST_LOGS}/expire.rm
72 if [ -s ${MOST_LOGS}/expire.rm ] ; then
73 ( echo "Removing articles from pre-downtime expire run." >/dev/console )
75 echo 'System shut down during expire. Unlinking articles listed in'
78 echo "${NEWSBIN}/expirerm ${RMFILE}" | su ${NEWSUSER} &