🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #44147

Re: INN start script on Solaris

#44147
From: Tim Pennick
Date: Thu, 17 Feb 2000 00:00
45 lines
2332 bytes
>
>   From: Jeremy <bofh@netscum.dk>
>Clean shutdown would be good.  I use:
>
>#!/bin/sh
>
>case $1 in
>'start')
>    if [ -f /usr/local/news/bin/rc.news ]; then
>        su news -c /usr/local/news/bin/rc.news
>    fi
>    ;;
>'stop')
>    if [ -f /usr/local/news/run/innd.pid ]; then
>        /usr/local/news/bin/ctlinnd throttle 'system going down'
>        sleep 1
>        /usr/local/news/bin/ctlinnd shutdown 'system going down'
>    fi
>    ;;
>*)
>    echo "usage: /etc/init.d/innd {start|stop}"
>    ;;
>esac

I struggled a bit to work out the best way to get my version of this script
(almost exactly the same) to run before anything else was shutdown (to kill
it), and after everything else had started up (to start it).  In Solaris, you
put the script in /etc/init.d, and put links in /etc/rc*.d (appologies if I'm
teaching my grandmother to suck eggs but I've started so I'll finish).  The
names of the links in the rc... directories are significant, and are of the
form Knnn<filename> or Snnn<filename>, where nnn is a number implementing the
order in which the files in the directory should be run, and S, or K, indicate
whether the script should be used to Start or Kill the service.  The Start
link for starting INN seems to work OK as the last service to start in rc2.d,
though I'm not sure it wouldn't be better in rc3.d.

When you shutdown or reboot Solaris, it transitions through (or to) run level
0.  Therefore I put the Kill link as more or less the first thing to happen in
rc0.d and this seems to do the trick.

Hope this helps

Tim Pennick

Technical Details
Message-ID: <88gpu3$nmk$1@pheidippides.axion.bt.co.uk>
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
References: <950723917.521338@news.netscum.dk>

Show Full Headers
Complete Article Headers
Message-ID: <88gpu3$nmk$1@pheidippides.axion.bt.co.uk>
Subject: Re: INN start script on Solaris
Date: Thu, 17 Feb 2000 00:00:00 +0000
From: Tim Pennick <tpennick@axion.bt.co.uk>
References: <950723917.521338@news.netscum.dk>
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: 586898869
X-Complaints-To: postmaster@axion.bt.co.uk
X-Trace: pheidippides.axion.bt.co.uk 950790915 24276 132.146.88.22 (17 Feb 2000 12:35:15 GMT)
Organization: BT
NNTP-Posting-Date: 17 Feb 2000 12:35:15 GMT
Newsgroups: news.software.nntp