Last active
November 10, 2015 14:27
-
-
Save mikezaccardo/b9a7c87086cca5d703e5 to your computer and use it in GitHub Desktop.
SameServerEntity Example
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
name: "SameServerEntity Example" | |
location: localhost | |
services: | |
- type: org.apache.brooklyn.entity.software.base.SameServerEntity | |
id: parent | |
name: Parent Entity | |
children.startable.mode: background_late | |
brooklyn.children: | |
- serviceType: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess | |
id: item-A | |
name: A | |
launch.command: | | |
echo hello | nc -l 4321 & | |
echo $! > $PID_FILE | |
echo "A: launch.command executed" | |
env: { CHECK_MARKER: "checkRunning", STOP_MARKER: "stop" } | |
checkRunning.command: echo $CHECK_MARKER >> DATE && test -f "$PID_FILE" && ps -p `cat $PID_FILE` >/dev/null | |
stop.command: echo $STOP_MARKER >> DATE && test -f "$PID_FILE" && { kill -9 `cat $PID_FILE`; rm /tmp/vanilla.pid; } | |
- serviceType: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess | |
id: item-B | |
name: B | |
launch.command: | | |
echo hello | nc -l 4322 & | |
echo $! > $PID_FILE | |
echo "B: launch.command executed" | |
env: { CHECK_MARKER: "checkRunning", STOP_MARKER: "stop" } | |
checkRunning.command: echo $CHECK_MARKER >> DATE && test -f "$PID_FILE" && ps -p `cat $PID_FILE` >/dev/null | |
stop.command: echo $STOP_MARKER >> DATE && test -f "$PID_FILE" && { kill -9 `cat $PID_FILE`; rm /tmp/vanilla.pid; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See
org.apache.brooklyn.entity.software.base.SoftwareProcess.ChildStartableMode
for the differentchild.startable.mode
options.