summaryrefslogtreecommitdiffstats
path: root/bin/backtrace
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2015-05-21 02:19:23 +0200
committertv <tv@shackspace.de>2015-05-21 02:19:23 +0200
commit8ff3a49978d9b802b1c7ce401fc682a33452d633 (patch)
tree71a81f250424af4ad0a1a4a63b2c35ff4bb4c010 /bin/backtrace
parent36670f3e1cccad579b994a29320eeb8e287803b7 (diff)
cac-ssh: use json-assert-type
Diffstat (limited to 'bin/backtrace')
-rwxr-xr-xbin/backtrace16
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/backtrace b/bin/backtrace
new file mode 100755
index 000000000..f8582ec2f
--- /dev/null
+++ b/bin/backtrace
@@ -0,0 +1,16 @@
+#! /bin/sh
+set -euf
+
+pid=$$
+while :; do
+ cd /proc/$pid
+ cmdline=$(cat cmdline | sed 's/\0/ /g;s/ $//')
+ ppid=$(grep PPid status | awk '{print$2}')
+ printf '%5d %s\n' $pid "$cmdline"
+ if [ $pid = 1 ]; then
+ break
+ else
+ pid=$ppid
+ fi
+done \
+ | tac