This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.4.0 in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.0 by this push: new 4cf65b3 Ticket 50208 - make instances mark off based on dse.ldif not sysconfig 4cf65b3 is described below
commit 4cf65b3afea9ae86088c1444cca2e15403f9d1f3 Author: William Brown william@blackhats.net.au AuthorDate: Mon Feb 11 12:02:25 2019 +1000
Ticket 50208 - make instances mark off based on dse.ldif not sysconfig
Bug Description: As sysconfig isn't cross platform compatible, and there are some potential plans to remove it from our systemd files, we need to make sure that lib389 can handle this file not being present in new installs.
Fix Description: Thankfully, we have a file we can always guarantee exists: dse.ldif. This makes /etc/dirsrv/slapd-instance the only fixed location in the server now, all other locations can be "moved".
This patch: * Fixes a large number of removal regressions * Add comments and warnings throughout remove and setup to help prevent future regresions * Create no longer creates /etc/sysconfig/dirsrv-instance * Create makes dse.ldif *first* as it's the marker location * Remove works when there is no marker file (but will remove if it exists) * Listing now ignores /etc/sysconfig, and reads dse.ldif instead with a follow up https://pagure.io/389-ds-base/issue/50207 to parse data from this file for offline
https://pagure.io/389-ds-base/issue/50208
Author: William Brown william@blackhats.net.au
Review by: spichugi, abbra (Thanks) --- Makefile.am | 10 ---------- rpm/389-ds-base.spec.in | 2 -- wrappers/systemd.template.service.in | 15 ++------------ wrappers/systemd.template.sysconfig | 30 ---------------------------- wrappers/systemd.template.xsan.service.in | 33 ++++++++++++++++++++++++++++--- 5 files changed, 32 insertions(+), 58 deletions(-)
diff --git a/Makefile.am b/Makefile.am index 864eee5..a2bc2e0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -648,7 +648,6 @@ dist_noinst_DATA = \ $(srcdir)/LICENSE.* \ $(srcdir)/VERSION.sh \ $(srcdir)/wrappers/*.in \ - $(srcdir)/wrappers/systemd.template.sysconfig \ $(srcdir)/dirsrvtests \ $(srcdir)/src/lib389/setup.py \ $(srcdir)/src/lib389 @@ -901,14 +900,9 @@ init_SCRIPTS = wrappers/$(PACKAGE_NAME) \ endif endif
-if SYSTEMD -initconfig_DATA = ldap/admin/src/$(PACKAGE_NAME) \ - wrappers/$(PACKAGE_NAME).systemd -else if INITDDIR initconfig_DATA = ldap/admin/src/$(PACKAGE_NAME) endif -endif
inf_DATA = ldap/admin/src/slapd.inf \ ldap/admin/src/scripts/dscreate.map \ @@ -2343,10 +2337,6 @@ endif fi; \ $(fixupcmd) $$service_template > $@
-%/$(PACKAGE_NAME).systemd: %/systemd.template.sysconfig - if [ ! -d $(dir $@) ] ; then mkdir -p $(dir $@) ; fi - $(fixupcmd) $^ > $@ - %/$(systemdgroupname): %/systemd.group.in if [ ! -d $(dir $@) ] ; then mkdir -p $(dir $@) ; fi $(fixupcmd) $^ > $@ diff --git a/rpm/389-ds-base.spec.in b/rpm/389-ds-base.spec.in index df8de5c..63cc389 100644 --- a/rpm/389-ds-base.spec.in +++ b/rpm/389-ds-base.spec.in @@ -598,8 +598,6 @@ exit 0 %config(noreplace)%{_sysconfdir}/%{pkgname}/config/slapd-collations.conf %config(noreplace)%{_sysconfdir}/%{pkgname}/config/certmap.conf %config(noreplace)%{_sysconfdir}/%{pkgname}/config/template-initconfig -%config(noreplace)%{_sysconfdir}/sysconfig/%{pkgname} -%config(noreplace)%{_sysconfdir}/sysconfig/%{pkgname}.systemd %{_datadir}/%{pkgname} %exclude %{_datadir}/%{pkgname}/script-templates %exclude %{_datadir}/%{pkgname}/updates diff --git a/wrappers/systemd.template.service.in b/wrappers/systemd.template.service.in index 978bbbb..85fd1ba 100644 --- a/wrappers/systemd.template.service.in +++ b/wrappers/systemd.template.service.in @@ -21,22 +21,11 @@ Before=radiusd.service [Service] Type=notify NotifyAccess=all -TimeoutStartSec=0 -TimeoutStopSec=600 -EnvironmentFile=@initconfigdir@/@package_name@ -EnvironmentFile=@initconfigdir@/@package_name@-%i +EnvironmentFile=-@initconfigdir@/@package_name@ +EnvironmentFile=-@initconfigdir@/@package_name@-%i PIDFile=@localstatedir@/run/@package_name@/slapd-%i.pid ExecStartPre=@libexecdir@/ds_systemd_ask_password_acl @instconfigdir@/slapd-%i/dse.ldif ExecStart=@sbindir@/ns-slapd -D @instconfigdir@/slapd-%i -i @localstatedir@/run/@package_name@/slapd-%i.pid -# Hardening options: -# PrivateDevices=true -# ProtectSystem=true -# ProtectHome=true -# PrivateTmp=true - -# if you need to set other directives e.g. LimitNOFILE=8192 -# set them in this file -.include @initconfigdir@/@package_name@.systemd
[Install] WantedBy=multi-user.target diff --git a/wrappers/systemd.template.sysconfig b/wrappers/systemd.template.sysconfig deleted file mode 100644 index 76c004d..0000000 --- a/wrappers/systemd.template.sysconfig +++ /dev/null @@ -1,30 +0,0 @@ -[Service] -# These are from man systemd.exec and man systemd.resource-control - -# This controls the resources to the direct child of systemd, in -# this case ns-slapd. Because we are type notify we recieve these -# limits correctly. - -# This controls the number of file handles avaliable. File handles -# correlate to sockets for the process, and our access to logs and -# databases. Note, the configuration setting in Directory Server, -# "nsslapd-maxdescriptors", can override this limit. -LimitNOFILE=16384 - -# You can limit the memory in the cgroup with these, and ns-slapd -# will account for them in it's autotuning. -# Memory account may be controlled by DefaultMemoryAccounting= in systemd-system.conf -# MemoryAccounting=true -# MemoryLimit=bytes - -# Limits on the size of coredump that may be produced by the process. It's not -# specified how this interacts with coredumpd. -# 0 means not to produce cores. -# This value is 64G -LimitCORE=68719476736 - -# Limit number of processes (threads) we may spawn. We don't advise you change -# this as DS will autodetect your threads / cpus and adjust as needed. -# LimitNPROC= - - diff --git a/wrappers/systemd.template.xsan.service.in b/wrappers/systemd.template.xsan.service.in index 1a4d7dc..541392f 100644 --- a/wrappers/systemd.template.xsan.service.in +++ b/wrappers/systemd.template.xsan.service.in @@ -35,15 +35,42 @@ LimitCORE=infinity ExecStartPre=@libexecdir@/ds_systemd_ask_password_acl @instconfigdir@/slapd-%i/dse.ldif ExecStart=@sbindir@/ns-slapd -D @instconfigdir@/slapd-%i -i @localstatedir@/run/@package_name@/slapd-%i.pid
+#### To change any of these values or directives, you should use a drop in file +# such as: /etc/systemd/system/dirsrv@<instance>.d/custom.conf + +# These are from man systemd.exec and man systemd.resource-control + +# This controls the resources to the direct child of systemd, in +# this case ns-slapd. Because we are type notify we recieve these +# limits correctly. + +# This controls the number of file handles avaliable. File handles +# correlate to sockets for the process, and our access to logs and +# databases. +LimitNOFILE=16384 + +# You can limit the memory in the cgroup with these, and ns-slapd +# will account for them in it's autotuning. +# Memory account may be controlled by DefaultMemoryAccounting= in systemd-system.conf +# MemoryAccounting=true +# MemoryLimit=bytes + +# Limits on the size of coredump that may be produced by the process. It's not +# specified how this interacts with coredumpd. +# 0 means not to produce cores. +# This value is 64G +LimitCORE=68719476736 + +# Limit number of processes (threads) we may spawn. We don't advise you change +# this as DS will autodetect your threads / cpus and adjust as needed. +# LimitNPROC= + # Hardening options: # PrivateDevices=true # ProtectSystem=true # ProtectHome=true # PrivateTmp=true
-# if you need to set other directives e.g. LimitNOFILE=8192 -# set them in this file -.include @initconfigdir@/@package_name@.systemd
[Install] WantedBy=multi-user.target
389-commits@lists.fedoraproject.org