From eab6f386a84ee5a91688c34308e5201465851fd2 Mon Sep 17 00:00:00 2001 From: urihershgc Date: Tue, 19 Jan 2016 16:07:02 +0200 Subject: [PATCH] monkey debian minor improvements --- monkey_island/deb-package/DEBIAN/postinst | 10 ++++++---- monkey_island/deb-package/pre_build.sh | 11 +++++++++++ .../linux/monkey.sh | 4 +--- 3 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 monkey_island/deb-package/pre_build.sh rename chaos_monkey/execute_monkey.sh => monkey_island/linux/monkey.sh (79%) diff --git a/monkey_island/deb-package/DEBIAN/postinst b/monkey_island/deb-package/DEBIAN/postinst index 1476d1d2c..54a4667d5 100644 --- a/monkey_island/deb-package/DEBIAN/postinst +++ b/monkey_island/deb-package/DEBIAN/postinst @@ -3,16 +3,18 @@ MONKEY_FOLDER=/var/monkey_island INSTALLATION_FOLDER=/var/monkey_island/installation +chmod 755 /usr/bin/monkey + # install pip requirements 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 -rm -f $MONKEY_FOLDER/pip_requirements.txt +rm -rf ${INSTALLATION_FOLDER} +rm -f ${MONKEY_FOLDER}/pip_requirements.txt -mv $MONKEY_FOLDER/ubuntu/* /etc/init/ +mv ${MONKEY_FOLDER}/ubuntu/* /etc/init/ -/var/monkey_island/create_certificate.sh +${MONKEY_FOLDER}/create_certificate.sh service monkey-island start service monkey-mongo start diff --git a/monkey_island/deb-package/pre_build.sh b/monkey_island/deb-package/pre_build.sh new file mode 100644 index 000000000..dc49fa967 --- /dev/null +++ b/monkey_island/deb-package/pre_build.sh @@ -0,0 +1,11 @@ +############################################################################### +## This file is executed by the build_deb.sh file just before building the +## deb file. +## The script is executed when monkey repo is in the current directory +## Arguments (environment variables) +## $VERSION: current build version +## $TEMP: base folder where package is being built +############################################################################### +#!/bin/bash + +copy_file ./monkey_island/linux/monkey.sh $TEMP/usr/bin/monkey diff --git a/chaos_monkey/execute_monkey.sh b/monkey_island/linux/monkey.sh similarity index 79% rename from chaos_monkey/execute_monkey.sh rename to monkey_island/linux/monkey.sh index d0eb2a4e8..c502d9a99 100644 --- a/chaos_monkey/execute_monkey.sh +++ b/monkey_island/linux/monkey.sh @@ -4,13 +4,11 @@ MACHINE_TYPE=`uname -m` if [ ${MACHINE_TYPE} == 'x86_64' ]; then # 64-bit stuff here ARCH=64 - else # 32-bit stuff here ARCH=32 - fi MONKEY_FILE=monkey-linux-$ARCH -cp -f ./cc/binaries/$MONKEY_FILE /tmp +cp -f /var/monkey-island/cc/binaries/$MONKEY_FILE /tmp /tmp/$MONKEY_FILE m0nk3y