I am working on a bash script that runs when a My Java application application requests a server reboot. This script performs operations that must be outside the Java application process tree.
I invoke a restart of the script in Java using ProcessBuilder as follows:
private static final String LOC = "/some/directory/";
private static final String RESTART_SCRIPT = LOC + "restart.sh";
...
final ProcessBuilder pb = new ProcessBuilder(RESTART_SCRIPT);
Process p = pb.start();
This script performs the dedesignation of another script that processes all the reload logic. It looks like this:
#!/bin/bash
(bash /some/directory/shutdownHandler.sh "true" &)
exit 0
When I call a function containing the ProcessBuilder logic in a Java application, I don’t see the effects of the logic in the shutdownHandler.sh script. Even simple echoes of text in files do not arise. I have already verified that I have the correct permissions.
restart.sh , , .
, . - , Java script?