diff --git a/monkey_island/deb-package/DEBIAN/postinst b/monkey_island/deb-package/DEBIAN/postinst index 42b8f1eb0..502c90c5e 100644 --- a/monkey_island/deb-package/DEBIAN/postinst +++ b/monkey_island/deb-package/DEBIAN/postinst @@ -2,16 +2,18 @@ MONKEY_FOLDER=/var/monkey_island INSTALLATION_FOLDER=/var/monkey_island/installation +PYTHON_FOLDER=/var/monkey_island/bin/python cp -f ${MONKEY_FOLDER}/monkey.sh /usr/bin/monkey chmod 755 /usr/bin/monkey -# Fix dependency bug -pip uninstall -y bson +# Prepare python virtualenv +pip install virtualenv --no-index --find-links file://$INSTALLATION_FOLDER +mkdir ${MONKEY_FOLDER}/bin +virtualenv ${PYTHON_FOLDER} # install pip requirements -pip install -r $MONKEY_FOLDER/pip_requirements.txt --no-index --find-links file://$INSTALLATION_FOLDER - +${PYTHON_FOLDER}/bin/python/python -m pip install -r $MONKEY_FOLDER/pip_requirements.txt --no-index --find-links file://$INSTALLATION_FOLDER # remove installation folder and unnecessary files rm -rf ${INSTALLATION_FOLDER} diff --git a/monkey_island/deb-package/monkey_island_pip_requirements.txt b/monkey_island/deb-package/monkey_island_pip_requirements.txt index 275c8b96a..26f0f9ee2 100644 --- a/monkey_island/deb-package/monkey_island_pip_requirements.txt +++ b/monkey_island/deb-package/monkey_island_pip_requirements.txt @@ -9,4 +9,5 @@ flask Flask-Pymongo Flask-Restful jsonschema -netifaces \ No newline at end of file +netifaces +virtualenv \ No newline at end of file diff --git a/monkey_island/linux/ubuntu/systemd/start_server.sh b/monkey_island/linux/ubuntu/systemd/start_server.sh index 817da7a55..e2ea895be 100644 --- a/monkey_island/linux/ubuntu/systemd/start_server.sh +++ b/monkey_island/linux/ubuntu/systemd/start_server.sh @@ -1,4 +1,4 @@ #!/bin/bash cd /var/monkey_island/cc -python main.py \ No newline at end of file +/var/monkey_island/bin/python/python main.py \ No newline at end of file