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
- Create an empty pid file.
- 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: ''