Debian Codegraph @

demuxserver.sh

raw symbols SCIP
1 #!/bin/bash
2
3 usage(){
4 echo "
5 Written by Brian Bushnell
6 Last modified June 27, 2024
7
8 Description: Starts a server for demultiplexing queries.
9
10 Usage: demuxserver.sh port=<number>
11
12
13 Parameters:
14
15 port=3068 Port number.
16 domain= Domain to be displayed in the help message.
17 Default is demux.jgi.doe.gov.
18
19 Java Parameters:
20 -Xmx This will set Java's memory usage, overriding autodetection.
21 -Xmx20g will specify 20 gigs of RAM, and -Xmx200m will specify 200 megs.
22 The max is typically 85% of physical memory.
23 -eoom This flag will cause the process to exit if an
24 out-of-memory exception occurs. Requires Java 8u92+.
25 -da Disable assertions.
26
27 Please contact Brian Bushnell at [email protected] if you encounter any problems.
28 "
29 }
30
31 #This block allows symlinked shellscripts to correctly set classpath.
32 pushd . > /dev/null
33 DIR="${BASH_SOURCE[0]}"
34 while [ -h "$DIR" ]; do
35 cd "$(dirname "$DIR")"
36 DIR="$(readlink "$(basename "$DIR")")"
37 done
38 cd "$(dirname "$DIR")"
39 DIR="$(pwd)/"
40 popd > /dev/null
41
42 #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/"
43 CP="$DIR""current/"
44
45 z="-Xmx24g"
46 z2="-Xms24g"
47 set=0
48
49 if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then
50 usage
51 exit
52 fi
53
54 calcXmx () {
55 source "$DIR""/calcmem.sh"
56 setEnvironment
57 parseXmx "$@"
58 }
59 calcXmx "$@"
60
61 demuxserver() {
62 local CMD="java $EA $EOOM $z $z2 -cp $CP barcode.DemuxServer $@"
63 echo $CMD >&2
64 eval $CMD
65 }
66
67 demuxserver "$@"