Re: [PATCH 21/48] Both rc.single and rc.shutdown use the same code to kill everything.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



First of all, sorry for not continuing the review yesterday, time is
short :(

Still, I'll finish this, as I'd like to have this applied eventually.

Am 02.07.2010 11:21, schrieb Kurt J. Bosch:
> Am 2010-06-30 23:47, schrieb Victor Lowther:
>> Move that shared code into functions.
>> ---
>>   functions   |   29 +++++++++++++++++++++++++++++
>>   rc.shutdown |   32 +-------------------------------
>>   rc.single   |   27 +--------------------------
>>   3 files changed, 31 insertions(+), 57 deletions(-)
>>
>> diff --git a/functions b/functions
>> index d8e8e54..bf6ed45 100644
>> --- a/functions
>> +++ b/functions
>> @@ -203,6 +203,35 @@ ck_status() {
>>     fi
>>   }
>>
>> +kill_everything() {
>> +    # Find daemons NOT in the DAEMONS array. Shut these down first
>> +    for daemon in /var/run/daemons/*; do
>> +        [[ -f $daemon ]] || continue
>> +        daemon=${daemon##*/}
>> +    in_array "$daemon" "${DAEMONS[@]}" || stop_daemon "$daemon"
>> +    done
>> +   
>> +    # Shutdown daemons in reverse order
>> +    for ((i=${#DAEMONS[@]}-1; i>=0; i--)); do
>> +    [[ ${DAEMONS[$i]:0:1} = '!' ]]&&  continue
>> +    ck_daemon ${DAEMONS[$i]#@} || stop_daemon ${DAEMONS[$i]#@}
>> +    done
>> +
>> +    # Terminate all processes
>> +    stat_busy "Sending SIGTERM To Processes"
>> +    run_hook single_prekillall
> 
> This line should be  run_hook "${0##*/rc.}"_prekillall  IMHO

Kurt is right here. We call this code from rc.single and rc.shutdown I
think. We use two distinct hooks, you can register functions for these
hooks independently!

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux