diff --git a/saturn-core/src/main/java/com/vip/saturn/job/executor/RestartAndDumpService.java b/saturn-core/src/main/java/com/vip/saturn/job/executor/RestartAndDumpService.java new file mode 100644 index 000000000..48eae7339 --- /dev/null +++ b/saturn-core/src/main/java/com/vip/saturn/job/executor/RestartAndDumpService.java @@ -0,0 +1,185 @@ +package com.vip.saturn.job.executor; + +import com.vip.saturn.job.exception.SaturnJobException; +import com.vip.saturn.job.reg.base.CoordinatorRegistryCenter; +import com.vip.saturn.job.threads.SaturnThreadFactory; +import com.vip.saturn.job.utils.SystemEnvProperties; +import org.apache.commons.lang3.StringUtils; +import org.apache.curator.framework.CuratorFramework; +import org.apache.curator.framework.recipes.cache.NodeCache; +import org.apache.curator.framework.recipes.cache.NodeCacheListener; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +/** + * @author hebelala + */ +public class RestartAndDumpService { + + private static final Logger LOGGER = LoggerFactory.getLogger(RestartAndDumpService.class); + + private String executorName; + private CoordinatorRegistryCenter coordinatorRegistryCenter; + private CuratorFramework curatorFramework; + private File prgDir; + private NodeCache restartNC; + private ExecutorService restartES; + private NodeCache dumpNC; + private ExecutorService dumpES; + + public RestartAndDumpService(String executorName, CoordinatorRegistryCenter coordinatorRegistryCenter) { + this.executorName = executorName; + this.coordinatorRegistryCenter = coordinatorRegistryCenter; + this.curatorFramework = (CuratorFramework) coordinatorRegistryCenter.getRawClient(); + } + + public void start() throws Exception { + if (!SystemEnvProperties.VIP_SATURN_ENABLE_EXEC_SCRIPT) { + LOGGER.info("The RestartAndDumpService is disabled"); + return; + } + validateFile(SystemEnvProperties.NAME_VIP_SATURN_PRG, SystemEnvProperties.VIP_SATURN_PRG); + validateConfigured(SystemEnvProperties.NAME_VIP_SATURN_LOG_OUTFILE, SystemEnvProperties.VIP_SATURN_LOG_OUTFILE); + prgDir = new File(SystemEnvProperties.NAME_VIP_SATURN_PRG).getParentFile(); + + initRestart(); + initDump(); + } + + private void validateFile(String name, String value) throws SaturnJobException { + validateConfigured(name, value); + File file = new File(value); + if (!file.exists()) { + throw new SaturnJobException(value + " is not existing"); + } + if (!file.isFile()) { + throw new SaturnJobException(value + " is not file"); + } + } + + private void validateConfigured(String name, String value) throws SaturnJobException { + if (StringUtils.isBlank(value)) { + throw new SaturnJobException(name + " is not configured"); + } + LOGGER.info("The {} is configured as {}", name, value); + } + + private void initRestart() throws Exception { + restartES = Executors.newSingleThreadExecutor(new SaturnThreadFactory(executorName + "-restart-watcher-thread", false)); + // Remove the restart node, before add watcher that watches the create and update event + String nodePath = SaturnExecutorsNode.EXECUTORS_ROOT + "/" + executorName + "/restart"; + coordinatorRegistryCenter.remove(nodePath); + restartNC = new NodeCache(curatorFramework, nodePath); + restartNC.getListenable().addListener(new NodeCacheListener() { + + @Override + public void nodeChanged() throws Exception { + // Watch create, update event + if (restartNC.getCurrentData() != null) { + LOGGER.info("The executor {} restart event is received", executorName); + restartES.execute(new Runnable() { + @Override + public void run() { + try { + // The apache's Executor maybe destroy process on some conditions, + // and don't provide the api for redirect process's streams to file. + // It's not expected, so I use the original way. + LOGGER.info("Begin to execute restart script"); + String command = "chmod +x " + SystemEnvProperties.VIP_SATURN_PRG + ";" + SystemEnvProperties.VIP_SATURN_PRG + " restart"; + Process process = new ProcessBuilder() + .command("/bin/bash", "-c", command) + .directory(prgDir) + .redirectOutput(ProcessBuilder.Redirect.appendTo(new File(SystemEnvProperties.VIP_SATURN_LOG_OUTFILE))) + .redirectError(ProcessBuilder.Redirect.appendTo(new File(SystemEnvProperties.VIP_SATURN_LOG_OUTFILE))) + .start(); + int exit = process.waitFor(); + LOGGER.info("Executed restart script, the exit value {} is returned", exit); + } catch (InterruptedException e) { + LOGGER.info("Restart thread is interrupted"); + } catch (Exception e) { + LOGGER.error("Execute restart script error", e); + } + } + }); + } + } + + }); + // Start, with not buildInitial. + // The initial data is null, so the create event will be triggered firstly. + restartNC.start(false); + } + + private void initDump() throws Exception { + dumpES = Executors.newSingleThreadExecutor(new SaturnThreadFactory(executorName + "-dump-watcher-thread", false)); + final String nodePath = SaturnExecutorsNode.EXECUTORS_ROOT + "/" + executorName + "/dump"; + coordinatorRegistryCenter.remove(nodePath); + dumpNC = new NodeCache(curatorFramework, nodePath); + dumpNC.getListenable().addListener(new NodeCacheListener() { + + @Override + public void nodeChanged() throws Exception { + // Watch create, update event + if (dumpNC.getCurrentData() != null) { + LOGGER.info("The executor {} dump event is received", executorName); + dumpES.execute(new Runnable() { + @Override + public void run() { + try { + // dump threads and gc + LOGGER.info("Begin to execute script dump"); + String command = "chmod +x " + SystemEnvProperties.VIP_SATURN_PRG + ";" + SystemEnvProperties.VIP_SATURN_PRG + " dump"; + Process process = new ProcessBuilder() + .command("/bin/bash", "-c", command) + .directory(prgDir) + .redirectOutput(ProcessBuilder.Redirect.appendTo(new File(SystemEnvProperties.VIP_SATURN_LOG_OUTFILE))) + .redirectError(ProcessBuilder.Redirect.appendTo(new File(SystemEnvProperties.VIP_SATURN_LOG_OUTFILE))) + .start(); + int exit = process.waitFor(); + LOGGER.info("Execute script dump done, the exit value {} is returned", exit); + } catch (InterruptedException e) { + LOGGER.info("Dump thread is interrupted"); + } catch (Exception e) { + LOGGER.error(e.getMessage(), e); + } finally { + coordinatorRegistryCenter.remove(nodePath); + } + } + }); + } + } + + }); + dumpNC.start(false); + } + + + public void stop() { + try { + if (restartNC != null) { + restartNC.close(); + } + } catch (Exception e) { + LOGGER.error(e.getMessage(), e); + } + if (restartES != null) { + restartES.shutdownNow(); + } + try { + if (dumpNC != null) { + dumpNC.close(); + } + } catch (Exception e) { + LOGGER.error(e.getMessage(), e); + } + if (dumpES != null) { + dumpES.shutdownNow(); + } + } + + +} diff --git a/saturn-core/src/main/java/com/vip/saturn/job/executor/RestartExecutorService.java b/saturn-core/src/main/java/com/vip/saturn/job/executor/RestartExecutorService.java deleted file mode 100644 index 99ea12c5f..000000000 --- a/saturn-core/src/main/java/com/vip/saturn/job/executor/RestartExecutorService.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.vip.saturn.job.executor; - -import com.vip.saturn.job.exception.SaturnJobException; -import com.vip.saturn.job.reg.base.CoordinatorRegistryCenter; -import com.vip.saturn.job.utils.SystemEnvProperties; -import org.apache.commons.lang3.StringUtils; -import org.apache.curator.framework.CuratorFramework; -import org.apache.curator.framework.recipes.cache.NodeCache; -import org.apache.curator.framework.recipes.cache.NodeCacheListener; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.io.IOException; - -/** - * @author hebelala - */ -public class RestartExecutorService { - - private static final Logger LOGGER = LoggerFactory.getLogger(RestartExecutorService.class); - - private String executorName; - private CoordinatorRegistryCenter coordinatorRegistryCenter; - private CuratorFramework curatorFramework; - private String nodePath; - private NodeCache nodeCache; - private volatile Thread restartThread; - private volatile File prgDir; - - public RestartExecutorService(String executorName, CoordinatorRegistryCenter coordinatorRegistryCenter) { - this.executorName = executorName; - this.coordinatorRegistryCenter = coordinatorRegistryCenter; - this.curatorFramework = (CuratorFramework) coordinatorRegistryCenter.getRawClient(); - this.nodePath = SaturnExecutorsNode.EXECUTORS_ROOT + "/" + executorName + "/restart"; - } - - /** - * Delete the restart node, and add the watcher for restart node created or updated - */ - public void start() throws Exception { - if (!SystemEnvProperties.VIP_SATURN_ENABLE_RESTART_EXECUTOR) { - LOGGER.info("The RestartExecutorService is disabled"); - return; - } - validateFile(SystemEnvProperties.NAME_VIP_SATURN_PRG, SystemEnvProperties.VIP_SATURN_PRG); - validateConfigured(SystemEnvProperties.NAME_VIP_SATURN_LOG_OUTFILE, SystemEnvProperties.VIP_SATURN_LOG_OUTFILE); - prgDir = new File(SystemEnvProperties.NAME_VIP_SATURN_PRG).getParentFile(); - - // Remove the restart node, before add watcher that watches the create and update event - coordinatorRegistryCenter.remove(nodePath); - nodeCache = new NodeCache(curatorFramework, nodePath); - nodeCache.getListenable().addListener(new NodeCacheListener() { - @Override - public void nodeChanged() throws Exception { - // Watch create, update event - if (nodeCache.getCurrentData() != null) { - LOGGER.info("The {} restart event is received", executorName); - restartOneTime(); - } - } - }); - // Start, with not buildInitial. - // The initial data is null, so the create event will be triggered firstly. - nodeCache.start(false); - } - - private void validateFile(String name, String value) throws SaturnJobException { - validateConfigured(name, value); - File file = new File(value); - if (!file.exists()) { - throw new SaturnJobException(value + " is not existing"); - } - if (!file.isFile()) { - throw new SaturnJobException(value + " is not file"); - } - } - - private void validateConfigured(String name, String value) throws SaturnJobException { - if (StringUtils.isBlank(value)) { - throw new SaturnJobException(name + " is not configured"); - } - LOGGER.info("The {} is configured as {}", name, value); - } - - private synchronized void restartOneTime() { - if (restartThread != null) { - LOGGER.warn("The {} restart thread is already running, cannot execute again", executorName); - return; - } - - restartThread = new Thread(new Runnable() { - @Override - public void run() { - try { - // The apache's Executor maybe destroy process on some conditions, - // and don't provide the api for redirect process's streams to file. - // It's not expected, so I use the original way. - LOGGER.info("Begin to execute restart script"); - String command = "chmod +x " + SystemEnvProperties.VIP_SATURN_PRG + ";" + SystemEnvProperties.VIP_SATURN_PRG + " restart"; - Process process = new ProcessBuilder() - .command("/bin/bash", "-c", command) - .directory(prgDir) - .redirectOutput(ProcessBuilder.Redirect.appendTo(new File(SystemEnvProperties.VIP_SATURN_LOG_OUTFILE))) - .redirectError(ProcessBuilder.Redirect.appendTo(new File(SystemEnvProperties.VIP_SATURN_LOG_OUTFILE))) - .start(); - int exit = process.waitFor(); - LOGGER.info("Executed restart script, the exit value {} is returned", exit); - } catch (InterruptedException e) { - LOGGER.info("Restart thread is interrupted"); - } catch (Exception e) { - LOGGER.error("Execute restart script error", e); - } - } - }); - restartThread.setDaemon(true); - restartThread.start(); - } - - public void stop() { - if (restartThread != null) { - restartThread.interrupt(); - restartThread = null; - } - try { - if (nodeCache != null) { - nodeCache.close(); - } - } catch (IOException e) { - LOGGER.error(e.getMessage(), e); - } - } - - -} diff --git a/saturn-core/src/main/java/com/vip/saturn/job/executor/SaturnExecutorExtensionDefault.java b/saturn-core/src/main/java/com/vip/saturn/job/executor/SaturnExecutorExtensionDefault.java index 703da2454..cae404818 100644 --- a/saturn-core/src/main/java/com/vip/saturn/job/executor/SaturnExecutorExtensionDefault.java +++ b/saturn-core/src/main/java/com/vip/saturn/job/executor/SaturnExecutorExtensionDefault.java @@ -16,7 +16,7 @@ public class SaturnExecutorExtensionDefault extends SaturnExecutorExtension { private static Logger LOGGER; - private static final String NAME_SATURN_LOG_DIR = "SATURN_LOG_DIR"; + private static final String NAME_VIP_SATURN_LOG_DIR = "VIP_SATURN_LOG_DIR"; public SaturnExecutorExtensionDefault(String executorName, String namespace, ClassLoader executorClassLoader, ClassLoader jobClassLoader) { @@ -30,8 +30,8 @@ public void initBefore() { @Override public void initLogDirEnv() { - String SATURN_LOG_DIR = System.getProperty(NAME_SATURN_LOG_DIR, - getEnv(NAME_SATURN_LOG_DIR, getDefaultLogDir(executorName))); + String SATURN_LOG_DIR = System.getProperty(NAME_VIP_SATURN_LOG_DIR, + getEnv(NAME_VIP_SATURN_LOG_DIR, getDefaultLogDir(executorName))); System.setProperty("saturn.log.dir", SATURN_LOG_DIR); // for logback.xml } diff --git a/saturn-core/src/main/java/com/vip/saturn/job/executor/SaturnExecutorService.java b/saturn-core/src/main/java/com/vip/saturn/job/executor/SaturnExecutorService.java index 6bf710d23..7ad5bba24 100644 --- a/saturn-core/src/main/java/com/vip/saturn/job/executor/SaturnExecutorService.java +++ b/saturn-core/src/main/java/com/vip/saturn/job/executor/SaturnExecutorService.java @@ -41,7 +41,7 @@ public class SaturnExecutorService { private String ipNode; private ClassLoader jobClassLoader; private ClassLoader executorClassLoader; - private RestartExecutorService restartExecutorService; + private RestartAndDumpService restartExecutorService; public SaturnExecutorService(CoordinatorRegistryCenter coordinatorRegistryCenter, String executorName) { this.coordinatorRegistryCenter = coordinatorRegistryCenter; @@ -92,7 +92,7 @@ private void registerExecutor0() throws Exception { if (restartExecutorService != null) { restartExecutorService.stop(); } - restartExecutorService = new RestartExecutorService(executorName, coordinatorRegistryCenter); + restartExecutorService = new RestartAndDumpService(executorName, coordinatorRegistryCenter); restartExecutorService.start(); // 持久化ip @@ -213,7 +213,7 @@ private void stopRestartExecutorService() { private void removeIpNode() { try { if (coordinatorRegistryCenter != null && ipNode != null && coordinatorRegistryCenter.isConnected()) { - log.info(" {} is going to delete its ip node {}", executorName, ipNode); + log.info("{} is going to delete its ip node {}", executorName, ipNode); coordinatorRegistryCenter.remove(ipNode); } } catch (Throwable t) { diff --git a/saturn-core/src/main/java/com/vip/saturn/job/utils/SystemEnvProperties.java b/saturn-core/src/main/java/com/vip/saturn/job/utils/SystemEnvProperties.java index e90000dda..f063d9cc7 100644 --- a/saturn-core/src/main/java/com/vip/saturn/job/utils/SystemEnvProperties.java +++ b/saturn-core/src/main/java/com/vip/saturn/job/utils/SystemEnvProperties.java @@ -69,8 +69,8 @@ public class SystemEnvProperties { public static String NAME_VIP_SATURN_ZK_CLIENT_CONNECTION_TIMEOUT_IN_SECONDS = "VIP_SATURN_ZK_CLIENT_CONNECTION_TIMEOUT"; public static int VIP_SATURN_ZK_CLIENT_CONNECTION_TIMEOUT_IN_SECONDS = -1; - // For restart executor - public static boolean VIP_SATURN_ENABLE_RESTART_EXECUTOR = Boolean.getBoolean("VIP_SATURN_ENABLE_RESTART_EXECUTOR"); + // For restart and dump + public static boolean VIP_SATURN_ENABLE_EXEC_SCRIPT = Boolean.getBoolean("VIP_SATURN_ENABLE_EXEC_SCRIPT"); public static String NAME_VIP_SATURN_PRG = "VIP_SATURN_PRG"; public static String VIP_SATURN_PRG = System.getProperty(NAME_VIP_SATURN_PRG); public static String NAME_VIP_SATURN_LOG_OUTFILE = "VIP_SATURN_LOG_OUTFILE"; diff --git a/saturn-executor/src/main/assembly/bin/saturn-executor.sh b/saturn-executor/src/main/assembly/bin/saturn-executor.sh index 028f7b25d..f634a8229 100644 --- a/saturn-executor/src/main/assembly/bin/saturn-executor.sh +++ b/saturn-executor/src/main/assembly/bin/saturn-executor.sh @@ -49,6 +49,8 @@ USAGE() echo -e " '-sld|--saturnLogDir': optional." echo -e " jvmArgs: optional." echo -e " -------------------------------" + echo -e " dump, no parameters." + echo -e " -------------------------------" echo -e " stop, no parameters." echo -e " -------------------------------" echo -e " restart, no parameters." @@ -110,7 +112,7 @@ MEM_OPTS="-server ${ENVIRONMENT_MEM} -XX:NewRatio=1 -XX:+UseConcMarkSweepGC -XX: GCLOG_OPTS="-Xloggc:${LOGDIR}/gc.log -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCDateStamps -XX:+PrintGCDetails" CRASH_OPTS="-XX:ErrorFile=${LOGDIR}/hs_err_%p.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${LOGDIR}/" JMX_OPTS="-Dcom.sun.management.jmxremote.port=${JMX_PORT} -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dsun.rmi.transport.tcp.threadKeepAliveTime=75000 -Djava.rmi.server.hostname=${LOCALIP}" -SETTING_CONF="-DVIP_SATURN_PRG=${PRG} -DVIP_SATURN_LOG_DIR=${LOGDIR} -DVIP_SATURN_LOG_OUTFILE=${OUTFILE} -DVIP_SATURN_ENABLE_RESTART_EXECUTOR=true -Dstart.check.outfile=${STATUS_FILE}" +SETTING_CONF="-DVIP_SATURN_ENABLE_EXEC_SCRIPT=true -DVIP_SATURN_PRG=${PRG} -DVIP_SATURN_LOG_DIR=${LOGDIR} -DVIP_SATURN_LOG_OUTFILE=${OUTFILE} -Dstart.check.outfile=${STATUS_FILE}" JAVA_VERSION=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}') @@ -249,22 +251,43 @@ START() fi } -STOP() +DUMP() { - LOG_FMT "Begin to stop executor." - PID=$(GET_PID) - stoptime=0 + LOG_FMT "Begin to dump executor." + local PID=$(GET_PID) + while true; do + case "$1" in + -pid) PID="$2"; shift 2;; + *) break;; + esac + done if [ "$PID" != "" ]; then - if [ -d /proc/$PID ];then + if [ -d /proc/${PID} ];then LOGDIR=$(GET_LOGDIR ${PID}) # do the thread dump LOG_FILE_POSTFIX="${PID}_`date '+%Y-%m-%d-%H%M%S'`" - jstack -l $PID > $LOGDIR/dump_$LOG_FILE_POSTFIX.log + jstack -l ${PID} > ${LOGDIR}/dump_${LOG_FILE_POSTFIX}.log LOG_FMT "Thread dump done: dump_${LOG_FILE_POSTFIX}.log" # backup gc log - cp $LOGDIR/gc.log $LOGDIR/gc_$LOG_FILE_POSTFIX.log + cp ${LOGDIR}/gc.log ${LOGDIR}/gc_${LOG_FILE_POSTFIX}.log LOG_FMT "Backup gc log done: gc_${LOG_FILE_POSTFIX}.log" + LOG_FMT "Dump executor successfully." + else + LOG_FMT "Executor(pid:${PID}) is not running." + fi + else + LOG_FMT "Executor is not running." + fi +} +STOP() +{ + LOG_FMT "Begin to stop executor." + PID=$(GET_PID) + stoptime=0 + if [ "$PID" != "" ]; then + if [ -d /proc/$PID ];then + DUMP -pid ${PID} RUN_PARAMS=`cat ${STATUS_FILE}` LOG_FMT "Saturn executor pid is ${PID}, params are : ${RUN_PARAMS}." LOG_FMT "Stopping...\c" @@ -319,6 +342,7 @@ STATUS() case "$CMD" in start) START;; + dump) DUMP;; stop) STOP;; restart) RESTART;; status) STATUS;; diff --git a/saturn-it/src/test/java/com/vip/saturn/it/impl/RestartExecutorIT.java b/saturn-it/src/test/java/com/vip/saturn/it/impl/RestartAndDumpIT.java similarity index 70% rename from saturn-it/src/test/java/com/vip/saturn/it/impl/RestartExecutorIT.java rename to saturn-it/src/test/java/com/vip/saturn/it/impl/RestartAndDumpIT.java index 45633623a..5cfbddcb1 100644 --- a/saturn-it/src/test/java/com/vip/saturn/it/impl/RestartExecutorIT.java +++ b/saturn-it/src/test/java/com/vip/saturn/it/impl/RestartAndDumpIT.java @@ -17,7 +17,7 @@ @FixMethodOrder(MethodSorters.NAME_ASCENDING) -public class RestartExecutorIT extends AbstractSaturnIT { +public class RestartAndDumpIT extends AbstractSaturnIT { private static String PRG = "src/test/resources/script/restart/prg.sh"; private static String OUTFILE = "src/test/resources/script/restart/outfile"; @@ -35,8 +35,7 @@ public static void tearDown() throws Exception { @Test public void test() throws Exception { - boolean enable_restart_executor_old = SystemEnvProperties.VIP_SATURN_ENABLE_RESTART_EXECUTOR; - SystemEnvProperties.VIP_SATURN_ENABLE_RESTART_EXECUTOR = true; + SystemEnvProperties.VIP_SATURN_ENABLE_EXEC_SCRIPT = true; SystemEnvProperties.VIP_SATURN_PRG = new File(PRG).getAbsolutePath(); SystemEnvProperties.VIP_SATURN_LOG_OUTFILE = new File(OUTFILE).getAbsolutePath(); try { @@ -49,8 +48,17 @@ public void test() throws Exception { Thread.sleep(1000L); String content = FileUtils.readFileToString(new File(OUTFILE)); assertThat(content).isEqualTo("Hebe! Hebe! Hebe!"); + + String dumpNodePath = SaturnExecutorsNode.EXECUTORS_ROOT + "/" + executor.getExecutorName() + "/dump"; + regCenter.persist(dumpNodePath, ""); + Thread.sleep(1000L); + content = FileUtils.readFileToString(new File(OUTFILE)); + assertThat(content).isEqualTo("Hebe! Hebe! Hebe!Dump! Dump! Dump!"); + assertThat(regCenter.isExisted(dumpNodePath)).isFalse(); } finally { - SystemEnvProperties.VIP_SATURN_ENABLE_RESTART_EXECUTOR = enable_restart_executor_old; + SystemEnvProperties.VIP_SATURN_ENABLE_EXEC_SCRIPT = false; + SystemEnvProperties.VIP_SATURN_PRG = null; + SystemEnvProperties.VIP_SATURN_LOG_OUTFILE = null; } } diff --git a/saturn-it/src/test/resources/script/restart/outfile b/saturn-it/src/test/resources/script/restart/outfile index 4c44aa8ec..3102dc1d9 100644 --- a/saturn-it/src/test/resources/script/restart/outfile +++ b/saturn-it/src/test/resources/script/restart/outfile @@ -1 +1 @@ -Hebe! Hebe! Hebe! \ No newline at end of file +Hebe! Hebe! Hebe!Dump! Dump! Dump! \ No newline at end of file diff --git a/saturn-it/src/test/resources/script/restart/prg.sh b/saturn-it/src/test/resources/script/restart/prg.sh index 2ac1bb7b8..5902dc351 100755 --- a/saturn-it/src/test/resources/script/restart/prg.sh +++ b/saturn-it/src/test/resources/script/restart/prg.sh @@ -5,7 +5,13 @@ RESTART() echo -e "Hebe! Hebe! Hebe!\c" } +DUMP() +{ + echo -e "Dump! Dump! Dump!\c" +} + CMD="$1" case "$CMD" in restart) RESTART;; + dump) DUMP;; esac