GC-4552: added services
This commit is contained in:
parent
baa73c6b83
commit
5042b531a2
|
@ -1,9 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
MONKEY_FOLDER=/var/monkey_island
|
||||
INSTALLATION_FOLDER=/var/monkey_island/installation
|
||||
|
||||
# install pip requirements
|
||||
pip install -r /var/monkey_island/pip_requirements.txt --no-index --find-links file://$INSTALLATION_FOLDER
|
||||
pip install -r $MONKEY_FOLDER/pip_requirements.txt --no-index --find-links file://$INSTALLATION_FOLDER
|
||||
|
||||
# remove installation folder
|
||||
# remove installation folder and unnecessary files
|
||||
rm -rf $INSTALLATION_FOLDER
|
||||
rm -f $MONKEY_FOLDER/pip_requirements.txt
|
||||
|
||||
mv $MONKEY_FOLDER/ubuntu/* /etc/init/
|
||||
|
||||
service monkey-island start
|
||||
service monkey-mongo start
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
description "Monkey Island Service"
|
||||
|
||||
start on runlevel [2345]
|
||||
stop on runlevel [!2345]
|
||||
|
||||
respawn
|
||||
respawn limit unlimited
|
||||
|
||||
script
|
||||
chdir /var/monkey_island/cc
|
||||
exec python main.py
|
||||
end script
|
||||
|
||||
post-stop script
|
||||
if [ -n $UPSTART_EVENTS ]; then
|
||||
exec sleep 15
|
||||
fi
|
||||
end script
|
|
@ -0,0 +1,18 @@
|
|||
description "Monkey Island Mongo Service"
|
||||
|
||||
start on runlevel [2345]
|
||||
stop on runlevel [!2345]
|
||||
|
||||
respawn
|
||||
respawn limit unlimited
|
||||
|
||||
script
|
||||
chdir /var/monkey_island/
|
||||
exec /var/monkey_island/bin/mongodb/bin/mongod --dbpath db
|
||||
end script
|
||||
|
||||
post-stop script
|
||||
if [ -n $UPSTART_EVENTS ]; then
|
||||
exec sleep 15
|
||||
fi
|
||||
end script
|
Loading…
Reference in New Issue