Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make run.sh more portable #434

Open
niklasmohrin opened this issue Oct 27, 2022 · 0 comments
Open

Make run.sh more portable #434

niklasmohrin opened this issue Oct 27, 2022 · 0 comments

Comments

@niklasmohrin
Copy link

niklasmohrin commented Oct 27, 2022

The run.sh can be more portable by including a shebang line and not relying on an implementation detail. The trap should take signal names without the "SIG" prefix. From the posix man pages:

The condition can be [...] a signal specified using a symbolic name, without the SIG prefix [...], for example, HUP, INT, QUIT, TERM. Implementations may permit names with the SIG prefix or ignore case in signal names as an extension.

One prominent example of a shell used for /bin/sh is dash (for example: Ubuntu), which does not permit the "SIG" prefix.

diff --git a/deployment/configs/local/run.sh b/deployment/configs/local/run.sh
index a9e0a5d7..5aa6e229 100755
--- a/deployment/configs/local/run.sh
+++ b/deployment/configs/local/run.sh
@@ -1,5 +1,7 @@
+#!/bin/sh
+
 echo "This script does not support Microsoft Windows please use the run.bat script.\n"
 
-trap 'kill %1' SIGINT
+trap 'kill %1' INT
 java -Xmx2g -jar webapp-runner.jar backend --port 8081  &
 java -Xmx2g -jar webapp-runner.jar frontend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant