if (phase.equalsIgnoreCase(CHECK_RUNNING)) {
s.setTransient();
}
if (truth(flags.get(USE_PID_FILE))) {
String pidFile = (flags.get(USE_PID_FILE) instanceof CharSequence ? flags.get(USE_PID_FILE) : getRunDir()+"/"+PID_FILENAME).toString();
<BUG>String processOwner = (flags.containsKey(PROCESS_OWNER) ? flags.get(PROCESS_OWNER) : getMachine().getUser()).toString();
if (LAUNCHING.equals(phase)) {</BUG>
s.footer.prepend("echo $! > "+pidFile);
} else if (CHECK_RUNNING.equals(phase)) {
s.body.append(

if (phase.equalsIgnoreCase(CHECK_RUNNING)) {
s.setTransient();
}
if (truth(flags.get(USE_PID_FILE))) {
String pidFile = (flags.get(USE_PID_FILE) instanceof CharSequence ? flags.get(USE_PID_FILE) : getRunDir()+"/"+PID_FILENAME).toString();
String processOwner = (String) flags.get(PROCESS_OWNER);
if (LAUNCHING.equals(phase)) {
s.footer.prepend("echo $! > "+pidFile);
} else if (CHECK_RUNNING.equals(phase)) {
s.body.append(
