Skip to content
This repository has been archived by the owner on Nov 29, 2021. It is now read-only.

Remove the pid file if there is no process for the pid or the process name does not match. #405

Merged
merged 1 commit into from
May 31, 2021

Conversation

jjnicola
Copy link
Member

What:
Remove the pid file if there is no process for the pid or the process name does not match.

Why:
To avoid removing the pidfile manually when ospd scanner was killed or stopped abruptly.

How:

  • Start ospd-openvas. Try start it again. It should not be possible.
  • Killall -9 ospd-openvas
  • check that the pid file still exists but there is no process
  • start ospd-openvas. The daemon should be started and the pid file should contain the pid of the running ospd-openvas.

Checklist:

@codecov
Copy link

codecov bot commented May 26, 2021

Codecov Report

Merging #405 (f5f4b3e) into ospd-20.08 (64d0b3c) will decrease coverage by 0.32%.
The diff coverage is 6.66%.

Impacted file tree graph

@@              Coverage Diff               @@
##           ospd-20.08     #405      +/-   ##
==============================================
- Coverage       74.55%   74.22%   -0.33%     
==============================================
  Files              23       23              
  Lines            2641     2654      +13     
==============================================
+ Hits             1969     1970       +1     
- Misses            672      684      +12     
Impacted Files Coverage Δ
ospd/misc.py 44.15% <6.66%> (-7.41%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 64d0b3c...f5f4b3e. Read the comment docs.

@jjnicola jjnicola marked this pull request as ready for review May 26, 2021 14:07
@jjnicola jjnicola requested a review from a team as a code owner May 26, 2021 14:07
@jjnicola jjnicola added backport-to-stable This pull request will be backported to the stable branch backport-to-main This pull request will be backported to the master branch labels May 26, 2021
Copy link
Member

@Kraemii Kraemii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected

@Kraemii Kraemii merged commit c242933 into greenbone:ospd-20.08 May 31, 2021
Kraemii added a commit that referenced this pull request May 31, 2021
Remove the pid file if there is no process for the pid or the process name does not match. (backport #405)
Kraemii added a commit that referenced this pull request May 31, 2021
Remove the pid file if there is no process for the pid or the process name does not match. (backport #405)
@jjnicola jjnicola deleted the pid-file branch October 15, 2021 09:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport-to-main This pull request will be backported to the master branch backport-to-stable This pull request will be backported to the stable branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants