Magellan Linux

Annotation of /trunk/initscripts/sysvinit/rc/sendsignals

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1889 - (hide annotations) (download)
Wed Aug 22 17:53:50 2012 UTC (11 years, 8 months ago) by niro
File size: 1052 byte(s)
-added sendsignals to busybox too and use IGNORED_PROCS variable to be able to ignore some processes
1 niro 2 #!/bin/bash
2 niro 931 # $Id$
3 niro 2
4     #%rlevels: 0:k 6:k
5     #%start:
6     #%stop: 50
7    
8     #deps
9     #%needs:
10     #%before:
11     #%after:
12    
13 niro 781 source /etc/conf.d/rc
14     source ${rc_functions}
15 niro 2
16 niro 1889 [[ -e /etc/conf.d/sendsignals ]] && source /etc/conf.d/sendsignals
17    
18     opts=""
19     if [[ -n ${IGNORED_PROCS} ]]
20     then
21     for proc in ${IGNORED_PROCS}
22     do
23     pids=$(pidof ${proc})
24     if [[ -n ${pids} ]]
25     then
26     for id in ${pids}
27     do
28     opts="${opts} -o ${id}"
29     done
30     fi
31     done
32     fi
33    
34 niro 1249 rc_print "Sending all processes the TERM signal ..."
35 niro 1889 killall5 -15 ${opts}
36 niro 2 error_value=$?
37    
38     #
39     # Sleep for a while to allow processes to receive and process the TERM
40     # signal. The heavier your system is loaded, the higher it should sleep
41     # here.
42     #
43    
44     sleep 3
45    
46     if [ "$error_value" = 0 ]
47     then
48     print_status success
49     else
50     print_status failure
51     fi
52    
53 niro 1249 rc_print "Sending all processes the KILL signal ..."
54 niro 1889 killall5 -9 ${opts}
55 niro 2 error_value=$?
56    
57     #
58     # Increase sleep amount on heavier loaded systems.
59     #
60    
61     sleep 3
62    
63     if [ "$error_value" = 0 ]
64     then
65     print_status success
66     else
67     print_status failure
68     fi
69    
70     update_svcstatus $1
71     splash svc_stopped "$(basename $0)" 0

Properties

Name Value
svn:executable *