다음 .net 코드가 있으므로 jvm이 ShutdownHooks를 실행하도록 올바르게 중지하고 싶습니다. 유닉스 명 COMAND 검색된 등가 SIGTERM 보내지 않고 중지 JVM 강제) p.Kill와 프로세스 (막으려Gracefuly stop .net Java 프로세스가 시작했습니다.
System.Diagnostics.Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
p.StartInfo.WorkingDirectory = @"C:\test\";
p.StartInfo.FileName = @"C:\Program Files\Java\jre6u16\bin\java.exe";
p.StartInfo.Arguments = "-jar TheExecutable.jar";
. 또는 maeby Java 프로세스가 종료 된 후크가 실행되지 않기 때문에 뭔가 잘못하고 있습니다.
감사합니다.
정말 유용한 답변입니다. 고마워요! –
그건 그렇고, 왜이 특정한 경우에 우리는 리눅스에서 SIGTERM을 보내는 작업을 할 수 없는지 제발 설명해 주시겠습니까? –