"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "ospd/main.py" between
ospd-2.0.0.tar.gz and ospd-2.0.1.tar.gz

About: OSPd is a base class for scanner wrappers which share the same communication protocol: OSP (OpenVAS Scanner Protocol).

main.py  (ospd-2.0.0):main.py  (ospd-2.0.1)
skipping to change at line 32 skipping to change at line 32
import os import os
import sys import sys
import atexit import atexit
import signal import signal
from functools import partial from functools import partial
from typing import Type, Optional from typing import Type, Optional
from ospd.errors import OspdError
from ospd.misc import go_to_background, create_pid, remove_pidfile from ospd.misc import go_to_background, create_pid, remove_pidfile
from ospd.ospd import OSPDaemon from ospd.ospd import OSPDaemon
from ospd.parser import create_parser, ParserType from ospd.parser import create_parser, ParserType
from ospd.server import TlsServer, UnixSocketServer from ospd.server import TlsServer, UnixSocketServer
COPYRIGHT = """Copyright (C) 2014, 2015, 2018, 2019 Greenbone Networks GmbH COPYRIGHT = """Copyright (C) 2014, 2015, 2018, 2019 Greenbone Networks GmbH
License GPLv2+: GNU GPL version 2 or later License GPLv2+: GNU GPL version 2 or later
This is free software: you are free to change and redistribute it. This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.""" There is NO WARRANTY, to the extent permitted by law."""
skipping to change at line 124 skipping to change at line 125
if args.version: if args.version:
args.foreground = True args.foreground = True
init_logging( init_logging(
name, args.log_level, log_file=args.log_file, foreground=args.foreground name, args.log_level, log_file=args.log_file, foreground=args.foreground
) )
if args.port == 0: if args.port == 0:
server = UnixSocketServer( server = UnixSocketServer(
args.unix_socket, args.unix_socket, args.socket_mode, args.stream_timeout,
args.socket_mode,
args.stream_timeout,
) )
else: else:
server = TlsServer( server = TlsServer(
args.address, args.address,
args.port, args.port,
args.cert_file, args.cert_file,
args.key_file, args.key_file,
args.ca_file, args.ca_file,
args.stream_timeout, args.stream_timeout,
) )
skipping to change at line 152 skipping to change at line 151
sys.exit() sys.exit()
if not args.foreground: if not args.foreground:
go_to_background() go_to_background()
if not create_pid(args.pid_file): if not create_pid(args.pid_file):
sys.exit() sys.exit()
# Set signal handler and cleanup # Set signal handler and cleanup
atexit.register(remove_pidfile, pidfile=args.pid_file) atexit.register(remove_pidfile, pidfile=args.pid_file)
signal.signal( signal.signal(signal.SIGTERM, partial(remove_pidfile, args.pid_file))
signal.SIGTERM, partial(remove_pidfile, args.pid_file)
)
daemon.init() try:
daemon.init()
if not daemon.check(): if not daemon.check():
return 1 return 1
daemon.run(server) daemon.run(server)
except OspdError as e:
print('ERROR: {}'.format(e), file=sys.stderr)
sys.exit(1)
return 0 return 0
 End of changes. 6 change blocks. 
10 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)