Date: Mon, 14 Jun 1999 14:24:32 +1000 From: Eddie Irvine <eirvine@tpgi.com.au> To: Gong Wei <ccegongw@nus.edu.sg> Cc: "'freebsd-questions@freebsd.org'" <freebsd-questions@FreeBSD.ORG> Subject: Re: *BSD init scripts Message-ID: <37648400.9369A696@tpgi.com.au> References: <762388C091FAD01180FF00A024621378E8EEF8@exs01.ex.nus.edu.sg>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <ccegongw@nus.edu.sg> > Analyst Programmer > National University of Singapore > > Gong Wei > Analyst Programmer <ccegongw@nus.edu.sg> > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?37648400.9369A696>