/etc/rc*.d/K05st.exmple not executed when the system is shut down

Olt, Joseph jolt at ti.com
Wed Jun 15 18:48:02 UTC 2011


Jingchen,

The K* script is needed for changing run levels too.  If a daemon should run in level 3 and 5, but not 1 and 2, if there is no kill script, it will not be killed if you "init 2" for instance.  It also won't run the kill script if there is not a lock file.

Regards,

Joseph



-----Original Message-----
From: redhat-sysadmin-list-bounces at redhat.com [mailto:redhat-sysadmin-list-bounces at redhat.com] On Behalf Of Zhou, Jingchen
Sent: Wednesday, June 15, 2011 2:31 PM
To: redhat-sysadmin-list at redhat.com
Subject: RE: /etc/rc*.d/K05st.exmple not executed when the system is shut down

Thanks again. Yes, I see /etc/init.d/killall. My question is that if the daemon shutdown is all handled by killall, why do we install K* in /etc/rc*.d and what is /etc/rc*.d/K* for?

-----Original Message-----
From: redhat-sysadmin-list-bounces at redhat.com [mailto:redhat-sysadmin-list-bounces at redhat.com] On Behalf Of Barry Brimer
Sent: Tuesday, June 14, 2011 8:14 PM
To: redhat-sysadmin-list at redhat.com
Subject: RE: /etc/rc*.d/K05st.exmple not executed when the system is shut down

I don't have any manual that describes this, but it is clearly done in 
every Red Hat-provided service script .. and reading /etc/init.d/killall 
reinforces that.

On Tue, 14 Jun 2011, Zhou, Jingchen wrote:

> Thank you very much for your nice response.
>
> Is this really a standard practice to create a startup for a daemon so that the daemon can be shut down when the system is shut down? Can you please point me to any manual or doc that describes this step?
>
> I was thinking that by adding  K05st.example to  /etc/rc6.d e.g. would automatically take care of the daemon shutdown.
>
> Please be aware that killall gets excuted after K* in /etc/rc6.d:
>
> [root at lcls-srv20 init.d]# ls -all /etc/rc6.d/S00killall
> lrwxrwxrwx  1 root root 17 Mar  3 13:04 /etc/rc6.d/S00killall -> ../init.d/killall
>
> If killall is all needed, what is /etc/rc*.d/K* for?
>
> Thanks again.
> Jingchen
>
> ___________________________________
> From: redhat-sysadmin-list-bounces at redhat.com [redhat-sysadmin-list-bounces at redhat.com] On Behalf Of Barry Brimer [lists at brimer.org]
> Sent: Monday, June 13, 2011 4:17 PM
> To: redhat-sysadmin-list at redhat.com
> Subject: Re: /etc/rc*.d/K05st.exmple not executed when the system is shut down
>
> Quoting "Zhou, Jingchen" <jingchen at slac.stanford.edu>:
>
>> I have a dummy startup file st.example in /etc/init.d (see below), which has
>> been added to the system run levels as
>>
>> [root at srv]# chkconfig --list st.example
>> st.example      0:off   1:off   2:off   3:on    4:off   5:off   6:off
>>
>>  [root at srv]# ls /etc/rc*.d/*st.example /etc/rc0.d/K05st.example
>> /etc/rc3.d/S92st.example  /etc/rc6.d/K05st.example /etc/rc1.d/K05st.example
>> /etc/rc4.d/K05st.example /etc/rc2.d/K05st.example  /etc/rc5.d/K05st.example
>>
>>
>> When I shut down the system, "stop" (or K05st.example) somehow is never
>> executed (I don't see the log file in /tmp, and I don't see the shutdown
>> message in /var/log/messages after the system is back up.). "start" always
>> works as expected when the system comes up.
>>
>> Am I missing any?
>
> Your start function needs to create a lockfile called /var/lock/subsys/<name of
> service> and then your stop function needs to remove it.  The
> /etc/init.d/killall script will explain more.
>
> --
> redhat-sysadmin-list mailing list
> redhat-sysadmin-list at redhat.com
> https://www.redhat.com/mailman/listinfo/redhat-sysadmin-list
>
> --
> redhat-sysadmin-list mailing list
> redhat-sysadmin-list at redhat.com
> https://www.redhat.com/mailman/listinfo/redhat-sysadmin-list
>
> !DSPAM:4df7e25939701606819131!
>
>

--
redhat-sysadmin-list mailing list
redhat-sysadmin-list at redhat.com
https://www.redhat.com/mailman/listinfo/redhat-sysadmin-list

--
redhat-sysadmin-list mailing list
redhat-sysadmin-list at redhat.com
https://www.redhat.com/mailman/listinfo/redhat-sysadmin-list




More information about the redhat-sysadmin-list mailing list