This repository has been archived by the owner on Jun 30, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add browsermob-proxy in run supervisor (#362)
* Add browsermob-proxy in run supervisor * Delete browsermob proxy jar file and replaced by http get
- Loading branch information
Showing
4 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,3 +31,5 @@ temp.md | |
git_shortlog.stdout | ||
.bitballoon | ||
.idea | ||
*.DS_Store | ||
*.iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/sh | ||
|
||
BASEDIR=`dirname $0`/.. | ||
BASEDIR=`(cd "$BASEDIR"; pwd)` | ||
|
||
# if user has not explicitly set a command to use to invoke java, use 'java' and assume it is on the path | ||
if [ -z "$JAVACMD" ] | ||
then | ||
JAVACMD="java" | ||
fi | ||
|
||
"$JAVACMD" $JAVA_OPTS \ | ||
-Dapp.name="browsermob-proxy" \ | ||
-Dbasedir="$BASEDIR" \ | ||
-jar "$BASEDIR/lib/browsermob-dist-2.1.4.jar" \ | ||
--port ${ENV_BROWSERMOBPROXY_PORT:-8080} | ||
"$@" | ||
|
||
# if we couldn't find java, print a helpful error message | ||
if [ $? -eq 127 ] | ||
then | ||
echo | ||
echo "Unable to run java using command: $JAVACMD" | ||
echo "Make sure java is installed and on the path, or set JAVACMD to the java executable before running this script." | ||
echo | ||
echo "Example:" | ||
echo | ||
echo " $ JAVACMD=/var/lib/jdk/bin/java ./browsermob-proxy" | ||
echo | ||
fi |
52 changes: 52 additions & 0 deletions
52
browsermobproxy/etc/supervisor/conf.d/browsermobproxy.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
[program:browsermobproxy] | ||
|
||
;The relative priority of the program in the start and shutdown ordering. | ||
;Lower priorities indicate programs that start first and shut down last. | ||
priority=95 | ||
|
||
;User to run-as, note environment expansion outside of `command` is only | ||
;supported in supervisor >= 3.2 | ||
;user=seluser | ||
|
||
;The command that will be run when this program is started. | ||
;Controlled programs should themselves not be daemons, as supervisord | ||
;assumes it is responsible for daemonizing its subprocesses | ||
directory=/home/seluser | ||
command=%(ENV_BIN_UTILS)s/browsermob-proxy | ||
|
||
;If true, this program will start automatically when supervisord is started. | ||
;default=true | ||
autostart=%(ENV_BROWSERMOBPROXY_START)s | ||
|
||
;If false, the process will never be autorestarted. | ||
;If true, the process will be unconditionally restarted when it exits, | ||
;without regard to its exit code. default=unexpected | ||
;If unexpected, the process will be restart when the program exits with an | ||
;exit code that is not one of the exit codes associated with this process. | ||
autorestart=unexpected | ||
|
||
;Set to 0 to indicate that the program needn’t stay running for any | ||
;particular amount of time. | ||
;So using custom wait-xxxx.sh scripts to perform a more efficient | ||
;active waiting until https://github.com/Supervisor/supervisor/issues/584 | ||
startsecs=2 | ||
|
||
;The number of serial failure attempts that supervisord will allow when | ||
;attempting to start the program before giving up and puting the process | ||
;into an FATAL state. | ||
startretries=3 | ||
|
||
;Logs | ||
redirect_stderr=false | ||
stdout_logfile=%(ENV_LOGS_DIR)s/browsermobproxy-stdout.log | ||
stderr_logfile=%(ENV_LOGS_DIR)s/browsermobproxy-stderr.log | ||
stdout_logfile_maxbytes=%(ENV_LOGFILE_MAXBYTES)s | ||
stderr_logfile_maxbytes=%(ENV_LOGFILE_MAXBYTES)s | ||
stdout_logfile_backups=%(ENV_LOGFILE_BACKUPS)s | ||
stderr_logfile_backups=%(ENV_LOGFILE_BACKUPS)s | ||
stdout_capture_maxbytes=%(ENV_LOGFILE_MAXBYTES)s | ||
stderr_capture_maxbytes=%(ENV_LOGFILE_MAXBYTES)s | ||
|
||
;The signal used to kill the program when a stop is requested. This can be | ||
;any of TERM, HUP, INT, QUIT, KILL, USR1, or USR2. default=TERM | ||
stopsignal=%(ENV_BROWSERMOBPROXY_STOP_SIGNAL)s |