File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change
1
+ ### [ 29-02-2020]
2
+ * SIGHUP handling to stop submitting tasks and stop cuckoo.py, useful for when you need to reload it without breaking running jobs
3
+ * ` ps aux|grep "python3 cuckoo.py"|cut -d" " -f 5| xargs kill -1 `
4
+
1
5
### [ 22-01-2020]
2
6
* Add qemu.py with support for x64/x86/MIPS/MIPSEL/ARM/ARMWRT/ARM64/PowerPC/PowerPC64/Sparc/Sparc64
3
7
* Basic linux integration is done thanks to @enzok
Original file line number Diff line number Diff line change 7
7
import gc
8
8
import time
9
9
import shutil
10
+ import signal
10
11
import logging
11
12
import threading
12
13
import queue
@@ -624,6 +625,10 @@ def __init__(self, maxcount=None):
624
625
self .maxcount = maxcount
625
626
self .total_analysis_count = 0
626
627
628
+ def set_stop_analyzing (self , signum , stack ):
629
+ self .running = False
630
+ log .info ("Now wait till all running tasks are completed" )
631
+
627
632
def initialize (self ):
628
633
"""Initialize the machine manager."""
629
634
global machinery , machine_lock
@@ -715,6 +720,9 @@ def start(self):
715
720
716
721
log .info ("Waiting for analysis tasks." )
717
722
723
+ #To handle stop analyzing when we need to restart process without break tasks
724
+ signal .signal (signal .SIGHUP , self .set_stop_analyzing )
725
+
718
726
# Message queue with threads to transmit exceptions (used as IPC).
719
727
errors = queue .Queue ()
720
728
You can’t perform that action at this time.
0 commit comments