summaryrefslogtreecommitdiffstats
path: root/local-setup/src/main/docker/janusgraph/entrypoint.sh
blob: 8108866abda0c5ec2e3b0a7e18b1b6431acd2db3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash

# run short-living command and prevent docker from stopping

JANUS_EXEC="janusgraph/bin/janusgraph.sh"

onStart() {
  ${JANUS_EXEC} start
}

onStop() {
  ${JANUS_EXEC} stop
}

waitLoop() {
  tail -f /dev/null &
  wait $!
}

trap 'onStop; exit 0' SIGTERM SIGINT

onStart || exit $?

waitLoop