Skip to content

Commit 82348c4

Browse files
RajatGupta02Rajat Gupta
and
Rajat Gupta
authored
Fix systemd configs (#18135)
Signed-off-by: Rajat Gupta <[email protected]> Co-authored-by: Rajat Gupta <[email protected]>
1 parent d11e44a commit 82348c4

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

distribution/packages/src/common/systemd/opensearch.service

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ WorkingDirectory=/usr/share/opensearch
2626
User=opensearch
2727
Group=opensearch
2828

29+
ExecStartPre=/bin/mkdir -p /dev/shm/performanceanalyzer
30+
ExecStartPre=/bin/chown opensearch:opensearch /dev/shm/performanceanalyzer
31+
2932
ExecStart=/usr/share/opensearch/bin/systemd-entrypoint -p ${PID_DIR}/opensearch.pid --quiet
3033

3134
# StandardOutput is configured to redirect to journalctl since
@@ -130,6 +133,7 @@ RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
130133

131134
ReadWritePaths=/var/log/opensearch
132135
ReadWritePaths=/var/lib/opensearch
136+
ReadWritePaths=/dev/shm/
133137
ReadWritePaths=-/etc/opensearch
134138
ReadWritePaths=-/mnt/snapshots
135139

@@ -149,17 +153,25 @@ RestrictNamespaces=true
149153
NoNewPrivileges=true
150154

151155
# Memory and execution protection
152-
MemoryDenyWriteExecute=true # Prevent creating writable executable memory mappings
153-
SystemCallArchitectures=native # Allow only native system calls
154-
KeyringMode=private # Service does not share key material with other services
155-
LockPersonality=true # Prevent changing ABI personality
156-
RestrictSUIDSGID=true # Prevent creating SUID/SGID files
157-
RestrictRealtime=true # Prevent acquiring realtime scheduling
158-
ProtectHostname=true # Prevent changes to system hostname
159-
ProtectKernelLogs=true # Prevent reading/writing kernel logs
160-
ProtectClock=true # Prevent tampering with the system clock
156+
157+
# Allow only native system calls
158+
SystemCallArchitectures=native
159+
# Service does not share key material with other services
160+
KeyringMode=private
161+
# Prevent changing ABI personality
162+
LockPersonality=true
163+
# Prevent creating SUID/SGID files
164+
RestrictSUIDSGID=true
165+
# Prevent acquiring realtime scheduling
166+
RestrictRealtime=true
167+
# Prevent changes to system hostname
168+
ProtectHostname=true
169+
# Prevent reading/writing kernel logs
170+
ProtectKernelLogs=true
171+
# Prevent tampering with the system clock
172+
ProtectClock=true
161173

162174
[Install]
163175
WantedBy=multi-user.target
164176

165-
# Built for ${project.name}-${project.version} (${project.name})
177+
# Built for ${project.name}-${project.version} (${project.name})

0 commit comments

Comments
 (0)