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

Commit

Permalink
Merge branch 'ospd-20.08' into scanner-params
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnicola authored Jul 23, 2020
2 parents 7521f7b + 98d5bb3 commit a509108
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- 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)
- Simplify start_scan() [#275](https://github.com/greenbone/ospd/pull/275)
- Make ospd-openvas to shut down gracefully [#302](https://github.com/greenbone/ospd/pull/302)

### 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)
Expand Down
7 changes: 4 additions & 3 deletions ospd/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,12 @@ def exit_cleanup(
signal.signal(signal.SIGINT, signal.SIG_IGN)
pidpath = Path(pidfile)

daemon.daemon_exit_cleanup()

if not pidpath.is_file():
return

with pidpath.open() as f:
if int(f.read()) == os.getpid():
daemon.daemon_exit_cleanup()
LOGGER.info("Shutting-down server ...")
server.close()
LOGGER.debug("Finishing daemon process")
Expand Down Expand Up @@ -144,7 +143,9 @@ def main(
signal.signal(
signal.SIGTERM, partial(exit_cleanup, args.pid_file, server, daemon)
)

signal.signal(
signal.SIGINT, partial(exit_cleanup, args.pid_file, server, daemon)
)
if not daemon.check():
return 1

Expand Down

0 comments on commit a509108

Please sign in to comment.