kdumpctl: display message while waiting for the single instance lock
Vivek suggested we should display message while waiting for the lock, because the waiting could be long and user will have no idea what's going on. So we will repeat the following message every 5 seconds while waiting: "Another app is currently holding the kdump lock; waiting for it to exit..." Thanks Vivek for providing a more comprehensive message. Signed-off-by: WANG Chao <chaowang@redhat.com> Acked-by: Vivek Goyal <vgoyal@redhat.com>
This commit is contained in:
parent
993961a411
commit
463742ad95
12
kdumpctl
12
kdumpctl
@ -20,8 +20,18 @@ fi
|
||||
|
||||
single_instance_lock()
|
||||
{
|
||||
local rc timeout=5
|
||||
|
||||
exec 9>/var/lock/kdump
|
||||
flock 9
|
||||
|
||||
flock -n 9
|
||||
rc=$?
|
||||
|
||||
while [ $rc -ne 0 ]; do
|
||||
echo "Another app is currently holding the kdump lock; waiting for it to exit..."
|
||||
flock -w $timeout 9
|
||||
rc=$?
|
||||
done
|
||||
}
|
||||
|
||||
# remove_cmdline_param <kernel cmdline> <param1> [<param2>] ... [<paramN>]
|
||||
|
Loading…
Reference in New Issue
Block a user