allinurl / goaccess

GoAccess is a real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems or through your browser.
https://goaccess.io
MIT License
18.58k stars 1.11k forks source link

when i use --load-from-disk --keep-db-files with --daemonize,it's not working well #1324

Open zeven0707 opened 5 years ago

zeven0707 commented 5 years ago

hello allinurl: when i use following command to save data on-disk,it's working well.when i restart it ,i can see the historical data.eg: goaccess /usr/local/openresty/nginx/logs/go_access.log -o /data/web/report/report20181204.html --log-format=COMBINED --real-time-html --db-path=/tmp/goaccess --load-from-disk --keep-db-files --debug-file=/tmp/goaccess.log but when i add the parameter '--daemonize',eg: goaccess /usr/local/openresty/nginx/logs/go_access.log -o /data/web/report/report20181204.html --log-format=COMBINED --real-time-html --db-path=/tmp/goaccess --load-from-disk --keep-db-files --debug-file=/tmp/goaccess.log --daemonize the process exists and the function of real-time data works well.Then i kill this process and restart as this command(with --daemonize),no any historical data i can see. Is this a conflict when i use '--load-from-disk --keep-db-files' and '--daemonize' together?

please help me,thanks!

freemp commented 5 years ago

I've experienced the same issue. First, I was reading old data into the database (using --load-from-disk --keep-db-files --process-and-exit, but without --daemonize). After that, when trying to run the daemon (using --load-from-disk --keep-db-files --daemonize) on the current log file, the old data is gone.

With version 1.2, this did not happen.

zeven0707 commented 5 years ago

Unfortunately,i have this problem in version 1.3.

allinurl commented 5 years ago

@zeven0707 how are you killing the process?

zeven0707 commented 5 years ago

@allinurl I use ps -ef|grep goaccess to find the pid of goaccess,then kill -9 pid

allinurl commented 5 years ago

The database may get corrupted if you use SIGKILL and may not save the data. Please try SIGINT or simply kill pid

zeven0707 commented 5 years ago

Okay,i'll try.

zeven0707 commented 5 years ago

According to your method,it is usefull. when i use the command kill pid other than kill -9 pid,the data can be persisted on disk.Thank you very much.

freemp commented 5 years ago

Not working for me. I don't kill the process but use --process-and-exit instead.

zeven0707 commented 5 years ago

@freemp Can you show the whole command of --process-and-exit,then i have a try.