Add all files needed to bring up VM and run agaric.com locally

This commit is contained in:
benjamin melançon 2018-08-20 10:45:20 -04:00
parent 52c8b60bac
commit 4d2bc0ee24
742 changed files with 24037 additions and 0 deletions

View file

@ -0,0 +1,94 @@
#!/bin/sh
# chkconfig: 2345 95 05
# description: Controls an Apache Solr process.
#
# This script will launch Solr in a mode that will automatically respawn if it
# crashes. Output will be sent to $LOG_FILE. A PID file will be created in the
# standard location.
#
# Adapted by Jeff Geerling from http://stackoverflow.com/a/8014720/100134
### BEGIN INIT INFO
# Provides: {{ solr_service_name }}
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Apache Solr search server
### END INIT INFO
SOLR_DIR="{{ solr_install_path }}/example"
JAVA_OPTIONS="-Dsolr.solr.home={{ solr_home }} -Djetty.host={{ solr_host }} -Djetty.port={{ solr_port }} -Xms{{ solr_xms }} -Xmx{{ solr_xmx }}"
START_COMMAND="java -jar $JAVA_OPTIONS start.jar"
LOG_FILE="{{ solr_log_file_path }}"
start () {
echo -n "Starting {{ solr_service_name }}... "
daemon --chdir="$SOLR_DIR" --command "$START_COMMAND" --respawn --output=$LOG_FILE --name={{ solr_service_name }}
RETVAL=$?
if [ $RETVAL = 0 ]
then
echo "done."
else
echo "failed. See error code for more information."
fi
return $RETVAL
}
stop () {
echo -n "Stopping {{ solr_service_name }}... "
daemon --stop --name={{ solr_service_name }}
RETVAL=$?
if [ $RETVAL = 0 ]
then
echo "done."
else
echo "failed. See error code for more information."
fi
return $RETVAL
}
restart () {
echo -n "Restarting solr... "
daemon --restart --name={{ solr_service_name }}
RETVAL=$?
if [ $RETVAL = 0 ]
then
echo "done."
else
echo "failed. See error code for more information."
fi
return $RETVAL
}
check_status () {
# Report on the status of the daemon
daemon --running --name={{ solr_service_name }} --verbose
return $?
}
case "$1" in
start)
start
;;
status)
check_status
;;
stop)
stop
;;
restart)
restart
;;
*)
echo $"Usage: solr {start|status|stop|restart}"
exit 3
;;
esac
exit $RETVAL

View file

@ -0,0 +1,91 @@
#!/bin/sh
# chkconfig: 2345 95 05
# description: Controls an Apache Solr process.
#
# TODO: Describe this file.
#
# @author Jeff Geerling, 2015
. /etc/rc.d/init.d/functions
SOLR_DIR="{{ solr_install_path }}/example"
JAVA_OPTIONS="-Dsolr.solr.home={{ solr_home }} -Djetty.host={{ solr_host }} -Djetty.port={{ solr_port }} -Xms{{ solr_xms }} -Xmx{{ solr_xmx }} -DSTOP.PORT=8079 -DSTOP.KEY=secret"
START_COMMAND="java -jar $JAVA_OPTIONS start.jar"
STOP_COMMAND="java -jar $JAVA_OPTIONS $SOLR_DIR/start.jar --stop"
LOG_FILE="{{ solr_log_file_path }}"
start () {
echo -n "Starting solr... "
if ps aux | grep "[s]olr.solr.home" > /dev/null
then
echo -n "already started... "
else
cd "$SOLR_DIR" && daemon --user="{{ solr_user }}" $START_COMMAND > $LOG_FILE &
fi
RETVAL=$?
if [ $RETVAL = 0 ]
then
echo "done."
else
echo "failed. See error code for more information."
fi
return $RETVAL
}
stop () {
echo -n "Stopping solr... "
if ps aux | grep "[s]olr.solr.home" > /dev/null
then
$STOP_COMMAND
else
echo -n "already stopped... "
fi
RETVAL=$?
if [ $RETVAL = 0 ]
then
echo "done."
else
echo "failed. See error code for more information."
fi
return $RETVAL
}
restart () {
$0 stop
sleep 3
$0 start
}
check_status () {
if ps aux | grep "[s]olr.solr.home" > /dev/null
then
printf "Solr is running.\n"
else
printf "Solr is stopped.\n"
fi
}
case "$1" in
start)
start
;;
status)
check_status
;;
stop)
stop
;;
restart)
restart
;;
*)
echo $"Usage: solr {start|status|stop|restart}"
exit 3
;;
esac
exit $RETVAL

View file

@ -0,0 +1,14 @@
[Unit]
Description=Apache SOLR
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
PIDFile={{ solr_install_path }}/bin/solr-{{ solr_port }}.pid
ExecStart={{ solr_install_path }}/bin/solr -e cloud -noprompt
User=solr
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target