瀏覽代碼

Ticket #47302 - get rid of sbindir start/stop/restart slapd scripts

https://fedorahosted.org/389/ticket/47302
Reviewed by: mreynolds (Thanks!)
Branch: master
Fix Description:
do not need sbindir -slapd scripts since we already had -dirsrv scripts -
start-dirsrv etc. - that already take an instance argument, although not
with -Z
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: Yes, if we have already documented sbindir start-slapd etc.
Rich Megginson 12 年之前
父節點
當前提交
e75704b99a

+ 2 - 7
Makefile.am

@@ -122,9 +122,8 @@ CLEANFILES =  dberrstrs.h ns-slapd.properties \
 	ldap/admin/src/scripts/db2index ldap/admin/src/scripts/db2ldif \
 	ldap/admin/src/scripts/dn2rdn ldap/admin/src/scripts/ldif2db \
 	ldap/admin/src/scripts/ldif2ldap ldap/admin/src/scripts/monitor \
-	ldap/admin/src/scripts/restart-slapd ldap/admin/src/scripts/restoreconfig \
-	ldap/admin/src/scripts/saveconfig ldap/admin/src/scripts/start-slapd \
-	ldap/admin/src/scripts/stop-slapd ldap/admin/src/scripts/suffix2instance \
+	ldap/admin/src/scripts/restoreconfig ldap/admin/src/scripts/saveconfig  \
+	ldap/admin/src/scripts/suffix2instance \
 	ldap/admin/src/scripts/upgradednformat ldap/admin/src/scripts/vlvindex \
 	ldap/admin/src/scripts/bak2db.pl ldap/admin/src/scripts/db2bak.pl \
 	ldap/admin/src/scripts/db2index.pl ldap/admin/src/scripts/db2ldif.pl \
@@ -345,11 +344,8 @@ sbin_SCRIPTS = ldap/admin/src/scripts/setup-ds.pl \
 	ldap/admin/src/scripts/ldif2db \
 	ldap/admin/src/scripts/ldif2ldap \
 	ldap/admin/src/scripts/monitor \
-	ldap/admin/src/scripts/restart-slapd \
 	ldap/admin/src/scripts/restoreconfig \
 	ldap/admin/src/scripts/saveconfig \
-	ldap/admin/src/scripts/start-slapd \
-	ldap/admin/src/scripts/stop-slapd \
 	ldap/admin/src/scripts/suffix2instance \
 	ldap/admin/src/scripts/upgradednformat \
 	ldap/admin/src/scripts/vlvindex \
@@ -510,7 +506,6 @@ dist_man_MANS = man/man1/dbscan.1 \
         man/man8/dbverify.8 man/man8/verify-db.pl.8 \
         man/man8/dn2rdn.8 man/man8/ldif2ldap.8 \
         man/man8/restoreconfig.8 man/man8/saveconfig.8 \
-        man/man8/start-slapd.8 man/man8/stop-slapd.8 man/man8/restart-slapd.8 \
         man/man8/suffix2instance.8 man/man8/monitor.8 \
         man/man8/upgradednformat.8 man/man8/vlvindex.8 \
         man/man8/cleanallruv.pl.8 man/man8/schema-reload.pl.8 \

+ 3 - 8
Makefile.in

@@ -1412,9 +1412,8 @@ CLEANFILES = dberrstrs.h ns-slapd.properties \
 	ldap/admin/src/scripts/db2index ldap/admin/src/scripts/db2ldif \
 	ldap/admin/src/scripts/dn2rdn ldap/admin/src/scripts/ldif2db \
 	ldap/admin/src/scripts/ldif2ldap ldap/admin/src/scripts/monitor \
-	ldap/admin/src/scripts/restart-slapd ldap/admin/src/scripts/restoreconfig \
-	ldap/admin/src/scripts/saveconfig ldap/admin/src/scripts/start-slapd \
-	ldap/admin/src/scripts/stop-slapd ldap/admin/src/scripts/suffix2instance \
+	ldap/admin/src/scripts/restoreconfig ldap/admin/src/scripts/saveconfig  \
+	ldap/admin/src/scripts/suffix2instance \
 	ldap/admin/src/scripts/upgradednformat ldap/admin/src/scripts/vlvindex \
 	ldap/admin/src/scripts/bak2db.pl ldap/admin/src/scripts/db2bak.pl \
 	ldap/admin/src/scripts/db2index.pl ldap/admin/src/scripts/db2ldif.pl \
