andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
dc8c34
From 9f2221ef7656ae03bdb463b7ec6861738d197742 Mon Sep 17 00:00:00 2001
dc8c34
From: Noriko Hosoi <nhosoi@redhat.com>
dc8c34
Date: Sun, 12 Apr 2015 16:44:40 -0700
dc8c34
Subject: [PATCH 312/319] Ticket #48148 - start/stop/restart-dirsrv utilities
dc8c34
 should ignore admin-serv directory
dc8c34
dc8c34
Description: {start,stop}-dirsrv script scans /etc/sysconfig/dirsrv-* to find
dc8c34
out the server instances to start/stop, which could include dirsrv-admin for
dc8c34
the Admin server if 389-admin is installed.
dc8c34
dc8c34
This patch silently skips "dirsrv-admin" from the server start/stop.
dc8c34
dc8c34
(cherry picked from commit 349db8decaff0d3a3b63aafc22c4b1714c4e9573)
dc8c34
---
dc8c34
 ldap/admin/src/scripts/start-dirsrv.in | 9 ++++++---
dc8c34
 ldap/admin/src/scripts/stop-dirsrv.in  | 9 ++++++---
dc8c34
 2 files changed, 12 insertions(+), 6 deletions(-)
dc8c34
dc8c34
diff --git a/ldap/admin/src/scripts/start-dirsrv.in b/ldap/admin/src/scripts/start-dirsrv.in
dc8c34
index 291c821..0a38c4c 100755
dc8c34
--- a/ldap/admin/src/scripts/start-dirsrv.in
dc8c34
+++ b/ldap/admin/src/scripts/start-dirsrv.in
dc8c34
@@ -19,8 +19,12 @@ start_instance() {
dc8c34
     shift
dc8c34
 
dc8c34
     # source env. for this instance
dc8c34
-    if [ -f $initconfig_dir/@package_name@-$SERV_ID ] ; then
dc8c34
-        . $initconfig_dir/@package_name@-$SERV_ID
dc8c34
+    if [ $SERV_ID == "admin" ] ; then
dc8c34
+        # ignore admin
dc8c34
+        return 0 
dc8c34
+    elif [ -f $initconfig_dir/dirsrv-$SERV_ID ] ; then
dc8c34
+        echo Starting instance \"$SERV_ID\"
dc8c34
+        . $initconfig_dir/dirsrv-$SERV_ID
dc8c34
     else
dc8c34
         echo Instance $SERV_ID not found.
dc8c34
         return 1
dc8c34
@@ -127,7 +131,6 @@ if [ "$#" -eq 0 ]; then
dc8c34
     for i in $initconfig_dir/@package_name@-*; do
dc8c34
         regex=s,$initconfig_dir/@package_name@-,,g
dc8c34
         inst=`echo $i | sed -e $regex`
dc8c34
-        echo Starting instance \"$inst\"
dc8c34
         start_instance $inst
dc8c34
         if [ "$?" -ne 0 ]; then
dc8c34
             ret=$?
dc8c34
diff --git a/ldap/admin/src/scripts/stop-dirsrv.in b/ldap/admin/src/scripts/stop-dirsrv.in
dc8c34
index 4d88585..076af87 100755
dc8c34
--- a/ldap/admin/src/scripts/stop-dirsrv.in
dc8c34
+++ b/ldap/admin/src/scripts/stop-dirsrv.in
dc8c34
@@ -10,8 +10,12 @@ stop_instance() {
dc8c34
     SERV_ID=$1
dc8c34
 
dc8c34
     # source env. for this instance
dc8c34
-    if [ -f $initconfig_dir/@package_name@-$SERV_ID ] ; then
dc8c34
-        . $initconfig_dir/@package_name@-$SERV_ID
dc8c34
+    if [ $SERV_ID == "admin" ] ; then
dc8c34
+        # ignore admin
dc8c34
+        return 0 
dc8c34
+    elif [ -f $initconfig_dir/dirsrv-$SERV_ID ] ; then
dc8c34
+        echo Stopping instance \"$SERV_ID\"
dc8c34
+        . $initconfig_dir/dirsrv-$SERV_ID
dc8c34
     else
dc8c34
         echo Instance $SERV_ID not found.
dc8c34
         return 1
dc8c34
@@ -75,7 +79,6 @@ if [ "$#" -eq 0 ]; then
dc8c34
     for i in $initconfig_dir/@package_name@-*; do
dc8c34
         regex=s,$initconfig_dir/@package_name@-,,g
dc8c34
         inst=`echo $i | sed -e $regex`
dc8c34
-        echo Stopping instance \"$inst\"
dc8c34
         stop_instance $inst
dc8c34
         if [ "$?" -ne 0 ]; then
dc8c34
             ret=$?
dc8c34
-- 
dc8c34
1.9.3
dc8c34