# To change any of the below values, please use a drop-in file in which
# you can declare overrides according to systemd.unit(5), either of:
# - applying to all instances:
#   /etc/systemd/system/dirsrv@.service.d/custom.conf
# - applying to a single instance (overriding the above):
#   /etc/systemd/system/dirsrv@<instance>.service.d/custom.conf
#
# Some of the most interesting coniguration options are mentioned below.
# See systemd.service(5) and systemd.exec(5) for the respective documentation.
#
# After updating the service configuration, do not forget to apply the changes:
# - reload systemd configuration: systemctl daemon-reload
# - restart the service: systemctl restart @package_name@@<instance>.service

[Service]
TimeoutStartSec=0
TimeoutStopSec=600

# 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=

# 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=yes
#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.
#LimitCORE=<bytes>

# 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=

# Possible hardening options:
#PrivateDevices=yes
#ProtectSystem=yes
#ProtectHome=yes
#PrivateTmp=yes

# Preload jemalloc
Environment=LD_PRELOAD=@libdir@/@package_name@/lib/libjemalloc.so.2

# Uncomment to enable leak checking using jemalloc's heap profiler
# https://github.com/jemalloc/jemalloc/wiki/Use-Case%3A-Leak-Checking
#Environment=MALLOC_CONF=prof_leak:true,lg_prof_sample:0,prof_final:true,prof_prefix:/var/run/dirsrv/jeprof
