Created
May 10, 2017 14:41
-
-
Save dunn/33f489c02900a656ac37a25e90b68692 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
set -e | |
cd "$(dirname "${BASH_SOURCE[0]}")/../" | |
for service in solr fcrepo; do | |
if [[ ! -f "$service".pid ]]; then | |
pid=$(cat "$service".pid) | |
echo "ERROR: ${service}_wrapper is not running" >&2 | |
exit 1 | |
fi | |
kill -15 "$(cat "$service".pid)" || true | |
rm "$service".pid | |
done |
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
#!/bin/bash | |
set -e | |
cd "$(dirname "${BASH_SOURCE[0]}")/../" | |
for service in solr fcrepo; do | |
if [[ -f "$service".pid ]]; then | |
pid=$(cat "$service".pid) | |
echo "ERROR: ${service}_wrapper is already running (Process ID $pid)" >&2 | |
exit 1 | |
fi | |
bundle exec "${service}_wrapper" --config "config/${service}_wrapper_development.yml" >> "log/${service}.log" 2>&1 & | |
pid="$!" | |
echo "Running ${service}_wrapper with Process ID $pid" | |
echo "Logging to log/${service}.log" | |
echo "$pid" > "$service".pid | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment