Blob Blame History Raw
From f570348659620a59b681e7bf315bd979cd7de497 Mon Sep 17 00:00:00 2001
From: Mark Reynolds <mreynolds@redhat.com>
Date: Mon, 13 Jan 2020 14:40:49 -0500
Subject: [PATCH] Issue 50812 -  dscontainer executable should be placed under
 /usr/libexec/dirsrv/

Description:  dscontainer is not a user-runnable executable. Per packaging
              guidelines it should be placed under /usr/libexec/dirsrv/

relates: https://pagure.io/389-ds-base/issue/50812

Reviewed by: firstyear & mhonek (Thanks!!)
---
 docker/389-ds-fedora/Dockerfile       | 6 +++---
 docker/389-ds-suse/Dockerfile         | 4 ++--
 docker/389-ds-suse/Dockerfile.release | 2 +-
 rpm/389-ds-base.spec.in               | 2 +-
 src/lib389/setup.py                   | 4 +++-
 5 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/docker/389-ds-fedora/Dockerfile b/docker/389-ds-fedora/Dockerfile
index d61df8cba..45523ccf1 100644
--- a/docker/389-ds-fedora/Dockerfile
+++ b/docker/389-ds-fedora/Dockerfile
@@ -40,7 +40,7 @@ VOLUME /etc/dirsrv
 VOLUME /var/log/dirsrv
 VOLUME /var/lib/dirsrv
 
-# Or, run them as dirsrv
-USER dirsrv
-CMD ["/usr/sbin/ns-slapd", "-d", "0", "-D", "/etc/dirsrv/slapd-localhost", "-i", "/var/run/dirsrv/slapd-localhost.pid"]
+HEALTHCHECK --start-period=5m --timeout=5s --interval=5s --retries=2 \
+  CMD /usr/libexec/dirsrv/dscontainer -H
 
+CMD [ "/usr/libexec/dirsrv/dscontainer", "-r" ]
diff --git a/docker/389-ds-suse/Dockerfile b/docker/389-ds-suse/Dockerfile
index 1e56e1f5a..6022d04c6 100644
--- a/docker/389-ds-suse/Dockerfile
+++ b/docker/389-ds-suse/Dockerfile
@@ -76,7 +76,7 @@ VOLUME /data
 # USER dirsrv
 
 HEALTHCHECK --start-period=5m --timeout=5s --interval=5s --retries=2 \
-    CMD /usr/sbin/dscontainer -H
+    CMD /usr/libexec/dirsrv/dscontainer -H
 
-CMD [ "/usr/sbin/dscontainer", "-r" ]
+CMD [ "/usr/libexec/dirsrv/dscontainer", "-r" ]
 
diff --git a/docker/389-ds-suse/Dockerfile.release b/docker/389-ds-suse/Dockerfile.release
index c934edaf0..6f4adf735 100644
--- a/docker/389-ds-suse/Dockerfile.release
+++ b/docker/389-ds-suse/Dockerfile.release
@@ -69,4 +69,4 @@ VOLUME /data
 # here and ds should do the right thing if a non root user runs the server.
 # USER dirsrv
 
-CMD [ "/usr/sbin/dscontainer", "-r" ]
+CMD [ "/usr/libexec/dirsrv/dscontainer", "-r" ]
diff --git a/rpm/389-ds-base.spec.in b/rpm/389-ds-base.spec.in
index 6f4a1e1a9..6491bda00 100644
--- a/rpm/389-ds-base.spec.in
+++ b/rpm/389-ds-base.spec.in
@@ -806,7 +806,7 @@ exit 0
 %{_mandir}/man8/dsctl.8.gz
 %{_sbindir}/dsidm
 %{_mandir}/man8/dsidm.8.gz
-%{_sbindir}/dscontainer
+%{_libexecdir}/%{pkgname}/dscontainer
 
 %files -n cockpit-389-ds -f cockpit.list
 %{_datarootdir}/metainfo/389-console/org.port389.cockpit_console.metainfo.xml
diff --git a/src/lib389/setup.py b/src/lib389/setup.py
index 056173936..296b555a4 100644
--- a/src/lib389/setup.py
+++ b/src/lib389/setup.py
@@ -63,7 +63,6 @@ setup(
             'cli/dsconf',
             'cli/dscreate',
             'cli/dsidm',
-            'cli/dscontainer',
             ]),
         ('/usr/share/man/man8', [
             'man/dsctl.8',
@@ -71,6 +70,9 @@ setup(
             'man/dscreate.8',
             'man/dsidm.8',
             ]),
+        ('/usr/libexec/dirsrv/', [
+            'cli/dscontainer',
+            ]),
     ],
 
     install_requires=[
-- 
2.21.1