Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update wavefront-proxy #887

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 26 additions & 14 deletions pkg/etc/init.d/wavefront-proxy
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@
# File any issues here: https://github.com/wavefrontHQ/java/issues.
################################################################################

service_name="wavefront-proxy"
sysconfig="/etc/sysconfig/$service_name"
[[ -f "$sysconfig" ]] && . $sysconfig

desc=${DESC:-Wavefront Proxy}
pid_file=${PID_FILE:-/var/run/$service_name.pid}

setupEnv(){
FD=$(ulimit -n)
echo "OS MAX File descriptors: ${FD}"

if [ -f /.dockerenv ]; then
>&2 echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
>&2 echo "WARNING: Attempting to start Wavefront Proxy as a system daemon in a container environment."
Expand Down Expand Up @@ -52,7 +49,6 @@ setupEnv(){
user="wavefront"
wavefront_dir="/opt/wavefront"
proxy_dir=${PROXY_DIR:-$wavefront_dir/wavefront-proxy}
config_dir=${CONFIG_DIR:-/etc/wavefront/wavefront-proxy}

conf_file=$CONF_FILE
if [[ -z $conf_file ]]; then
Expand All @@ -69,6 +65,7 @@ setupEnv(){
fi
echo "Using \"${conf_file}\" as config file"

mkdir -p /var/log/wavefront/
log_file="/var/log/wavefront/wavefront.log"
proxy_jar=${AGENT_JAR:-$proxy_dir/bin/wavefront-proxy.jar}
class="com.wavefront.agent.WavefrontProxyService"
Expand All @@ -95,11 +92,11 @@ jsvc_exec()
setupEnv

nohup ${JAVA_HOME}/bin/java \
$java_args \
-Dlog4j.configurationFile=$config_dir/log4j2.xml \
-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager \
-jar $proxy_jar \
$app_args >> ${log_file} 2>&1 &
$java_args \
-Dlog4j.configurationFile=$config_dir/log4j2.xml \
-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager \
-jar $proxy_jar \
$app_args >> ${log_file} 2>&1 &

echo $! > $pid_file
}
Expand Down Expand Up @@ -148,13 +145,28 @@ condrestart()
[ -f "$pid_file" ] && restart || :
}

(
echo "#########################"
date

config_dir=${CONFIG_DIR:-/etc/wavefront/wavefront-proxy}

service_name="wavefront-proxy"
sysconfig="/etc/sysconfig/$service_name"
[[ -f "$sysconfig" ]] && . $sysconfig

desc=${DESC:-Wavefront Proxy}
pid_file=${PID_FILE:-/var/run/$service_name.pid}


case "$1" in
start) start ;;
status) status ;;
stop) stop ;;
restart) restart ;;
condrestart) condrestart ;;
*)
echo "Usage: $0 {status | start | stop | restart | condrestart}"
exit 1
echo "Usage: $0 {status | start | stop | restart | condrestart}"
exit 1
esac
) 2>&1 | tee -a /var/log/wf-proxy-boot.log
Loading