[NTLUG:Discuss] How to stop process at system shutdown
Michael Patrick
michael at techiesplace.com
Wed Feb 14 17:05:31 CST 2001
Neil,
As I understand this issue, you are looking for the green [OK] as your
machine is going down. You will not get that just using apachectl. The
status codes are written using the functions in /etc/rc.d/init.d/functions
In particular,
echo_success() {
[ "$BOOTUP" = "color" ] && $MOVE_TO_COL
echo -n "[ "
[ "$BOOTUP" = "color" ] && $SETCOLOR_SUCCESS
echo -n "OK"
[ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL
echo -n " ]"
echo -ne "\r"
return 0
}
does the [OK]. All the init-scripts I've seen use the killproc function,
which in turn calls echo_success().
Given time, I will try to test this theory this evening and let you know
what I find. I'd try it now, but I think work would frown on it.
Everyone else... if I'm on crack here, lemme know. :)
Michael
-----Original Message-----
From: Neil Aggarwal <neil at jammconsulting.com>
To: discuss at ntlug.org
Date: Wed, 14 Feb 2001 16:26:46 -0600
Subject: Re: [NTLUG:Discuss] How to stop process at system shutdown
> Greg:
>
> I did this:
> rm -f /etc/rc3.d/S85httpd
> rm -f /etc/rc0.d/K15httpd
> rm -f /etc/rc6.d/K15httpd
> ln -s /usr/local/apache/bin/apachectl /etc/rc3.d/S85httpd
> ln -s /usr/local/apache/bin/apachectl /etc/rc0.d/K15httpd
> ln -s /usr/local/apache/bin/apachectl /etc/rc6.d/K15httpd
>
> And I still dont get the httpd stopped message when I do
> /sbin/reboot
>
> Any more ideas?
>
> Thanks,
> Neil.
>
>
> "Gregory L. Camp" wrote:
> >
> > Neil,
> >
> > You shouldn't put the start/stop commands in the same rc?.d directory
> (rc3.d
> > in your example). The stop command should be in rc0.d and rc6.d
> instead.
> >
> > You enter rc0.d when you shutdown and halt (i.e. shutdown -h now),
> and rc6.d
> > when you shutdown and reboot (i.e. shutdown -r now).
> >
> > Greg
> >
> > > -----Original Message-----
> > > From: Neil Aggarwal [mailto:neil at JAMMConsulting.com]
> > > Sent: Tuesday, February 13, 2001 8:59 PM
> > > To: North Texas Linux Users Group
> > > Subject: [NTLUG:Discuss] How to stop process at system shutdown
> > >
> > >
> > > Hello:
> > >
> > > I am using RedHat 7.0.
> > >
> > > I am trying to figure out how to get apache to stop and start
> > > at system startup and shutdown.
> > >
> > > I installed apache 1.3.14 in /usr/local/apache. It has a
> > > SysV-type start and stop file in /usr/local/apache/bin/apachectl,
> > > so I added these links:
> > > ln -s /usr/local/apache/bin/apachectl /etc/rc3.d/S85httpd
> > > ln -s /usr/local/apache/bin/apachectl /etc/rc3.d/K85httpd
> > >
> > > When I start the system I see a message that apache is
> > > starting, but when I shutdown the system, I dont see a
> > > message that apache is stopping.
> > >
> > > I added an echo statement to the stop case of the apachectl file,
> > > but I dont get that message.
> > >
> > > Can someone guide me on this?
> > > I am sure it is something simple, but I dont fully understand
> > > the SysV stuff.
> > >
> > > Thanks,
> > > Neil.
> > >
> > > --
> > > Neil Aggarwal
> > > JAMM Consulting, Inc. -- (972) 612-6056,
> http://www.JAMMConsulting.com
> > > Custom Internet Development -- Java, JSP, servlets, databases
> > > _______________________________________________
> > > http://ntlug.org/mailman/listinfo/discuss
> > >
> > _______________________________________________
> > http://ntlug.org/mailman/listinfo/discuss
>
> --
> Neil Aggarwal
> JAMM Consulting, Inc. -- (972) 612-6056, http://www.JAMMConsulting.com
> Custom Internet Development -- Java, JSP, servlets, databases
> _______________________________________________
> http://ntlug.org/mailman/listinfo/discuss
More information about the Discuss
mailing list