New image here docker-darkstat and code here : Gitlab
Darkstat - https://unix4lyfe.org/darkstat/
Running on the latest debian stable slim for arm, with darkstat from git repository on the master branch.
docker pull didierc/rpi-darkstat
docker run -d --net="host" --name=<container name> -v <local path to store db/log>:/darkstat/config -v /etc/localtime:/etc/localtime:ro -e OPTIONS=<options for darkstat> -e DS_UID=<uid> -e DS_GID=<uid> didierc/rpi-darkstat
- OPTIONS = To see the list of options available for darkstat. Please check the website of darkstat. Or search "man darkstat" on the web
- DS_UID = uid for the user darkstat. Default is 1000
- DS_GID = gid for the user darkstat. Default is 1000
By default the user darkstat is created in the container and used by darkstat. And darkstat is launched in no deamon and with the chroot "/darkstat/config" to save log and database with the volume.
http://<host ip>:[PORT]
docker run -d --net="host" --name=darkstat -v /mylocal/directory/fordata:/config -v /etc/localtime:/etc/localtime:ro -e OPTIONS="-i eth0 -p 666 --daylog darkstat.log --verbose --import darkstat.db --export darkstat.db" didierc/rpi-darkstat
See the documentation of darkstat to enable the exportation the database
-
Get the PID of darkstat process
pc >$ docker top <container id>
-
Send a SIGUSR1 or SIGUSR2 to the darkstat process
pc >$ kill -10 13080
- add an entrypoint to export the database with an SIGUSR1 signal like in the darkstat documentation.
- Delete the run.sh and make an entrypoint for the start to be always the PID 1