source:
bootscripts/lfs/init.d/sendsignals@
16cd0963
Last change on this file since 16cd0963 was 6a11766, checked in by , 3 years ago | |
---|---|
|
|
File size: 1.5 KB |
Rev | Line | |
---|---|---|
[1c48007] | 1 | #!/bin/sh |
2 | ######################################################################## | |
[0cda898] | 3 | # Begin sendsignals |
[1c48007] | 4 | # |
5 | # Description : Sendsignals Script | |
6 | # | |
7 | # Authors : Gerard Beekmans - gerard@linuxfromscratch.org | |
[f874424] | 8 | # DJ Lucas - dj@linuxfromscratch.org |
[0cda898] | 9 | # Update : Bruce Dubbs - bdubbs@linuxfromscratch.org |
[1c48007] | 10 | # |
[0cda898] | 11 | # Version : LFS 7.0 |
[1c48007] | 12 | # |
13 | ######################################################################## | |
14 | ||
[0cda898] | 15 | ### BEGIN INIT INFO |
16 | # Provides: sendsignals | |
17 | # Required-Start: | |
18 | # Should-Start: | |
19 | # Required-Stop: $local_fs swap localnet | |
20 | # Should-Stop: | |
21 | # Default-Start: | |
22 | # Default-Stop: 0 6 | |
23 | # Short-Description: Attempts to kill remaining processes. | |
24 | # Description: Attempts to kill remaining processes. | |
25 | # X-LFS-Provided-By: LFS | |
26 | ### END INIT INFO | |
27 | ||
[f874424] | 28 | . /lib/lsb/init-functions |
[1c48007] | 29 | |
30 | case "${1}" in | |
[0cda898] | 31 | stop) |
[6a11766] | 32 | omit=$(pidof mdmon) |
33 | [ -n "$omit" ] && omit="-o $omit" | |
34 | ||
[f874424] | 35 | log_info_msg "Sending all processes the TERM signal..." |
[6a11766] | 36 | killall5 -15 $omit |
[0cda898] | 37 | error_value=${?} |
[1c48007] | 38 | |
[0cda898] | 39 | sleep ${KILLDELAY} |
[1c48007] | 40 | |
[0cda898] | 41 | if [ "${error_value}" = 0 -o "${error_value}" = 2 ]; then |
[f874424] | 42 | log_success_msg |
[0cda898] | 43 | else |
[f874424] | 44 | log_failure_msg |
[0cda898] | 45 | fi |
[1c48007] | 46 | |
[f874424] | 47 | log_info_msg "Sending all processes the KILL signal..." |
[6a11766] | 48 | killall5 -9 $omit |
[0cda898] | 49 | error_value=${?} |
[1c48007] | 50 | |
[0cda898] | 51 | sleep ${KILLDELAY} |
[1c48007] | 52 | |
[0cda898] | 53 | if [ "${error_value}" = 0 -o "${error_value}" = 2 ]; then |
[f874424] | 54 | log_success_msg |
[0cda898] | 55 | else |
[f874424] | 56 | log_failure_msg |
[0cda898] | 57 | fi |
58 | ;; | |
[1c48007] | 59 | |
[0cda898] | 60 | *) |
61 | echo "Usage: ${0} {stop}" | |
62 | exit 1 | |
63 | ;; | |
[1c48007] | 64 | |
65 | esac | |
66 | ||
[f874424] | 67 | exit 0 |
68 | ||
[0cda898] | 69 | # End sendsignals |
Note:
See TracBrowser
for help on using the repository browser.