From owner-freebsd-questions Sun Jun 13 22: 4:40 1999 Delivered-To: freebsd-questions@freebsd.org Received: from buffy.tpgi.com.au (buffy.tpgi.com.au [203.12.160.34]) by hub.freebsd.org (Postfix) with ESMTP id 0CB9E14DB6 for ; Sun, 13 Jun 1999 22:04:23 -0700 (PDT) (envelope-from eirvine@tpgi.com.au) Received: (from smtpd@localhost) by buffy.tpgi.com.au (8.8.7/8.8.7) id OAA24854; Mon, 14 Jun 1999 14:27:17 +1000 Received: from tar-56k-197.tpgi.com.au(203.26.26.197), claiming to be "tpgi.com.au" via SMTP by buffy.tpgi.com.au, id smtpda24790; Mon Jun 14 14:27:08 1999 Message-ID: <37648400.9369A696@tpgi.com.au> Date: Mon, 14 Jun 1999 14:24:32 +1000 From: Eddie Irvine X-Mailer: Mozilla 4.03 [en] (Win95; I) MIME-Version: 1.0 To: Gong Wei Cc: "'freebsd-questions@freebsd.org'" Subject: Re: *BSD init scripts References: <762388C091FAD01180FF00A024621378E8EEF8@exs01.ex.nus.edu.sg> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi. Take a look at some of the scripts already there. You'll see that most of them accept the paramemeters "start" and "stop". That is, on startup your script will get called like this: sh# abc.sh start And on shutdown, your script will get called like this: sh# abc.sh stop So, your script catches the "start" or "stop" and acts accordingly. If no parameter is given, it should default to "start" Gong Wei wrote: > > Hi, > > I have a special requirement for starting and shutting down a particular > daemon. For starting up no problem, I can create a file abc.sh in > /usr/local/etc/rc.d. But what about shutting down the daemon? It cannot be > simply killed by -15 or -9. Some custom action must be taken place before > the daemon got killed. > > Is there any way to achieve this? I tried to put in some instructions in > /etc/rc.shutdown, but it seems that this script (rc.shutdown) didn't get > called at all if I use reboot/shutdown -r now/shutdown -h now/halt to stop > the system. > > However, if I press Ctl-Alt-Del this script did get called. > > I am using Release 3.2 on Intel platform, if this matters. > > ------------------------------------------------------------------------ > > Gong Wei > Analyst Programmer > National University of Singapore > > Gong Wei > Analyst Programmer > National University of Singapore > Computer Centre National University of Singapore 2 Engineering Dive 4;Singapore;;117584;Singapore Work Voice: +65 8746421 > Voice Pager: +65 94963742 > Work Fax: +65 7780198 > Additional Information: > Version 2.1 > Last Name Wei > First NameGong > Label WorkComputer Centre National University of Singapore 2 Engineering Drie 4 Singapore, 117584 Singapore > Revision 19990518T103531Z -- Eddie http://www1.tpgi.com.au/users/eirvine/index.html ________________________________________________ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message