TT#137760 Remove support for most options set via defaults file

These can be set from the config file, which makes the support in the
sysvinit script redundant. Remove all these and leave only the minimally
relevant ones involved in the startup of the daemon.

Change-Id: I3faac4594d7f1a21e65761036c2ab153acb96152
pull/1373/head
Guillem Jover 4 years ago
parent 51c71f0035
commit 948c5fa541

@ -30,78 +30,14 @@ fi
OPTIONS=""
START_OPTIONS=""
if [ -n "$INTERFACES" ]; then
for interface in $INTERFACES; do
OPTIONS="$OPTIONS --interface=$interface"
done
fi
if [ -n "$SUBSCRIBE_KEYSPACES" ]; then
for ks in $SUBSCRIBE_KEYSPACES; do
OPTIONS="$OPTIONS --subscribe-keyspace=$ks"
done
fi
[ -z "$CONFIG_FILE" ] || OPTIONS="$OPTIONS --config-file=$CONFIG_FILE"
[ -z "$CONFIG_SECTION" ] || OPTIONS="$OPTIONS --config-section=$CONFIG_SECTION"
[ -z "$ADDRESS" ] || OPTIONS="$OPTIONS --interface=$ADDRESS"
[ -z "$ADV_ADDRESS" ] || OPTIONS="$OPTIONS!$ADV_ADDRESS"
[ -z "$ADDRESS_IPV6" ] || OPTIONS="$OPTIONS --interface=$ADDRESS_IPV6"
[ -z "$ADV_ADDRESS_IPV6" ] || OPTIONS="$OPTIONS!$ADV_ADDRESS_IPV6"
[ -z "$LISTEN_TCP" ] || OPTIONS="$OPTIONS --listen-tcp=$LISTEN_TCP"
[ -z "$LISTEN_UDP" ] || OPTIONS="$OPTIONS --listen-udp=$LISTEN_UDP"
[ -z "$LISTEN_NG" ] || OPTIONS="$OPTIONS --listen-ng=$LISTEN_NG"
[ -z "$LISTEN_CLI" ] || OPTIONS="$OPTIONS --listen-cli=$LISTEN_CLI"
[ -z "$TIMEOUT" ] || OPTIONS="$OPTIONS --timeout=$TIMEOUT"
[ -z "$SILENT_TIMEOUT" ] || OPTIONS="$OPTIONS --silent-timeout=$SILENT_TIMEOUT"
[ -z "$FINAL_TIMEOUT" ] || OPTIONS="$OPTIONS --final-timeout=$FINAL_TIMEOUT"
[ -z "$PIDFILE" ] || OPTIONS="$OPTIONS --pidfile=$PIDFILE"
[ -z "$TOS" ] || OPTIONS="$OPTIONS --tos=$TOS"
[ -z "$PORT_MIN" ] || OPTIONS="$OPTIONS --port-min=$PORT_MIN"
[ -z "$PORT_MAX" ] || OPTIONS="$OPTIONS --port-max=$PORT_MAX"
[ -z "$REDIS" ] || [ -z "$REDIS_DB" ] || OPTIONS="$OPTIONS --redis=$REDIS/$REDIS_DB"
[ -z "$REDIS_AUTH_PW" ] || export RTPENGINE_REDIS_AUTH_PW="$REDIS_AUTH_PW"
[ -z "$REDIS_WRITE" ] || [ -z "$REDIS_WRITE_DB" ] || OPTIONS="$OPTIONS --redis-write=$REDIS_WRITE/$REDIS_WRITE_DB"
[ -z "$REDIS_WRITE_AUTH_PW" ] || export RTPENGINE_REDIS_WRITE_AUTH_PW="$REDIS_WRITE_AUTH_PW"
[ -z "$REDIS_NUM_THREADS" ] || OPTIONS="$OPTIONS --redis-num-threads=$REDIS_NUM_THREADS"
[ -z "$REDIS_EXPIRES" ] || OPTIONS="$OPTIONS --redis-expires=$REDIS_EXPIRES"
[ -z "$REDIS_MULTIKEY" ] || OPTIONS="$OPTIONS --redis-multikey=$REDIS_MULTIKEY"
[ -z "$NO_REDIS_REQUIRED" ] || { [ "$NO_REDIS_REQUIRED" != "1" ] && [ "$NO_REDIS_REQUIRED" != "yes" ] ; } || OPTIONS="$OPTIONS --no-redis-required"
[ -z "$B2B_URL" ] || OPTIONS="$OPTIONS --b2b-url=$B2B_URL"
[ -z "$NO_FALLBACK" ] || { [ "$NO_FALLBACK" != "1" ] && [ "$NO_FALLBACK" != "yes" ] ; } || OPTIONS="$OPTIONS --no-fallback"
[ -z "$LOG_LEVEL" ] || OPTIONS="$OPTIONS --log-level=$LOG_LEVEL"
[ -z "$LOG_FACILITY" ] || OPTIONS="$OPTIONS --log-facility=$LOG_FACILITY"
[ -z "$LOG_FACILITY_CDR" ] || OPTIONS="$OPTIONS --log-facility-cdr=$LOG_FACILITY_CDR"
[ -z "$LOG_FACILITY_RTCP" ] || OPTIONS="$OPTIONS --log-facility-rtcp=$LOG_FACILITY_RTCP"
[ -z "$NUM_THREADS" ] || OPTIONS="$OPTIONS --num-threads=$NUM_THREADS"
[ -z "$DELETE_DELAY" ] || OPTIONS="$OPTIONS --delete-delay=$DELETE_DELAY"
[ -z "$GRAPHITE" ] || OPTIONS="$OPTIONS --graphite=$GRAPHITE"
[ -z "$GRAPHITE_INTERVAL" ] || OPTIONS="$OPTIONS --graphite-interval=$GRAPHITE_INTERVAL"
[ -z "$GRAPHITE_PREFIX" ] || OPTIONS="$OPTIONS --graphite-prefix=$GRAPHITE_PREFIX"
[ -z "$MAX_SESSIONS" ] || OPTIONS="$OPTIONS --max-sessions=$MAX_SESSIONS"
[ -z "$HOMER" ] || OPTIONS="$OPTIONS --homer=$HOMER"
[ -z "$HOMER_PROTOCOL" ] || OPTIONS="$OPTIONS --homer-protocol=$HOMER_PROTOCOL"
[ -z "$HOMER_ID" ] || OPTIONS="$OPTIONS --homer-id=$HOMER_ID"
if [ -n "$RECORDING_DIR" ]; then
OPTIONS="$OPTIONS --recording-dir=$RECORDING_DIR"
if [ ! -d "$RECORDING_DIR" ]; then
mkdir "$RECORDING_DIR" 2> /dev/null
chmod 700 "$RECORDING_DIR" 2> /dev/null
fi
fi
[ -z "$RECORDING_METHOD" ] || OPTIONS="$OPTIONS --recording-method=$RECORDING_METHOD"
[ -z "$RECORDING_FORMAT" ] || OPTIONS="$OPTIONS --recording-format=$RECORDING_FORMAT"
[ -z "$DTLS_PASSIVE" ] || { [ "$DTLS_PASSIVE" != "yes" ] && [ "$DTLS_PASSIVE" != "1" ] ; } || OPTIONS="$OPTIONS --dtls-passive"
if test "$FORK" = "no" ; then
OPTIONS="$OPTIONS --foreground"
fi
if test "$LOG_STDERR" = "yes" ; then
OPTIONS="$OPTIONS --log-stderr"
fi
# check if directory for pid file needs to be created
PIDDIR=$(dirname "$PIDFILE")

