summaryrefslogtreecommitdiff
path: root/init_scripts/img_server
diff options
context:
space:
mode:
authorPatrick Darley <patrick.darley@codethink.co.uk>2015-09-28 10:52:14 +0000
committerPatrick Darley <patrick.darley@codethink.co.uk>2015-09-28 13:44:06 +0000
commit9e0f8ac82d04a658f7f07b0f7cf2044c4e3e4e02 (patch)
tree2103ced94cfa21bd967da246f7bdc62088f44c9c /init_scripts/img_server
parent1f8a568a833c72364c9af67f8ab506a243965a9a (diff)
downloadbuildslave-scripts-9e0f8ac82d04a658f7f07b0f7cf2044c4e3e4e02.tar.gz
Some init scripts to be used to serve images and artifacts when the aws is started. Needs some sort of setup script to put them in place. Also needs some sort of ybd that isnt in pdars homedir
Diffstat (limited to 'init_scripts/img_server')
-rwxr-xr-xinit_scripts/img_server40
1 files changed, 40 insertions, 0 deletions
diff --git a/init_scripts/img_server b/init_scripts/img_server
new file mode 100755
index 0000000..de09930
--- /dev/null
+++ b/init_scripts/img_server
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# description: a server for the image archive
+# chkconfig: 2345 90 50
+#
+# Make init function library available
+. /etc/init.d/functions
+
+prog=SimpleHTTPServer
+
+# Start the service
+start() {
+ echo "Starting $prog"
+ cd /archive/images
+ /usr/bin/python -m SimpleHTTPServer &
+}
+# Stop the service
+stop() {
+ echo "Stopping $prog"
+ pid=`ps aux|awk '/[S]impleHTTPServer/ {print $2}'`
+ kill "$pid"
+}
+
+### Main logic ###
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart|reload|condrestart)
+ stop
+ start
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|reload|status}"
+ exit 1
+esac
+exit 0