Getting Dionaea to run should be very straightforward for most people. One of the thing we need for our project is As for us, to get our Dionaea appliance running properly, one the feature we need is to get Dionaea service running when the OS is booting. Below is the script for it (shameless ripped off from Nepenthes’s script):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
#! /bin/sh ### BEGIN INIT INFO # Required-Start: $network # Required-Stop: $network # Should-Start: # Should-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 ### END INIT INFO PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/opt/dionaea/bin/dionaea NAME=dionaea GROUP=dionaea CONFIG_FILE="/opt/dionaea/etc/dionaea/dionaea.conf" #dionaea -u nobody -g nogroup -r /opt/dionaea/ -w /opt/dionaea -p /opt/dionaea/var/dionaea.pid DAEMON_OPTS="-u $NAME -g $GROUP -l all,-debug -L '*' -w /opt/dionaea -c $CONFIG_FILE" test -x $DAEMON || exit 0 set -e case "$1" in start) echo -n "Starting $NAME: " start-stop-daemon --start --quiet --oknodo --pidfile /opt/dionaea/var/$NAME.pid \ --background --make-pidfile --exec $DAEMON -- $DAEMON_OPTS echo "$NAME." ;; stop) echo -n "Stopping $NAME: " start-stop-daemon --stop --quiet --oknodo --pidfile /opt/dionaea/var/$NAME.pid \ --signal 15 --exec $DAEMON echo "$NAME." ;; restart|force-reload) echo -n "Restarting $NAME: " start-stop-daemon --stop --quiet --oknodo --pidfile /opt/dionaea/var/$NAME.pid \ --signal 15 --exec $DAEMON sleep 1 start-stop-daemon --start --quiet --oknodo --pidfile /opt/dionaea/var/$NAME.pid \ --background --make-pidfile --exec $DAEMON -- $DAEMON_OPTS echo "$NAME." ;; *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0 |
Copy the script, rename it to dioanea and move it to /etc/init.d/
On Ubuntu, we need to activate this to reflect our desire init level for Dionaea script. Lets use defaults init :
1 |
shell$sudo update-rc.d dionaea defaults |
To execute or start the dionaea service, just simply:
1 |
shell$sudo /etc/init.d/dionaea start |