In my app I start some Daemons max 10 they are controlled with CLI Commands.
Daemons can be on WIndows and Linux(PI)
Now I like to get the Process ID to check if one of the Daemons still running.
The daemons start Shell.Run(-1)
They all have the same name but start from a different location.
How can I get the Process ID to see if the Daemon's still running?
Sometimes I also have to kill the process and for Windows I think TaskKill PID and Linux Kill PID is the way to go.
Maybe there is a better option to do this.
This will display the current pid of the running application. Dim jo As JavaObject jo.InitializeStatic("java.lang.management.ManagementFactory") Dim pid As String = jo.RunMethodJO("getRuntimeMXBean",Null).RunMethod("getName",Null) Log("this pid : " & pid.SubString2(0,pid.IndexOf("@")))
Sometimes I also have to kill the process and for Windows I think TaskKill PID and Linux Kill PID is the way to go.
Maybe there is a better option to do this.