Skip to content

Commit

Permalink
Moving fedora/solr startup to init script
Browse files Browse the repository at this point in the history
  • Loading branch information
escowles committed Apr 25, 2016
1 parent 751a9db commit 1fb7082
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 13 deletions.
18 changes: 5 additions & 13 deletions install_scripts/curation-concerns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,8 @@ rails generate curation_concerns:work Book
# start redis
sudo /etc/init.d/redis-server start

# start rails, fedora and solr for development
nohup fcrepo_wrapper -p 8984 > log/fedora.log 2>&1 &
nohup solr_wrapper --version 5.4.1 -d solr/config/ -p 8983 -n hydra-development > log/solr.log 2>&1 &

printf 'waiting for solr and fedora'
until $(curl --output /dev/null --silent --head --fail http://localhost:8983/solr); do
printf '.'
sleep 1
done
until $(curl --output /dev/null --silent --head --fail http://localhost:8984/rest); do
printf '.'
sleep 1
done
# start fedora and solr
SHARED_DIR=$1
sudo cp $SHARED_DIR/install_scripts/fedora-solr /etc/init.d/
sudo update-rc.d fedora-solr start 90 2 3 4 5 .
sudo /etc/init.d/fedora-solr start
24 changes: 24 additions & 0 deletions install_scripts/fedora-solr
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh

case "$1" in
start)
echo "Starting Fedora and Solr"
su - vagrant -c "/bin/sh -c 'cd /home/vagrant/curation-concerns-demo; nohup fcrepo_wrapper -p 8984 -i tmp > log/fedora.log 2>&1 &'"
su - vagrant -c "/bin/sh -c 'cd /home/vagrant/curation-concerns-demo; nohup solr_wrapper --version 5.4.1 -d solr/config/ -p 8983 -n hydra-development --download_path tmp/solr.war -i tmp/solr > log/solr.log 2>&1 &'"
;;
stop)
;;
esac

printf 'waiting for solr and fedora'
until $(curl --output /dev/null --silent --head --fail http://localhost:8983/solr); do
printf '.'
sleep 1
done
until $(curl --output /dev/null --silent --head --fail http://localhost:8984/rest); do
printf '.'
sleep 1
done
echo " done"

exit 0

0 comments on commit 1fb7082

Please sign in to comment.