legal contact
 

autostarting cuckoo 2.0

To have your Cuckoo start automatically after reboot and watch it to be running/restarting, use the supervisord to help you with this job.

You can edit the supervisord.conf that installs with the cuckoo deployment. Use the below alterations as an excample of my additions.

[supervisord]
logfile = /var/log/supervisor/supervisord.log
pidfile = /home/cuckoo/.cuckoo/supervisord/pidfile
user = root

[supervisorctl]
serverurl = unix:///home/cuckoo/.cuckoo/supervisord/unix.sock

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[unix_http_server]
file = /home/cuckoo/.cuckoo/supervisord/unix.sock

[program:cuckoo-rooter]
command = /home/cuckoo/venv/bin/cuckoo rooter
user = root
startsecs = 10
autorestart = true

[program:cuckoo-daemon]
command = /home/cuckoo/venv/bin/cuckoo -d -m 10000
user = cuckoo
startsecs = 30
autorestart = true

[program:cuckoo-process]
command = /home/cuckoo/venv/bin/cuckoo process p%(process_num)d
process_name = cuckoo-process_%(process_num)d
numprocs = 4
user = cuckoo
autorestart = true

[program:cuckoo-web]
command = /home/cuckoo/venv/bin/cuckoo web -H 0.0.0.0 -p 8000
user = cuckoo
startsecs = 30
autorestart = true

[program:cuckoo-api]
command = /home/cuckoo/venv/bin/cuckoo api -H 0.0.0.0 -p 8080
user = cuckoo
startsecs = 30
autorestart = true

[group:cuckoo]
programs = cuckoo-rooter, cuckoo-daemon, cuckoo-process, cuckoo-web, cuckoo-api

[program:distributed]
command = /home/cuckoo/venv/bin/python -m cuckoo.distributed.worker
user = cuckoo
autostart = false
autorestart = true
environment = CUCKOO_APP="worker",CUCKOO_CWD="/home/cuckoo/.cuckoo"

To bring it to live use:

service supervisor stop
cp supervisord.conf /etc/supervisor/conf.d/cukcoo.conf
service supervisor start

Check that everything went allright:

"ps aux" should give you:

cuckoo /home/cuckoo/venv/bin/python2 /home/cuckoo/venv/bin/cuckoo -d -m 10000
cuckoo /home/cuckoo/venv/bin/python2 /home/cuckoo/venv/bin/cuckoo process p0
cuckoo /home/cuckoo/venv/bin/python2 /home/cuckoo/venv/bin/cuckoo process p3
cuckoo /home/cuckoo/venv/bin/python2 /home/cuckoo/venv/bin/cuckoo process p2
root /home/cuckoo/venv/bin/python2 /home/cuckoo/venv/bin/cuckoo rooter
cuckoo /home/cuckoo/venv/bin/python2 /home/cuckoo/venv/bin/cuckoo web -H 0.0.0.0 -p 8000
cuckoo /home/cuckoo/venv/bin/python2 /home/cuckoo/venv/bin/cuckoo process p1
cuckoo /home/cuckoo/venv/bin/python2 /home/cuckoo/venv/bin/cuckoo api -H 0.0.0.0 -p 8080