GC-4552: added services

This commit is contained in:
urihershgc 2015-12-07 16:11:31 +02:00
parent baa73c6b83
commit 5042b531a2
5 changed files with 45 additions and 2 deletions

View File

@ -1,9 +1,16 @@
#!/bin/bash #!/bin/bash
MONKEY_FOLDER=/var/monkey_island
INSTALLATION_FOLDER=/var/monkey_island/installation INSTALLATION_FOLDER=/var/monkey_island/installation
# install pip requirements # 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 -rf $INSTALLATION_FOLDER
rm -f $MONKEY_FOLDER/pip_requirements.txt
mv $MONKEY_FOLDER/ubuntu/* /etc/init/
service monkey-island start
service monkey-mongo start

View File

@ -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

View File

@ -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