diff --git a/contrib/systemd/osmo-ctrl2cgi.service b/contrib/systemd/osmo-ctrl2cgi.service index 8563c66..f82e1e9 100644 --- a/contrib/systemd/osmo-ctrl2cgi.service +++ b/contrib/systemd/osmo-ctrl2cgi.service @@ -4,7 +4,7 @@ Description=Proxy between given GCI service and Osmocom CTRL protocol [Service] Type=simple Restart=always -ExecStart=/usr/bin/ctrl2cgi.py -o -d -c /etc/osmocom/ctrl2cgi.ini +ExecStart=/usr/bin/ctrl2cgi.py -d -c /etc/osmocom/ctrl2cgi.ini RestartSec=2 [Install] diff --git a/osmopy/trap_helper.py b/osmopy/trap_helper.py index d4a3b75..45dc527 100644 --- a/osmopy/trap_helper.py +++ b/osmopy/trap_helper.py @@ -95,7 +95,7 @@ def reloader(path, script, log, dbg1, dbg2, signum, _): sys.argv.remove(dbg2) os.execl(path, script, *sys.argv[1:]) -def debug_init(name, is_debug, output): +def debug_init(name, is_debug): """ Initialize signal handlers and logging """ @@ -104,9 +104,7 @@ def debug_init(name, is_debug, output): log.setLevel(logging.DEBUG) else: log.setLevel(logging.INFO) - log.addHandler(logging.handlers.SysLogHandler('/dev/log')) - if output: - log.addHandler(logging.StreamHandler(sys.stdout)) + log.addHandler(logging.StreamHandler(sys.stdout)) reboot = partial(reloader, os.path.abspath(__file__), os.path.basename(__file__), log, '-d', '--debug') # keep in sync with caller's add_argument() signal.signal(signal.SIGHUP, reboot) diff --git a/scripts/ctrl2cgi.py b/scripts/ctrl2cgi.py index 1d6813d..0551520 100755 --- a/scripts/ctrl2cgi.py +++ b/scripts/ctrl2cgi.py @@ -148,13 +148,12 @@ if __name__ == '__main__': p.add_argument('-p', '--port-ctrl', type=int, default=4250, help="Port to use for CTRL interface, defaults to 4250") p.add_argument('-n', '--num-max-conn', type=int, default=5, help="Max number of concurrent HTTP requests to CGI server") p.add_argument('-d', '--debug', action='store_true', help="Enable debug log") # keep in sync with debug_init call below - p.add_argument('-o', '--output', action='store_true', help="Log to STDOUT in addition to SYSLOG") p.add_argument('-l', '--location', help="Location URL of the CGI server") p.add_argument('-s', '--secret-key', help="Secret key used to generate verification token") p.add_argument('-c', '--config-file', help="Path Config file. Cmd line args override values in config file") args = p.parse_args() - log = debug_init('CTRL2CGI', args.debug, args.output) + log = debug_init('CTRL2CGI', args.debug) location_cfgfile = None secret_key_cfgfile = None diff --git a/scripts/soap.py b/scripts/soap.py index 267b4d8..0534000 100755 --- a/scripts/soap.py +++ b/scripts/soap.py @@ -136,11 +136,10 @@ if __name__ == '__main__': p.add_argument('-w', '--wsdl', required=True, help="WSDL URL for SOAP") p.add_argument('-n', '--num', type=int, default=5, help="Max number of concurrent HTTP requests to SOAP server") p.add_argument('-d', '--debug', action='store_true', help="Enable debug log") # keep in sync with debug_init call below - p.add_argument('-o', '--output', action='store_true', help="Log to STDOUT in addition to SYSLOG") p.add_argument('-l', '--location', help="Override location found in WSDL file (don't use unless you know what you're doing)") args = p.parse_args() - log = debug_init('CTRL2SOAP', args.debug, args.output) + log = debug_init('CTRL2SOAP', args.debug) log.info("SOAP proxy %s starting with PID %d ..." % (__version__, os.getpid())) reactor.connectTCP(args.ctrl, args.port, TrapFactory(args.ctrl, args.port, Trap, defer.DeferredSemaphore(args.num), log, args.wsdl, args.location))