-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for new relx directive that provides start/stop script hooks
New 'extended_start_script_hooks' directive that allows the developer to define six different hook scripts to be invoked at pre/post start/stop/install upgrade phases. Besides these custom defined scripts other types of builtin scripts are also available, these offer pre-packaged functionality that can be used directly, they are: pid - writes the beam pid to a configurable file location (/var/run/<rel_name>.pid by default). wait_for_vm_start - waits for the vm to start (ie. when it can be pinged) wait_for_process - waits for a configurable name to appear in the erlang process registry The hook scripts are invoked with the 'source' command, therefore they have access to all the variables in the start script.
- Loading branch information
Showing
7 changed files
with
440 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
# loop until the VM starts responding to pings | ||
while ! $(relx_nodetool "ping">/dev/null) | ||
do | ||
sleep 1 | ||
done | ||
|
||
# loop until the names provided as argument gets | ||
# registered | ||
while true | ||
do | ||
if [ "$(relx_nodetool eval "whereis($1).")" != "undefined" ] | ||
then | ||
exit 0 | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# loop until the VM starts responding to pings | ||
while ! $(relx_nodetool "ping">/dev/null) | ||
do | ||
sleep 1 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.