From 7466be331dd773c663971dd24443e2248a90a021 Mon Sep 17 00:00:00 2001 From: Mark Reynolds Date: Jul 16 2019 19:22:39 +0000 Subject: Issue 50425 - Add jemalloc LD_PRELOAD to systemd drop-in file Description: Add the jemalloc back to the systemd dropin file which was accidentally removed from a previous change regarding systemd Relates: https://pagure.io/389-ds-base/issue/50425 Reviewed by: mhonek(Thanks!) --- diff --git a/Makefile.am b/Makefile.am index 7279f38..6c948a3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -654,8 +654,10 @@ endif #------------------------ config_DATA = $(srcdir)/lib/ldaputil/certmap.conf \ $(srcdir)/ldap/schema/slapd-collations.conf \ - ldap/admin/src/template-initconfig \ ldap/servers/snmp/ldap-agent.conf +if !SYSTEMD +config_DATA += ldap/admin/src/template-initconfig +endif # the schema files in this list are either not # standard schema, not tested, or not compatible @@ -882,10 +884,12 @@ systemdsystemunit_DATA = wrappers/$(PACKAGE_NAME)@.service \ wrappers/$(systemdgroupname) \ wrappers/$(PACKAGE_NAME)-snmp.service -systemdsystemunitdropin_DATA = wrappers/$(PACKAGE_NAME)@.service.d/custom.conf if with_sanitizer -systemdsystemunitdropin_DATA += wrappers/$(PACKAGE_NAME)@.service.d/xsan.conf +systemdsystemunitdropin_DATA = wrappers/$(PACKAGE_NAME)@.service.d/xsan.conf +else +systemdsystemunitdropin_DATA = wrappers/$(PACKAGE_NAME)@.service.d/custom.conf endif + else if INITDDIR init_SCRIPTS = wrappers/$(PACKAGE_NAME) \ @@ -983,12 +987,14 @@ dist_man_MANS = man/man1/dbscan.1 \ man/man5/slapd-collations.conf.5 \ man/man8/suffix2instance.8 \ man/man8/syntax-validate.pl.8 \ - man/man5/template-initconfig.5 \ man/man8/upgradednformat.8 \ man/man8/upgradedb.8 \ man/man8/usn-tombstone-cleanup.pl.8 \ man/man8/vlvindex.8 \ man/man8/verify-db.pl.8 +if !SYSTEMD +dist_man_MANS += man/man5/template-initconfig.5 +endif #------------------------ # updates @@ -2292,20 +2298,14 @@ fixupcmd = sed \ if [ ! -d $(dir $@) ] ; then mkdir -p $(dir $@) ; fi $(fixupcmd) $^ > $@ +if !SYSTEMD %/$(PACKAGE_NAME): %/base-initconfig.in if [ ! -d $(dir $@) ] ; then mkdir -p $(dir $@) ; fi -if SYSTEMD - $(fixupcmd) $^ | sed -e 's/@preamble@/# This file is in systemd EnvironmentFile format - see man systemd.exec/' > $@ -else $(fixupcmd) $^ | sed -n -e 's/@preamble@//' -e '/^#/{p;d;}' -e '/^$$/{p;d;}' -e 's/^\([^=]*\)\(=.*\)$$/\1\2 ; export \1/ ; p' > $@ $(fixupcmd) $(srcdir)/ldap/admin/src/initconfig.in >> $@ -endif %/template-initconfig: %/template-initconfig.in if [ ! -d $(dir $@) ] ; then mkdir -p $(dir $@) ; fi -if SYSTEMD - $(fixupcmd) $^ | sed -e 's/@preamble@/# This file is in systemd EnvironmentFile format - see man systemd.exec/' > $@ -else $(fixupcmd) $^ | sed -n -e 's/@preamble@//' -e '/^#/{p;d;}' -e '/^$$/{p;d;}' -e 's/^\([^=]*\)\(=.*\)$$/\1\2 ; export \1/ ; p' > $@ endif diff --git a/rpm/389-ds-base.spec.in b/rpm/389-ds-base.spec.in index 876adb3..16406d7 100644 --- a/rpm/389-ds-base.spec.in +++ b/rpm/389-ds-base.spec.in @@ -601,7 +601,6 @@ exit 0 %dir %{_sysconfdir}/systemd/system/%{groupname}.wants %config(noreplace)%{_sysconfdir}/%{pkgname}/config/slapd-collations.conf %config(noreplace)%{_sysconfdir}/%{pkgname}/config/certmap.conf -%config(noreplace)%{_sysconfdir}/%{pkgname}/config/template-initconfig %{_datadir}/%{pkgname} %exclude %{_datadir}/%{pkgname}/script-templates %exclude %{_datadir}/%{pkgname}/updates @@ -655,7 +654,6 @@ exit 0 %{_mandir}/man8/vlvindex.8.gz %{_mandir}/man5/99user.ldif.5.gz %{_mandir}/man5/certmap.conf.5.gz -%{_mandir}/man5/template-initconfig.5.gz %{_mandir}/man5/slapd-collations.conf.5.gz %{_mandir}/man5/dirsrv.5.gz %{_mandir}/man5/dirsrv.systemd.5.gz diff --git a/wrappers/systemd.template.service.custom.conf.in b/wrappers/systemd.template.service.custom.conf.in index 0dce628..fd10fe1 100644 --- a/wrappers/systemd.template.service.custom.conf.in +++ b/wrappers/systemd.template.service.custom.conf.in @@ -49,4 +49,5 @@ TimeoutStopSec=600 #ProtectHome=yes #PrivateTmp=yes - +# Preload jemalloc +Environment=LD_PRELOAD=@libdir@/@package_name@/lib/libjemalloc.so.2