ctdb-scripts: Avoid direct /proc access
authorMartin Schwenke <martin@meltin.net>
Mon, 4 Jan 2021 00:54:38 +0000 (11:54 +1100)
committerAmitay Isaacs <amitay@samba.org>
Fri, 28 May 2021 06:46:29 +0000 (06:46 +0000)
commitffb56c9143d1d4b9a2dfaa8300be6ce5d6881ab1
tree350b753e0e7aeb32c927a2a27c49f6ba001ef072
parent55d4b3438f2c44a12b4c513ef26e2d1c4fa9f5b4
ctdb-scripts: Avoid direct /proc access

The main reason for this is to facilitate testing.

Avoid some /proc accesses entirely by using ps(1) (which can be
replaced by a stub when testing) because this script might as well be
more portable in case anyone wants to add lock debugging for a
non-Linux platform.  While the "state" format specification isn't
POSIX-compliant, it works on both Linux and FreeBSD so it is a
reasonable improvement.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/config/debug_locks.sh