@@ -1573,11 +1572,8 @@ sbin_SCRIPTS = ldap/admin/src/scripts/setup-ds.pl \
 	ldap/admin/src/scripts/ldif2db \
 	ldap/admin/src/scripts/ldif2ldap \
 	ldap/admin/src/scripts/monitor \
-	ldap/admin/src/scripts/restart-slapd \
 	ldap/admin/src/scripts/restoreconfig \
 	ldap/admin/src/scripts/saveconfig \
-	ldap/admin/src/scripts/start-slapd \
-	ldap/admin/src/scripts/stop-slapd \
 	ldap/admin/src/scripts/suffix2instance \
 	ldap/admin/src/scripts/upgradednformat \
 	ldap/admin/src/scripts/vlvindex \
@@ -1735,7 +1731,6 @@ dist_man_MANS = man/man1/dbscan.1 \
         man/man8/dbverify.8 man/man8/verify-db.pl.8 \
         man/man8/dn2rdn.8 man/man8/ldif2ldap.8 \
         man/man8/restoreconfig.8 man/man8/saveconfig.8 \
-        man/man8/start-slapd.8 man/man8/stop-slapd.8 man/man8/restart-slapd.8 \
         man/man8/suffix2instance.8 man/man8/monitor.8 \
         man/man8/upgradednformat.8 man/man8/vlvindex.8 \
         man/man8/cleanallruv.pl.8 man/man8/schema-reload.pl.8 \
@@ -10497,7 +10492,7 @@ distcheck: dist
 	*.zip*) \
 	  unzip $(distdir).zip ;;\
 	esac
-	chmod -R a-w $(distdir); chmod a+w $(distdir)
+	chmod -R a-w $(distdir); chmod u+w $(distdir)
 	mkdir $(distdir)/_build
 	mkdir $(distdir)/_inst
 	chmod a-w $(distdir)

+ 0 - 50
ldap/admin/src/scripts/restart-slapd.in

@@ -1,50 +0,0 @@
-#!/bin/sh
-
-source @datadir@/dirsrv/data/DSSharedLib
-
-# Script that restarts the ns-slapd server.
-# Exit status can be:
-#       0: Server restarted successfully
-#       1: Server could not be started
-#       2: Server started successfully (was not running)
-#       3: Server could not be stopped
-
-usage ()
-{
-    echo "Usage: restart-slapd [-Z serverID]"
-}
-
-while getopts "Z:SvVhi:d:w:" flag
-do
-    case $flag in
-        Z) servid=$OPTARG;;
-        d) args=$args" -d $OPTARG";;
-        v) args=$args" -v";;
-        V) args=$args" -V";;
-        i) args=$args" -i $OPTARG";;
-        w) args=$args" -w $OPTARG";;
-        S) args=$args" -S";; 
-        h) usage
-           exit 0;;
-        ?) usage
-           exit 1;;
-    esac
-done
-
-servid=$(get_server_id "@initconfigdir@" $servid)
-if [ $? == 1 ]
-then
-    usage
-    echo "You must supply a valid server instance identifier.  Use -Z to specify instance name"
-    echo "Available instances: $servid"
-    exit 1
-fi
-
-@sbindir@/restart-dirsrv -d @initconfigdir@ $servid $args
-if [ $? == 0 ]
-then
-    echo Sucessfully restarted instance \"$servid\"
-else
-    echo Failed to restart instance \"$servid\"
-fi
-exit $?

+ 0 - 50
ldap/admin/src/scripts/start-slapd.in

