Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions etc/rc.d/init.d/functions
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@ __kill_pids_term_kill_checkpids() {

for pid in $pids ; do
[ ! -e "/proc/$pid" ] && continue
read -r line < "/proc/$pid/stat" 2> /dev/null

stat=($line)
stime=${stat[21]}
stime=$(cat /proc/$pid/stat 2> /dev/null | cut -d" " -f22)

[ -n "$stime" ] && [ "$base_stime" -lt "$stime" ] && continue
remaining="$remaining$pid "
Expand All @@ -141,8 +138,7 @@ __kill_pids_term_kill() {

# We can't initialize stat & base_stime on the same line where 'local'
# keyword is, otherwise the sourcing of this file will fail for ksh...
stat=($(< /proc/self/stat))
base_stime=${stat[21]}
base_stime=$(cat /proc/$$/stat | cut -d" " -f22)

if [ "$1" = "-d" ]; then
delay=$2
Expand Down