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

Commit

Permalink
Ignore subsequent SIGINT once inside exit_cleanup()
Browse files Browse the repository at this point in the history
This avoid to leave the pid file because interruptions during the
cleanup, especially with --foreground mode enable and the user
tries to kill ospd many times with ctrl+c
  • Loading branch information
jjnicola committed May 15, 2020
1 parent aab0be3 commit 10b9c8f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Progress bar calculation does not take in account the dead hosts. [#266](https://github.com/greenbone/ospd/pull/266)
- Show progress as integer for get_scans. [#269](https://github.com/greenbone/ospd/pull/269)
- Make scan_id attribute mandatory for get_scans. [#270](https://github.com/greenbone/ospd/pull/270)
- Ignore subsequent SIGINT once inside exit_cleanup(). [#273](https://github.com/greenbone/ospd/pull/273)

### Fixed
- Fix stop scan. Wait for the scan process to be stopped before delete it from the process table. [#204](https://github.com/greenbone/ospd/pull/204)
- Fix get_scanner_details(). [#210](https://github.com/greenbone/ospd/pull/210)
- Fix thread lib leak using daemon mode for python 3.7. [#272](https://github.com/greenbone/ospd/pull/272)

### Removed
- Remove support for resume task. [#266](https://github.com/greenbone/ospd/pull/266)
Expand Down
1 change: 1 addition & 0 deletions ospd/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def exit_cleanup(
pidfile: str, server: BaseServer, _signum=None, _frame=None
) -> None:
""" Removes the pidfile before ending the daemon. """
signal.signal(signal.SIGINT, signal.SIG_IGN)
pidpath = Path(pidfile)

if not pidpath.is_file():
Expand Down

0 comments on commit 10b9c8f

Please sign in to comment.