question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can i receive signal in the jvm?

See original GitHub issue

I use /bin/bash to run jvm as a child process, but i can’t receive signal in the jvm.

Dockerfile:

ENTRYPOINT ["/dumb-init", "--", "/docker-entrypoint.sh"]

and docker-entrypoint.sh:

#!/usr/bin/dumb-init /bin/bash

source `dirname $0`/init-product.sh

if [ -z "$POOL_TYPE" ]; then
  source `dirname $0`/init.sh $RESOURCE_ID
  echo "****FINISHED****"
else
  echo "****FINISHED****"
  java -Xmx64m -Xms16m -Xmn8m -Xss1m -XX:ReservedCodeCacheSize=5m -XX:NewRatio=3 -jar /usr/local/agent/agent-1.0.1.jar $POOL_TYPE
fi

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
asottilecommented, Apr 5, 2019

yep that looks correct as long as you have the ENTRYPOINT set as OP does

0reactions
sheldonhullcommented, Apr 5, 2019

@asottile // @VFT Quick followup question, when you mention unnecessary /bin/bash in the shebang do you mean it should be completely omitted? What should it look like when done correctly based on your directions

Is this correct for the process tree or since entry-point defines dumb-init does this inherit correctly?

#!/bin/bash

source `dirname $0`/init-product.sh

if [ -z "$POOL_TYPE" ]; then
  source `dirname $0`/init.sh $RESOURCE_ID
  echo "****FINISHED****"
else
  echo "****FINISHED****"
exec java -Xmx64m -Xms16m -Xmn8m -Xss1m -XX:ReservedCodeCacheSize=5m -XX:NewRatio=3 -jar /usr/local/agent/agent-1.0.1.jar $POOL_TYPE
fi
Read more comments on GitHub >

github_iconTop Results From Across the Web

Signals used by the JVM - IBM
Signal Name Signal type Disabled by ‑Xrs Disabled by ‑Xrs:sync SIGSEGV (11) Exception Yes Yes SIGILL (4) Exception Yes Yes SIGFPE (8) Exception Yes Yes
Read more >
7 Handle Signals and Exceptions - Java
This chapter provides information about how signals and exceptions are handled by the Java HotSpot Virtual Machine. It also describes the signal chaining ......
Read more >
Handle signals in the Java Virtual Machine - Stack Overflow
The JVM responds to signals on its own. Some will cause the JVM to shutdown gracefully, which includes running shutdown hooks.
Read more >
How the JVM processes signals - setgetweb.com
When a signal is raised that is of interest to the JVM, a signal handler is called. This signal handler determines whether it...
Read more >
How can i receive signal in the jvm? · Issue #72 · krallin/tini
tini proxies signals to its immediate child (bash in this case), but bash does not, so your entrypoint breaks signal forwarding here (the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found