summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAde Lee <alee@redhat.com>2012-08-03 11:31:15 -0400
committerAde Lee <alee@redhat.com>2012-08-03 22:28:02 -0400
commit178327661293a26dfa3a9dc52dd9464f6d97fd3f (patch)
tree70007a47ab278a2d9a4a9a3079e963b775a15deb
parent35b30bda660b9ee9c76a2a09824dd673447b117a (diff)
downloadpki-178327661293a26dfa3a9dc52dd9464f6d97fd3f.tar.gz
pki-178327661293a26dfa3a9dc52dd9464f6d97fd3f.tar.xz
pki-178327661293a26dfa3a9dc52dd9464f6d97fd3f.zip
Fixed operations to operate on correct number of instances
Reverted previous fix to pkidaemon and operations. Now, as expected, systemctl start/stop pki-tomcatd@foo.service will stop instance foo, whereas pki-tomcatd.target will affect all tomcatd instances.
-rw-r--r--base/deploy/scripts/operations102
-rwxr-xr-xbase/deploy/scripts/pkidaemon14
2 files changed, 2 insertions, 114 deletions
diff --git a/base/deploy/scripts/operations b/base/deploy/scripts/operations
index 23e5e2184..4f89c1a19 100644
--- a/base/deploy/scripts/operations
+++ b/base/deploy/scripts/operations
@@ -40,10 +40,6 @@ case $command in
# 1 generic or unspecified error (current practice)
default_error=1
;;
- start_all|stop_all|restart_all)
- # 1 generic or unspecified error (current practice)
- default_error=1
- ;;
reload)
default_error=3
;;
@@ -138,8 +134,8 @@ done
# Execute the specified registered instance of this PKI web server type
if [ -n "${pki_instance_id}" ]; then
for INSTANCE in ${PKI_REGISTRY_ENTRIES}; do
- if [ "${PKI_REGISTRY}/${pki_instance_id}" = "$INSTANCE" ]; then
- PKI_REGISTRY_ENTRIES="${PKI_REGISTRY}/${pki_instance_id}"
+ if [ "`basename ${INSTANCE}`" == "${pki_instance_id}" ]; then
+ PKI_REGISTRY_ENTRIES="${INSTANCE}"
TOTAL_PKI_REGISTRY_ENTRIES=1
break
fi
@@ -152,9 +148,6 @@ usage()
echo -n "{start"
echo -n "|stop"
echo -n "|restart"
- echo -n "|start_all"
- echo -n "|stop_all"
- echo -n "|restart_all"
echo -n "|condrestart"
echo -n "|force-restart"
echo -n "|try-restart"
@@ -171,9 +164,6 @@ usage_systemd()
echo -n "{start"
echo -n "|stop"
echo -n "|restart"
- echo -n "|start_all"
- echo -n "|stop_all"
- echo -n "|restart_all"
echo -n "|condrestart"
echo -n "|force-restart"
echo -n "|try-restart"
@@ -931,54 +921,6 @@ start()
return 5
fi
- # Source values associated with this particular PKI instance
- [ -f ${PKI_REGISTRY_ENTRY} ] &&
- . ${PKI_REGISTRY_ENTRY}
-
- start_instance
- rv=$?
- if [ $rv = 6 ] ; then
- # Since at least ONE configuration error exists, then there
- # is at least ONE unconfigured instance from the PKI point
- # of view.
- #
- # However, it must still be considered that the
- # instance is "running" from the point of view of other
- # OS programs such as 'chkconfig'.
- #
- # Therefore, ignore non-zero return codes resulting
- # from configuration errors.
- #
-
- config_errors=`expr $config_errors + 1`
- rv=0
- elif [ $rv != 0 ] ; then
- errors=`expr $errors + 1`
- error_rv=$rv
- fi
-
- if [ ${TOTAL_PKI_REGISTRY_ENTRIES} -gt ${errors} ] ; then
- touch ${lockfile}
- chmod 00600 ${lockfile}
- fi
-
- return $rv
-}
-
-start_all()
-{
- error_rv=0
- rv=0
- config_errors=0
- errors=0
-
- if [ ${TOTAL_PKI_REGISTRY_ENTRIES} -eq 0 ]; then
- echo
- echo "ERROR: No '${PKI_TYPE}' instances installed!"
- # 5 program is not installed
- return 5
- fi
-
if [ ${TOTAL_PKI_REGISTRY_ENTRIES} -gt 1 ]; then
echo "BEGIN STARTING '${PKI_TYPE}' INSTANCES:"
fi
@@ -1069,37 +1011,6 @@ stop()
return 5
fi
- # Source values associated with this particular PKI instance
- [ -f ${PKI_REGISTRY_ENTRY} ] &&
- . ${PKI_REGISTRY_ENTRY}
-
- stop_instance
- rv=$?
- if [ $rv != 0 ] ; then
- errors=`expr $errors + 1`
- error_rv=$rv
- fi
-
- if [ ${errors} -eq 0 ] ; then
- rm -f ${lockfile}
- fi
-
- return $rv
-}
-
-stop_all()
-{
- error_rv=0
- rv=0
- errors=0
-
- if [ ${TOTAL_PKI_REGISTRY_ENTRIES} -eq 0 ]; then
- echo
- echo "ERROR: No '${PKI_TYPE}' instances installed!"
- # 5 program is not installed
- return 5
- fi
-
if [ ${TOTAL_PKI_REGISTRY_ENTRIES} -gt 1 ] ; then
echo "BEGIN SHUTTING DOWN '${PKI_TYPE}' INSTANCE(S):"
fi
@@ -1161,15 +1072,6 @@ restart()
return $?
}
-restart_all()
-{
- stop_all
- sleep 2
- start_all
-
- return $?
-}
-
registry_status()
{
error_rv=0
diff --git a/base/deploy/scripts/pkidaemon b/base/deploy/scripts/pkidaemon
index 74f69e968..02b02370f 100755
--- a/base/deploy/scripts/pkidaemon
+++ b/base/deploy/scripts/pkidaemon
@@ -56,20 +56,6 @@ case $command in
stop
exit $?
;;
- start_all)
- start_all
- exit $?
- ;;
- restart_all)
- restart_all
- exit $?
- ;;
- stop_all)
- echo "An exit status of '143' refers to the 'systemd' method of using"\
- "'SIGTERM' to shutdown a Java process and can safely be ignored."
- stop_all
- exit $?
- ;;
condrestart|force-restart|try-restart)
[ ! -f ${lockfile} ] || restart
echo "The '${command}' action is TBD."