public static void main(String[] args) throws Exception {
        final BatchProcessDriverCLI runner = new BatchProcessDriverCLI(args);

        //make absolutely certain that the forked process is terminated
        Runtime
                .getRuntime()
                .addShutdownHook(new Thread(runner::stop));

        runner.execute();
        System.out.println("FSBatchProcessDriver has gracefully completed");
        System.exit(0);
    }
This relies on an special exit values of 254 (do not restart),
0 ended correctly, 253 ended with exception (do restart)
tika-batch/src/main/java/org/apache/tika/batch/BatchProcessDriverCLI.java