Univention Bugzilla – Attachment 9038 Details for
Bug 45001
Start S4 Connector in foreground without daemonizing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
45001.patch (text/plain), 1.71 KB, created by
Florian Best
on 2017-07-17 19:01:21 CEST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Florian Best
Created:
2017-07-17 19:01:21 CEST
Size:
1.71 KB
patch
obsolete
>diff --git a/services/univention-s4-connector/modules/univention/s4connector/s4/main.py b/services/univention-s4-connector/modules/univention/s4connector/s4/main.py >index 51bc104..7a4107c 100755 >--- a/services/univention-s4-connector/modules/univention/s4connector/s4/main.py >+++ b/services/univention-s4-connector/modules/univention/s4connector/s4/main.py >@@ -51,6 +51,7 @@ > > parser = OptionParser() > parser.add_option("--configbasename", dest="configbasename", help="", metavar="CONFIGBASENAME", default="connector") >+parser.add_option('-n', '--no-daemon', dest='daemonize', default=True, action='store_false', help='Start process in foreground') > (options, args) = parser.parse_args() > > CONFIGBASENAME = "connector" >@@ -64,6 +65,12 @@ > import mapping > > >+def bind_stdout(): >+ if options.daemonize: >+ sys.stdout = open(STATUSLOGFILE, 'w+') >+ return sys.stdout >+ >+ > def daemon(lock_file): > try: > pid = os.fork() >@@ -107,9 +114,7 @@ def daemon(lock_file): > > > def connect(): >- >- f = open(STATUSLOGFILE, 'w+') >- sys.stdout = f >+ f = bind_stdout() > print time.ctime() > > baseConfig = ConfigRegistry() >@@ -202,8 +207,7 @@ def connect(): > retry_rejected = 0 > connected = True > while connected: >- f = open(STATUSLOGFILE, 'w+') >- sys.stdout = f >+ f = bind_stdout() > print time.ctime() > # Aenderungen pollen > sys.stdout.flush() >@@ -275,7 +279,8 @@ def main(): > print >>sys.stderr, 'Error: Another S4 connector process is already running.' > sys.exit(1) > >- daemon(lock_file) >+ if options.daemonize: >+ daemon(lock_file) > > while True: > try: >@@ -284,8 +289,7 @@ def main(): > lock_file.close() > raise > except: >- f = open(STATUSLOGFILE, 'w+') >- sys.stdout = f >+ f = bind_stdout() > print time.ctime() > > text = ''
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 45001
: 9038