diff --git a/examples/actor.sh b/examples/actor.sh index 78cad96..704c66f 100755 --- a/examples/actor.sh +++ b/examples/actor.sh @@ -1,3 +1,4 @@ #!/usr/bin/env bash -echo "Bash actor called with $@" +echo "Bash actor called with $@" > /tmp/act +echo "Bash actor called with: $@" diff --git a/examples/bffh.dhall b/examples/bffh.dhall index 742ff69..2fa6eba 100644 --- a/examples/bffh.dhall +++ b/examples/bffh.dhall @@ -1,13 +1,14 @@ -- { actor_connections = [] : List { _1 : Text, _2 : Text } { actor_connections = + -- Link up machines to actors [ { _1 = "Testmachine", _2 = "Actor" } , { _1 = "Another", _2 = "Bash" } + -- One machine can have as many actors as it wants , { _1 = "Yetmore", _2 = "Bash2" } + , { _1 = "Yetmore", _2 = "FailBash"} ] , actors = { Actor = { module = "Dummy", params = {=} } - , Actor2 = { module = "Dummy", params = {=} } - , Actor3 = { module = "Dummy", params = {=} } , Bash = { module = "Process", params = { cmd = "./examples/actor.sh" , args = "your ad could be here" @@ -16,8 +17,8 @@ { cmd = "./examples/actor.sh" , args = "this is a different one" }} - , Bash3 = { module = "Process", params = - { cmd = "./examples/actor.sh" + , FailBash = { module = "Process", params = + { cmd = "./examples/fail-actor.sh" }} } , init_connections = [] : List { _1 : Text, _2 : Text } diff --git a/examples/fail-actor.sh b/examples/fail-actor.sh new file mode 100755 index 0000000..5630f1c --- /dev/null +++ b/examples/fail-actor.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +echo "This is some error output" > /dev/stderr +exit 115 diff --git a/src/modules/process.rs b/src/modules/process.rs index 6828a7c..bcbfd38 100644 --- a/src/modules/process.rs +++ b/src/modules/process.rs @@ -78,7 +78,7 @@ impl Actuator for Process { } } Ok(retv) => { - warn!(flog, "Actor {} returned nonzero output {} for {:?}", name, retv.status, fstate); + warn!(flog, "Actor {} returned nonzero status {} for State={:?}", name, retv.status, fstate); if !retv.stderr.is_empty() { let errstr = String::from_utf8_lossy(&retv.stderr); for line in errstr.lines() {