/usr/sbin/avisd is in avis 1.2.2-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | #!/bin/sh
set -e
daemon=0
avis_opts=""
# find avis-router.jar in either lib or libexec/avis
#base_dir=`dirname "$0"`
#avisd_jar="$base_dir/../lib/avis-router.jar"
avisd_jar="/usr/share/avis/avis-router.jar"
if [ ! -f "$avisd_jar" ]; then
avisd_jar="$base_dir/../libexec/avis/avis-router.jar"
fi
if [ ! -f "$avisd_jar" ]; then
echo "Cannot find avis-router.jar"
exit 1
fi
usage ()
{
local NL=$'\x0a'
local help="\
Usage: $0 [-h] [-v] [-vv] [-p port] [-c file] $NL\
[-daemon] [-pidfile file] [-logfile file] $NL\
-h : This text$NL\
-v and -vv : Increase verbosity$NL\
-p port : Set port to listen on$NL\
-c file : Load config from file$NL\
-daemon : Run as daemon$NL\
-pidfile file : Output process ID to file$NL\
-logfile file : Log output to file (only with -daemon)$NL"
echo "$help" >&2
}
while [ $# -gt 0 ]; do
case $1 in
-pidfile) pidfile=$2; shift 2;;
-daemon) daemon=1; shift;;
-logfile) logfile=$2; shift 2;;
-v|-vv) avis_opts="$avis_opts $1"; shift;;
-p|-c) avis_opts="$avis_opts $1 $2"; shift;
if [ ! -z $1 ]; then shift; fi;;
*) usage; exit 1;;
esac
done
java_options="-server -Xms12M -Xmx96M -Xverify:none -XX:+UseParallelGC"
command="java $java_options -jar $avisd_jar $avis_opts"
if [ $daemon -eq 1 ]; then
if [ -z $logfile ]; then
logfile=/dev/null
fi
( exec $command < /dev/null >> $logfile 2>&1 ) &
if [ "x$pidfile" != "x" ]; then echo $! > "$pidfile"; fi
else
if [ "x$pidfile" != "x" ]; then echo $$ > "$pidfile"; fi
if [ -z "$logfile" ]; then
exec $command
else
exec $command >> $logfile 2>&1
fi
fi
|