mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Valery Kharseko
6 hours ago 9e8bd8d694d82ec117c2c4a89c5d1aab2e52af94
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#
# The contents of this file are subject to the terms of the Common Development and
# Distribution License (the License). You may not use this file except in compliance with the
# License.
#
# You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
# specific language governing permission and limitations under the License.
#
# When distributing Covered Software, include this CDDL Header Notice in each file and include
# the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
# Header, with the fields enclosed by brackets [] replaced by your own identifying
# information: "Portions Copyright [year] [name of copyright owner]".
#
# Copyright 2026 3A Systems, LLC
 
[Unit]
Description=OpenDJ LDAPv3 Directory Server
Documentation=https://github.com/OpenIdentityPlatform/OpenDJ
After=network-online.target
Wants=network-online.target
# Do not attempt to start (and burst-fail) until the instance has been
# configured with /opt/opendj/setup. The OR-group (|) also passes when the
# instance root has been relocated with instance.loc (split layout); the
# ExecCondition below then checks the resolved instance root precisely.
ConditionPathExists=|/opt/opendj/config/config.ldif
ConditionPathExists=|/opt/opendj/instance.loc
ConditionPathExists=|/etc/opendj/instance.loc
 
[Service]
Type=simple
User=opendj
Group=opendj
# Allow the non-root service to bind privileged ports (e.g. LDAP 389, LDAPS 636).
AmbientCapabilities=CAP_NET_BIND_SERVICE
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
# Optional admin overrides (OPENDJ_JAVA_HOME / OPENDJ_JAVA_BIN / OPENDJ_JAVA_ARGS).
# The leading "-" makes the file optional; deb ships /etc/default, rpm /etc/sysconfig.
EnvironmentFile=-/etc/default/opendj
EnvironmentFile=-/etc/sysconfig/opendj
# Skip the start (a no-op, not a failure) while the instance root - resolved
# instance.loc-aware, exactly as _script-util.sh does - has no config.ldif
# yet. "$$" is systemd's escape for a literal "$".
ExecCondition=/bin/sh -c 'IR=/opt/opendj; if [ -f /etc/opendj/instance.loc ]; then read IR < /etc/opendj/instance.loc; elif [ -f "$$IR/instance.loc" ]; then read L < "$$IR/instance.loc"; case "$$L" in /*) IR="$$L";; *) IR="$$IR/$$L";; esac; fi; [ -f "$$IR/config/config.ldif" ]'
# start-ds --nodetach keeps the JVM in the foreground so systemd supervises it
# directly. No --quiet: a failed start must leave its message in the journal.
ExecStart=/opt/opendj/bin/start-ds --nodetach
# No ExecStop: the server shuts down gracefully on systemd's default SIGTERM,
# and stop-ds would only add two cold JVM starts to every stop. Closing a
# large JE backend can be slow - allow more than the 90 s default.
TimeoutStopSec=300
Restart=on-failure
RestartSec=5
LimitNOFILE=65536
 
[Install]
WantedBy=multi-user.target