Merge pull request #264 from guardicore/feature/deb-mongo-dep

Feature/deb mongo dep
This commit is contained in:
itaymmguardicore 2019-02-17 14:06:02 +02:00 committed by GitHub
commit ba359a518c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 2 additions and 45 deletions

View File

@ -5,4 +5,4 @@ Homepage: http://www.guardicore.com
Priority: optional Priority: optional
Version: 1.0 Version: 1.0
Description: Guardicore Infection Monkey Island installation package Description: Guardicore Infection Monkey Island installation package
Depends: openssl, python-pip, python-dev Depends: openssl, python-pip, python-dev, mongodb

View File

@ -20,14 +20,12 @@ if [ -d "/etc/systemd/network" ]; then
cp ${MONKEY_FOLDER}/monkey_island/ubuntu/systemd/*.service /lib/systemd/system/ cp ${MONKEY_FOLDER}/monkey_island/ubuntu/systemd/*.service /lib/systemd/system/
chmod +x ${MONKEY_FOLDER}/monkey_island/ubuntu/systemd/start_server.sh chmod +x ${MONKEY_FOLDER}/monkey_island/ubuntu/systemd/start_server.sh
systemctl daemon-reload systemctl daemon-reload
systemctl enable monkey-mongo
systemctl enable monkey-island systemctl enable monkey-island
fi fi
${MONKEY_FOLDER}/monkey_island/create_certificate.sh ${MONKEY_FOLDER}/monkey_island/create_certificate.sh
service monkey-island start service monkey-island start
service monkey-mongo start
echo Monkey Island installation ended echo Monkey Island installation ended

View File

@ -1,12 +1,9 @@
#!/bin/sh #!/bin/sh
service monkey-island stop || true service monkey-island stop || true
service monkey-mongo stop || true
rm -f /etc/init/monkey-island.conf rm -f /etc/init/monkey-island.conf
rm -f /etc/init/monkey-mongo.conf
[ -f "/lib/systemd/system/monkey-island.service" ] && rm -f /lib/systemd/system/monkey-island.service [ -f "/lib/systemd/system/monkey-island.service" ] && rm -f /lib/systemd/system/monkey-island.service
[ -f "/lib/systemd/system/monkey-mongo.service" ] && rm -f /lib/systemd/system/monkey-mongo.service
rm -r -f /var/monkey rm -r -f /var/monkey

View File

@ -1,6 +0,0 @@
#!/bin/bash
service monkey-mongo stop
cd /var/monkey/monkey_island
rm -rf ./db/*
service monkey-mongo start

View File

@ -1,5 +1,4 @@
#!/bin/bash #!/bin/bash
cd /var/monkey cd /var/monkey
/var/monkey/monkey_island/bin/mongodb/bin/mongod --quiet --dbpath /var/monkey/monkey_island/db &
/var/monkey/monkey_island/bin/python/bin/python monkey_island.py /var/monkey/monkey_island/bin/python/bin/python monkey_island.py

View File

@ -8,7 +8,7 @@ respawn limit unlimited
script script
chdir /var/monkey chdir /var/monkey
exec python monkey_island/cc/main.py exec monkey_island/bin/python/bin/python monkey_island.py
end script end script
post-stop script post-stop script

View File

@ -1,18 +0,0 @@
description "Monkey Island Mongo Service"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit unlimited
script
chdir /var/monkey/monkey_island/
exec /var/monkey/monkey_island/bin/mongodb/bin/mongod --dbpath db
end script
post-stop script
if [ -n $UPSTART_EVENTS ]; then
exec sleep 3
fi
end script

View File

@ -1,6 +1,5 @@
[Unit] [Unit]
Description=Monkey Island Service Description=Monkey Island Service
Wants=monkey-mongo.service
After=network.target After=network.target
[Service] [Service]

View File

@ -1,12 +0,0 @@
[Unit]
Description=Monkey Island Mongo Service
After=network.target
[Service]
ExecStart=/var/monkey/monkey_island/bin/mongodb/bin/mongod --quiet --dbpath /var/monkey/monkey_island/db
KillMode=process
Restart=always
ExecStop=/var/monkey/monkey_island/bin/mongodb/bin/mongod --shutdown
[Install]
WantedBy=multi-user.target