Univention Bugzilla – Bug 37280
Init DaemonContext with prevent_core=False
Last modified: 2015-05-28 16:48:35 CEST
Several parts of the umc (umc-server, umc-web-server, umc-module) initialize a DeamonContext with "prevent_core=True" (the default). We should read the current processes ulimit instead and create the context with prevent_core=False if "Max core file size" > 0
(In reply to Janis Meybohm from comment #0) > Several parts of the umc (umc-server, umc-web-server, umc-module) initialize > a DeamonContext with "prevent_core=True" (the default). > > We should read the current processes ulimit instead and create the context > with prevent_core=False if "Max core file size" > 0 Janis, does the current behaviour lead to particular, known problems?
(In reply to Alexander Kläser from comment #1) > (In reply to Janis Meybohm from comment #0) > > Several parts of the umc (umc-server, umc-web-server, umc-module) initialize > > a DeamonContext with "prevent_core=True" (the default). > > > > We should read the current processes ulimit instead and create the context > > with prevent_core=False if "Max core file size" > 0 > > Janis, does the current behaviour lead to particular, known problems? Well it prevents creating a core dump if UMC segfaults, iirc!? → The computerroom module is segfaulting sometimes.
(In reply to Florian Best from comment #2) > > Janis, does the current behaviour lead to particular, known problems? > Well it prevents creating a core dump if UMC segfaults, iirc!? > → The computerroom module is segfaulting sometimes. Correct. It prevents core-dump regardless of the configured ulimit. To answer the initial question: No, the current behaviour does not lead to know problems.
2015011921000324 Patch developed by customer. In production for several weeks --- univention-management-console-server.old 2014-12-01 16:57:56.000000000 +0100 +++ univention-management-console-server 2014-12-01 16:56:48.000000000 +0100 @@ -105,6 +105,7 @@ class UMC_Daemon( DaemonRunner ): # init daemon runner DaemonRunner.__init__( self, self ) + self.daemon_context.prevent_core = False self.daemon_context.detach_process = self.options.daemon_mode self.daemon_context.umask = 0077 self.daemon_context.files_preserve = [ debug_fd ] --- univention-management-console-web-server.old 2014-12-01 16:58:21.000000000 +0100 +++ univention-management-console-web-server 2014-12-01 16:56:57.000000000 +0100 @@ -826,6 +826,7 @@ class UMC_HTTP_Daemon(DaemonRunner): # init daemon runner DaemonRunner.__init__( self, self ) + self.daemon_context.prevent_core = False self.daemon_context.detach_process = self.options.daemon_mode self.daemon_context.files_preserve = [ debug_fd ] --- univention-management-console-module.old 2014-12-09 13:47:54.000000000 +0100 +++ univention-management-console-module 2014-12-09 13:48:08.000000000 +0100 @@ -67,7 +67,7 @@ if __name__ == '__main__': ( options, arguments ) = parser.parse_args() - daemon = DaemonContext( detach_process = False, umask = 0077 ) + daemon = DaemonContext( detach_process = False, prevent_core=False, umask = 0077 ) daemon.open() # MUST be called after initializing the deamon
Created attachment 6612 [details] patch
QA: # ulimit -c unlimited # echo 'core-%e-%p-%t' > /proc/sys/kernel/core_pattern # invoke-rc.d univention-managment-console-server restart # invoke-rc.d univention-managment-console-web-server restart ... login to UMC, start one module .. # pkill -11 -f /usr/sbin/univention-management-console-server # pkill -11 -f /usr/sbin/univention-management-console-module # pkill -11 -f /usr/sbin/univention-management-console-web-server # file /core-* → if exists: VERIFIED
YAML: 2015-05-12-univention-management-console-frontend.yaml Package: univention-management-console-frontend Version: 4.1.106-62.1049.201505131039 YAML: 2015-05-12-univention-management-console.yaml Package: univention-management-console Version: 7.1.63-17.859.201505131137
OK, works - if enabled by the commands from Comment 6.
<http://errata.univention.de/ucs/4.0/197.html>
<http://errata.univention.de/ucs/4.0/199.html>