From 695f1f558563b9328ca289fc333130218fc445f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nelson=20Gra=C3=A7a?= Date: Sun, 31 Dec 2017 11:42:59 +0000 Subject: [PATCH] SWARM-1757 - chkconfig does not configure runlevels properly (#751) * SWARM-1533 - Swarm fails to create if path to .m2/repository has spaces * Added extra check to avoid error when start-stop-daemon is missing Adding support for chkconfig --- tools/src/main/resources/org/wildfly/swarm/tools/launch.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/src/main/resources/org/wildfly/swarm/tools/launch.sh b/tools/src/main/resources/org/wildfly/swarm/tools/launch.sh index 452d5b645f..4992489330 100644 --- a/tools/src/main/resources/org/wildfly/swarm/tools/launch.sh +++ b/tools/src/main/resources/org/wildfly/swarm/tools/launch.sh @@ -1,5 +1,9 @@ #!/bin/bash +## chkconfig +# chkconfig: 345 90 90 +# description: Runs a Wildfly Swarm app + [[ -n "$DEBUG" ]] && set -x # Initialize variables that cannot be provided by a .conf file @@ -115,7 +119,7 @@ command="$javaexe -Dsun.misc.URLClassPath.disableJarChecking=true $JAVA_OPTS -ja #check if start-stop-daemon has support for --no-close (to support older systems) -noClose=$(if [[ $(start-stop-daemon --help | grep \\-\\-no-close; echo $?) == 0 ]]; then echo --no-close; fi) +noClose=$(if [[ $(type start-stop-daemon > /dev/null 2>&1 && start-stop-daemon --help | grep \\-\\-no-close; echo $?) == 0 ]]; then echo --no-close; fi) # Action functions start() {