greenbone / notus-scanner

Notus is a vulnerability scanner for creating results from local security checks

Home Page:https://greenbone.github.io/docs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exception when start daemon when empty pid file existed

dvppvd opened this issue · comments

Expected behavior

Daemon can start normally.

Actual behavior

Daemon can't start if there is an empty pid file existed.

Steps to reproduce

  1. Create an empty pid file.
  2. Start notus-scanner with the pid-file parameter points to the empty pid file

Logfiles

Traceback (most recent call last):
  File "/usr/local/bin/notus-scanner", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/dist-packages/notus/scanner/daemon.py", line 147, in main
    if not create_pid(args.pid_file):
  File "/usr/local/lib/python3.10/dist-packages/notus/scanner/utils.py", line 60, in create_pid
    process = psutil.Process(int(current_pid))
ValueError: invalid literal for int() with base 10: ''