Add extra definitions to debug build service files
The unlimited core dumps are now only enabled for debug builds.
This commit is contained in:
@ -25,6 +25,15 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
configure_file(${CMAKE_SOURCE_DIR}/etc/maxscale.conf.in ${CMAKE_BINARY_DIR}/maxscale.conf @ONLY)
|
configure_file(${CMAKE_SOURCE_DIR}/etc/maxscale.conf.in ${CMAKE_BINARY_DIR}/maxscale.conf @ONLY)
|
||||||
|
|
||||||
|
# The systemd service file
|
||||||
|
if (CMAKE_BUILD_TYPE MATCHES "(D|d)(E|e)(B|b)(U|u)(G|g)")
|
||||||
|
# Options enabled only in debug builds (a literal multi-line string)
|
||||||
|
set(SERVICE_FILE_DEBUG_OPTIONS
|
||||||
|
"LimitCORE=infinity
|
||||||
|
ExecStartPost=/bin/sh -c 'prlimit -p $(pidof maxscale) --core=unlimited'")
|
||||||
|
endif()
|
||||||
|
|
||||||
configure_file(${CMAKE_SOURCE_DIR}/etc/maxscale.service.in ${CMAKE_BINARY_DIR}/maxscale.service @ONLY)
|
configure_file(${CMAKE_SOURCE_DIR}/etc/maxscale.service.in ${CMAKE_BINARY_DIR}/maxscale.service @ONLY)
|
||||||
|
|
||||||
if(PACKAGE)
|
if(PACKAGE)
|
||||||
|
|||||||
@ -5,12 +5,11 @@ After=network.target
|
|||||||
[Service]
|
[Service]
|
||||||
Type=forking
|
Type=forking
|
||||||
Restart=on-abort
|
Restart=on-abort
|
||||||
LimitCORE=infinity
|
@SERVICE_FILE_DEBUG_OPTIONS@
|
||||||
|
|
||||||
# Make sure /var/run/maxscale exists
|
# Make sure /var/run/maxscale exists
|
||||||
PermissionsStartOnly=true
|
PermissionsStartOnly=true
|
||||||
ExecStartPre=/usr/bin/install -d @MAXSCALE_VARDIR@/run/maxscale -o maxscale -g maxscale
|
ExecStartPre=/usr/bin/install -d @MAXSCALE_VARDIR@/run/maxscale -o maxscale -g maxscale
|
||||||
ExecStartPost=/bin/sh -c 'prlimit -p $(pidof maxscale) --core=unlimited'
|
|
||||||
|
|
||||||
PIDFile=@MAXSCALE_VARDIR@/run/maxscale/maxscale.pid
|
PIDFile=@MAXSCALE_VARDIR@/run/maxscale/maxscale.pid
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user