Article View: news.software.nntp
Article #8020Re: Integrating INN into Solaris startup (repost)
From: Todd D. Taft
Date: Tue, 28 May 1996 00:00
Date: Tue, 28 May 1996 00:00
76 lines
3813 bytes
3813 bytes
In article <Pine.GSO.3.93.960525104224.20027A-100000@qsihome0.qsi.com>,
David M. Gursky <ddg@qsi.com> wrote:
>Now integrating INN into the startup of our old server was easy (primarily
>because on SunOS 4.1.x, there is the rc.local script that you can modify
>to your hearts content.) Now on Solaris 2, there is ths large collection
>of state based rc files, and I have no idea what is the accepted practice
>for calling rc.news from this suite of files in /etc. Any insight will be
>appreciated.
Our solaris news server normally runs at init level 3 (You will probably be
the same, though you may run at levels 2 or 4. Look for the line default
line in /etc/inittab). So, I have the script that starts and stops news
located in /etc/init.d/news. I have it hard links to this file named:
/etc/rc0.d/K30news, /etc/rc2.d/K30news, and /etc/rc3.d/S99news. I don't
think that we made any major changes to the default startup/shutdown scripts
before adding in news, so these script names would probably put everything
in the right place. Basically, what this does is it will start up your
news when you go into a normal multi-user level, and it will stop your
news server when you want to shutdown the system or go into single user mode.
My script looks like this: (Apologies in advance for blasphemizing solaris
with the IBM-ese term subsystem, which it really isn't technically)
#
# Copyright (c) 1996, by UNC
#
#ident "@(#)inn 1.4unoff4 96/06/10 TDT"
# Need the commands echo, ps, awk, kill, sleep (Need ucb version of echo)
#PATH=${PATH}${PATH:+:}/sbin:/bin:/usr/bin
PATH=/usr/ucb:/sbin:/bin:/usr/bin
killproc() { # kill the named process(es)
awkfield2='$2'
pid=`/usr/bin/ps -ef | awk "/$1/ && ! /awk/ {print $awkfield2}"`
[ "$pid" != "" ] && kill -KILL $pid
}
case "$1" in
'start')
if [ -f /newslib/etc/rc.news ]; then
echo "Starting INN Subsystem..."
su uncnews -c /newslib/etc/rc.news # 1>/dev/console 2>&1
echo "Done starting INN Subsystem"
fi
;;
'stop')
inndrunning=`/usr/bin/ps -ef | awk '/inn/ && ! /awk/'`
if [ "${inndrunning}" != "" ]; then
echo "Halting INN Subsystem..."
echo -n "Throttling inn..."
/newslib/bin/ctlinnd throttle "System halt"
sleep 5
echo -n "Shutting down inn..."
/newslib/bin/ctlinnd shutdown "System halt" && echo "halted"
sleep 5
echo -n "Killing innwatch..."
#This will also kill innd if it's still running
killproc inn && echo "killed"
echo -n "Killing nnrpd..."
killproc nnrpd && echo "killed"
echo "Done halting INN Subsystem"
fi
;;
*)
echo "Usage: /etc/init.d/news { start | stop }"
;;
esac
exit 0
--
Todd D. Taft taft@cs.unc.edu
WWW: http://www.cs.unc.edu/~taft/ todd_taft@unc.edu
U.N.C. Department of Computer Science Facilities Staff
Technical Details
Message-ID:
<4ofeg5$5qa@fovea.cs.unc.edu>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<Pine.GSO.3.93.960525104224.20027A-100000@qsihome0.qsi.com>Show Full Headers
Complete Article Headers
Message-ID: <4ofeg5$5qa@fovea.cs.unc.edu> Subject: Re: Integrating INN into Solaris startup (repost) Date: Tue, 28 May 1996 00:00:00 +0000 From: taft@cs.unc.edu (Todd D. Taft) References: <Pine.GSO.3.93.960525104224.20027A-100000@qsihome0.qsi.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 157194741 Organization: The University of North Carolina at Chapel Hill Keywords: inn, solaris, boot Newsgroups: news.software.nntp