@@ -1,50 +0,0 @@
-#!/bin/sh
-
-source @datadir@/dirsrv/data/DSSharedLib
-
-# Script that starts the ns-slapd server.
-# Exit status can be:
-#       0: Server started successfully
-#       1: Server could not be started
-#       2: Server already running
-
-usage ()
-{
-    echo "Usage: start-slapd [-Z serverID]"
-}
-
-while getopts "Z:SvVhi:d:w:" flag
-do
-    case $flag in
-        Z) servid=$OPTARG;;
-        d) args=$args" -d $OPTARG";;
-        v) args=$args" -v";;
-        V) args=$args" -V";;
-        i) args=$args" -i $OPTARG";;
-        w) args=$args" -w $OPTARG";;
-        S) args=$args" -S";;
-        h) usage
-           exit 0;;
-        ?) usage
-           exit 1;;
-    esac
-done
-
-servid=$(get_server_id "@initconfigdir@" $servid)
-if [ $? == 1 ]
-then
-    usage
-    echo "You must supply a valid server instance identifier.  Use -Z to specify instance name"
-    echo "Available instances: $servid"
-    exit 1
-fi
-
-@sbindir@/start-dirsrv -d @initconfigdir@ $servid $args
-if [ $? == 0 ]
-then
-    echo Sucessfully started instance \"$servid\"
-else
-    echo Failed to start instance \"$servid\"
-fi
-
-exit $?

+ 0 - 50
ldap/admin/src/scripts/stop-slapd.in

@@ -1,50 +0,0 @@
-#!/bin/sh
-
-source @datadir@/dirsrv/data/DSSharedLib
-
-# Script that stops the ns-slapd server.
-# Exit status can be:
-#       0: Server stopped successfully
-#       1: Server could not be stopped
-#       2: Server was not running
-
-usage ()
-{
-    echo "Usage: stop-slapd [-Z serverID]"
-}
-
-while getopts "Z:SvVhi:d:w:" flag
-do
-    case $flag in
-        Z) servid=$OPTARG;;
-        d) args=$args" -d $OPTARG";;
-        v) args=$args" -v";;
-        V) args=$args" -V";;
-        i) args=$args" -i $OPTARG";;
-        w) args=$args" -w $OPTARG";;
-        S) args=$args" -S";;
-        h) usage
-           exit 0;;
-        ?) usage
-           exit 1;;
-    esac
-done
-
-servid=$(get_server_id "@initconfigdir@" $servid)
-if [ $? == 1 ]
-then
-    usage
-    echo "You must supply a valid server instance identifier.  Use -Z to specify instance name"
-    echo "Available instances: $servid"
-    exit 1
-fi
-
-@sbindir@/stop-dirsrv -d @initconfigdir@ $servid $args
-if [ $? == 0 ]
-then
-    echo Sucessfully stopped instance \"$servid\"
-else
-    echo Failed to stop instance \"$servid\"
-fi
-
-exit $?

+ 2 - 4
ldap/admin/src/scripts/template-restart-slapd.in

@@ -1,5 +1,3 @@
 #!/bin/sh
-
-cd {{SERVERBIN-DIR}}
-./restart-slapd "$@" -Z {{SERV-ID}}
-exit $?
+# DEPRECATED - use @sbindir@/restart-dirsrv instead
+exec @sbindir@/restart-dirsrv -d {{INITCONFIG-DIR}} {{SERV-ID}} "$@"

+ 3 - 4
ldap/admin/src/scripts/template-start-slapd.in

@@ -1,5 +1,4 @@
 #!/bin/sh
-
-cd {{SERVERBIN-DIR}}
-./start-slapd "$@" -Z {{SERV-ID}}
-exit $?
+# DEPRECATED - use @sbindir@/start-dirsrv instead
+INSTANCE={{SERV-ID}}
+exec @sbindir@/start-dirsrv -d {{INITCONFIG-DIR}} $INSTANCE "$@"

+ 2 - 4
ldap/admin/src/scripts/template-stop-slapd.in

@@ -1,5 +1,3 @@
 #!/bin/sh
-
-cd {{SERVERBIN-DIR}}
-./stop-slapd "$@" -Z {{SERV-ID}}
-exit $?
+# DEPRECATED - use @sbindir@/stop-dirsrv instead
+exec @sbindir@/stop-dirsrv -d {{INITCONFIG-DIR}} {{SERV-ID}} "$@"