@ -50,69 +50,11 @@ build_opts() {
fi
fi
# interfaces
if [[ -n "$RTP_IP" ]];then
for IP in "${RTP_IP[@]}";do
OPTS+=" --interface=$IP"
done
fi
# options
[[ "$FORK" == "no" ]] && OPTS+=" --foreground"
[[ "$LOG_STDERR" == "yes" ]] && OPTS+=" --log-stderr"
[[ "$FALLBACK" != "yes" ]] && OPTS+=" --no-fallback"
[ -z "$CONFIG_FILE" ] || OPTS+=" --config-file=$CONFIG_FILE"
[ -z "$CONFIG_SECTION" ] || OPTS+=" --config-section=$CONFIG_SECTION"
[ -z "$ADDRESS" ] || OPTS+=" --interface=$ADDRESS"
[ -z "$ADV_ADDRESS" ] || OPTS+="!$ADV_ADDRESS"
[ -z "$ADDRESS_IPV6" ] || OPTS+=" --interface=$ADDRESS_IPV6"
[ -z "$ADV_ADDRESS_IPV6" ] || OPTS+="!$ADV_ADDRESS_IPV6"
[ -z "$LISTEN_TCP" ] || OPTS+=" --listen-tcp=$LISTEN_TCP"
[ -z "$LISTEN_UDP" ] || OPTS+=" --listen-udp=$LISTEN_UDP"
[ -z "$LISTEN_NG" ] || OPTS+=" --listen-ng=$LISTEN_NG"
[ -z "$LISTEN_CLI" ] || OPTS+=" --listen-cli=$LISTEN_CLI"
[ -z "$TIMEOUT" ] || OPTS+=" --timeout=$TIMEOUT"
[ -z "$SILENT_TIMEOUT" ] || OPTS+=" --silent-timeout=$SILENT_TIMEOUT"
[ -z "$FINAL_TIMEOUT" ] || OPTS+=" --final-timeout=$FINAL_TIMEOUT"
[ -z "$PIDFILE" ] || OPTS+=" --pidfile=$PIDFILE"
[ -z "$TOS" ] || OPTS+=" --tos=$TOS"
[ -z "$PORT_MIN" ] || OPTS+=" --port-min=$PORT_MIN"
[ -z "$PORT_MAX" ] || OPTS+=" --port-max=$PORT_MAX"
[ -z "$REDIS" ] || [ -z "$REDIS_DB" ] || OPTS+=" --redis=$REDIS/$REDIS_DB"
[ -z "$REDIS_AUTH_PW" ] || export RTPENGINE_REDIS_AUTH_PW="$REDIS_AUTH_PW"
[ -z "$REDIS_WRITE" ] || [ -z "$REDIS_WRITE_DB" ] || OPTS+=" --redis-write=$REDIS_WRITE/$REDIS_WRITE_DB"
[ -z "$REDIS_WRITE_AUTH_PW" ] || export RTPENGINE_REDIS_WRITE_AUTH_PW="$REDIS_WRITE_AUTH_PW"
[ -z "$REDIS_NUM_THREADS" ] || OPTS+=" --redis-num-threads=$REDIS_NUM_THREADS"
[ -z "$REDIS_EXPIRES" ] || OPTS+=" --redis-expires=$REDIS_EXPIRES"
[ -z "$REDIS_MULTIKEY" ] || OPTS+=" --redis-multikey=$REDIS_MULTIKEY"
[ -z "$NO_REDIS_REQUIRED" ] || { [ "$NO_REDIS_REQUIRED" != "1" ] && [ "$NO_REDIS_REQUIRED" != "yes" ] ; } || OPTS+=" --no-redis-required"
[ -z "$B2B_URL" ] || OPTS+=" --b2b-url=$B2B_URL"
[ -z "$LOG_LEVEL" ] || OPTS+=" --log-level=$LOG_LEVEL"
[ -z "$LOG_FACILITY" ] || OPTS+=" --log-facility=$LOG_FACILITY"
[ -z "$LOG_FACILITY_CDR" ] || OPTS+=" --log-facility-cdr=$LOG_FACILITY_CDR"
[ -z "$LOG_FACILITY_RTCP" ] || OPTS+=" --log-facility-rtcp=$LOG_FACILITY_RTCP"
[ -z "$NUM_THREADS" ] || OPTS+=" --num-threads=$NUM_THREADS"
[ -z "$DELETE_DELAY" ] || OPTS+=" --delete-delay=$DELETE_DELAY"
[ -z "$GRAPHITE" ] || OPTS+=" --graphite=$GRAPHITE"
[ -z "$GRAPHITE_INTERVAL" ] || OPTS+=" --graphite-interval=$GRAPHITE_INTERVAL"
[ -z "$GRAPHITE_PREFIX" ] || OPTS+=" --graphite-prefix=$GRAPHITE_PREFIX"
[ -z "$MAX_SESSIONS" ] || OPTS+=" --max-sessions=$MAX_SESSIONS"
[ -z "$HOMER" ] || OPTS+=" --homer=$HOMER"
[ -z "$HOMER_PROTOCOL" ] || OPTS+=" --homer-protocol=$HOMER_PROTOCOL"
[ -z "$HOMER_ID" ] || OPTS+=" --homer-id=$HOMER_ID"
[ -z "$RECORDING_METHOD" ] || OPTS+=" --recording-method=$RECORDING_METHOD"
[ -z "$RECORDING_FORMAT" ] || OPTS+=" --recording-format=$RECORDING_FORMAT"
[ -z "$DTLS_PASSIVE" ] || { [ "$DTLS_PASSIVE" != "yes" ] && [ "$DTLS_PASSIVE" != "1" ] ; } || OPTS+=" --dtls-passive"
# recording dir
if [ -n "$RECORDING_DIR" ];then
OPTS+=" --recording-dir=$RECORDING_DIR"
if [ ! -d "$RECORDING_DIR" ]; then
mkdir "$RECORDING_DIR" 2>/dev/null
chmod 700 "$RECORDING_DIR" 2>/dev/null
fi
fi
}
start() {

@ -4,63 +4,9 @@
CONFIG_FILE=/etc/rtpengine/rtpengine.conf
# pid
#PIDFILE=/run/ngcp-rtpengine-daemon.pid
# "yes" enables fallback to userspace forwarding only.
#FALLBACK=yes
# Local IPv4/6 address for RTP. The format of the value is [NAME/]IP[!IP].
#RTP_IP[0]=127.0.0.1
# At least one of LISTEN_(TCP|UDP|NG) is required
# IP address and port combination for TCP control
#LISTEN_TCP=127.0.0.1:2222
# IP address and port combination for UDP control
#LISTEN_UDP=127.0.0.1:2222
# IP address and port combination for NG (UDP) control
#LISTEN_NG=127.0.0.1:2223
#LISTEN_CLI=127.0.0.1:9900
# TOS value to use in outgoing packets
#TOS=184
# Number of seconds after which a media stream is considered dead if there is no traffic. Default: 60
#TIMEOUT=60
# Number of seconds after which a muted or inactive stream is considered dead. Default: 3600
#SILENT_TIMEOUT=3600
# Lowest port in the local port range for media traffic. Default: 30000
#PORT_MIN=30000
# Highest port in the local port range for media traffic. Default: 40000
#PORT_MAX=40000
#
# Log level to use
#LOG_LEVEL=6
# Syslog facility to use
#LOG_FACILITY=daemon
# Syslog facility to write CDRs
#LOG_FACILITY_CDR=daemon
# How many worker threads to launch
#NUM_THREADS=5
# Delay to delete session from memory
#DELETE_DELAY=30
# The following items are for use with NGCP
#REDIS=127.0.0.1:6379
#REDIS_DB=0
#B2B_URL=http://127.0.0.1:8080/xmlrpc
# User
# Run rtpengine as this specific user
#SET_USER=ngcp-rtpengine
# allow this group to control rtpengine in kernel mode
#SET_GROUP=ngcp-rtpengine
# Address of Homer server for RTCP stats
#HOMER=127.0.0.1:9060
# Transport protocol for Homer (default udp)
#HOMER_PROTO=udp
# 'Capture ID' to use within the HEP protocol
#HOMER_ID=1234
# TCP address of graphite statistics server
#GRAPHITE=127.0.0.1:2003
# Graphite data statistics send interval
#GRAPHITE_INTERVAL=60
# Graphite prefix for every line
#GRAPHITE_PREFIX=STRING

Loading…
Cancel
Save