Bug 37280 - Init DaemonContext with prevent_core=False
Init DaemonContext with prevent_core=False
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC (Generic)
UCS 3.2
Other Linux
: P5 normal (vote)
: UCS 4.0-2-errata
Assigned To: Florian Best
Dirk Wiesenthal
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-12-10 09:27 CET by Janis Meybohm
Modified: 2015-05-28 16:48 CEST (History)
4 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Troubleshooting
Max CVSS v3 score:
meybohm: Patch_Available+


Attachments
patch (2.21 KB, patch)
2015-01-20 11:59 CET, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Janis Meybohm univentionstaff 2014-12-10 09:27:39 CET
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
Comment 1 Alexander Kläser univentionstaff 2014-12-10 11:49:02 CET
(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?
Comment 2 Florian Best univentionstaff 2014-12-10 15:26:22 CET
(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.
Comment 3 Janis Meybohm univentionstaff 2014-12-10 15:58:05 CET
(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.
Comment 4 Janis Meybohm univentionstaff 2015-01-19 15:18:08 CET
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
Comment 5 Florian Best univentionstaff 2015-01-20 11:59:01 CET
Created attachment 6612 [details]
patch
Comment 6 Florian Best univentionstaff 2015-05-13 10:17:25 CEST
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
Comment 7 Florian Best univentionstaff 2015-05-13 11:49:30 CEST
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
Comment 8 Dirk Wiesenthal univentionstaff 2015-05-27 08:43:30 CEST
OK, works - if enabled by the commands from Comment 6.
Comment 9 Janek Walkenhorst univentionstaff 2015-05-28 16:47:29 CEST
<http://errata.univention.de/ucs/4.0/197.html>
Comment 10 Janek Walkenhorst univentionstaff 2015-05-28 16:48:35 CEST
<http://errata.univention.de/ucs/4.0/199.html>