diff --git a/apps/efka/src/efka_manifest.erl b/apps/efka/src/efka_manifest.erl index 4a8f147..3fbf064 100644 --- a/apps/efka/src/efka_manifest.erl +++ b/apps/efka/src/efka_manifest.erl @@ -49,9 +49,12 @@ startup(#manifest{work_dir = WorkDir, exec = ExecCmd0, args = Args0}) -> ], ExecCmd = binary_to_list(ExecCmd0), RealExecCmd = filename:absname_join(WorkDir, ExecCmd), - - Port = erlang:open_port({spawn_executable, RealExecCmd}, PortSettings), - {ok, Port}. + case catch erlang:open_port({spawn_executable, RealExecCmd}, PortSettings) of + Port when is_port(Port) -> + {ok, Port}; + _Other -> + {error, <<"exec command startup failed">>} + end. %% 检查配置是否合法 -spec check_manifest(Manifest :: map()) -> {ok, #manifest{}} | {error, Reason :: binary()}.