aboutsummaryrefslogtreecommitdiffstats
path: root/priv/templates/builtin_hook_pid
diff options
context:
space:
mode:
Diffstat (limited to 'priv/templates/builtin_hook_pid')
-rw-r--r--priv/templates/builtin_hook_pid12
1 files changed, 12 insertions, 0 deletions
diff --git a/priv/templates/builtin_hook_pid b/priv/templates/builtin_hook_pid
new file mode 100644
index 0000000..0151631
--- /dev/null
+++ b/priv/templates/builtin_hook_pid
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# loop until the VM starts responding to pings
+while ! $(relx_nodetool "ping">/dev/null)
+do
+ sleep 1
+done
+
+# get the beam pid and write it to the file passed as
+# argument
+PID="$(relx_get_pid)"
+echo $PID > $1