diff --git a/conf/type/__process/explorer/runs b/conf/type/__process/explorer/runs index 19d259a6..240ebef9 100755 --- a/conf/type/__process/explorer/runs +++ b/conf/type/__process/explorer/runs @@ -21,6 +21,10 @@ # Check whether a process runs # -process="$__object_id" +if [ -f "$__object/parameter/name" ]; then + name="$(cat "$__object/parameter/name")" +else + name="$__object_id" +fi -pgrep -x -f "$process" || true +pgrep -x -f "$name" || true diff --git a/conf/type/__process/gencode-remote b/conf/type/__process/gencode-remote index 219230db..f8da1795 100755 --- a/conf/type/__process/gencode-remote +++ b/conf/type/__process/gencode-remote @@ -21,7 +21,11 @@ # __file is a very basic type, which will probably be reused quite often # -process="$__object_id" +if [ -f "$__object/parameter/name" ]; then + name="$(cat "$__object/parameter/name")" +else + name="$__object_id" +fi runs="$(cat "$__object/explorer/runs")" state="$(cat "$__object/parameter/state")" @@ -33,7 +37,7 @@ case "$state" in if [ -f "$__object/parameter/start" ]; then cat "$__object/parameter/start" else - echo "$process" + echo "$name" fi fi ;; @@ -47,4 +51,9 @@ case "$state" in fi fi ;; + *) + echo "Unknown state: $state" >&2 + exit 1 + ;; + esac diff --git a/conf/type/__process/man.text b/conf/type/__process/man.text index 623ec4b2..5f49865b 100644 --- a/conf/type/__process/man.text +++ b/conf/type/__process/man.text @@ -21,6 +21,9 @@ state:: OPTIONAL PARAMETERS ------------------- +name:: + Process name to match on when using pgrep -f -x. + stop:: Executable to use for stopping the process. diff --git a/conf/type/__process/parameter/optional b/conf/type/__process/parameter/optional index 4189bb2c..3411afb4 100644 --- a/conf/type/__process/parameter/optional +++ b/conf/type/__process/parameter/optional @@ -1,2 +1,3 @@ +name stop start