Search
j0ke.net Open Build Service
>
Projects
>
home:jg
:
playground
>
dracut
> 0245-dracut-lib.sh-add-killproc.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File 0245-dracut-lib.sh-add-killproc.patch of Package dracut
From 94b12823ad49eec1399a399f67456d0e7005cdbd Mon Sep 17 00:00:00 2001 From: Harald Hoyer <harald@redhat.com> Date: Wed, 28 Sep 2011 16:02:59 +0200 Subject: [PATCH] dracut-lib.sh: add killproc() --- modules.d/99base/dracut-lib.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh index 5ae86a8..429378f 100644 --- a/modules.d/99base/dracut-lib.sh +++ b/modules.d/99base/dracut-lib.sh @@ -244,3 +244,14 @@ ip_to_var() { esac } +killproc() { + local exe=$(type -p $1) + local sig=$2 i + [ -x "$exe" ] || return 1 + for i in /proc/[0-9]*; do + [ "$i" = "/proc/1" ] && continue + if [ -a "$i"/exe ] && [ "$i/exe" -ef "$exe" ] ; then + kill $sig ${i##*/} + fi + done +} -- 1.8.3.1