summaryrefslogtreecommitdiffstats
path: root/base/deploy/scripts
diff options
context:
space:
mode:
authorMatthew Harmsen <mharmsen@redhat.com>2012-08-01 21:36:28 -0700
committerMatthew Harmsen <mharmsen@redhat.com>2012-08-02 10:43:30 -0700
commite0a57d039dec42526e5f3241a0439b04f17d4ee5 (patch)
treeb95183bb6751ec8f2ef1eaa6053bb99d3200fa6b /base/deploy/scripts
parentf3673e8b8cc44fa15a4829784e6ea8e45d764f91 (diff)
downloadpki-e0a57d039dec42526e5f3241a0439b04f17d4ee5.tar.gz
pki-e0a57d039dec42526e5f3241a0439b04f17d4ee5.tar.xz
pki-e0a57d039dec42526e5f3241a0439b04f17d4ee5.zip
PKI Deployment Scriptlets
* PKI TRAC Ticket #279 - Dogtag 10: Fix remaining 'cloning' issues in 'pkispawn' . . . * PKI TRAC Ticket #280 - Dogtag 10: Fix remaining issues in 'pkidestroy' related to deletion of more than one instance . . . * PKI TRAC Ticket #281 - Dogtag 10: Fix 'pkidaemon'/'operations' issue to handle individual instance . . .
Diffstat (limited to 'base/deploy/scripts')
-rw-r--r--base/deploy/scripts/operations98
-rwxr-xr-xbase/deploy/scripts/pkidaemon14
2 files changed, 112 insertions, 0 deletions
diff --git a/base/deploy/scripts/operations b/base/deploy/scripts/operations
index a2f88b30d..23e5e2184 100644
--- a/base/deploy/scripts/operations
+++ b/base/deploy/scripts/operations
@@ -40,6 +40,10 @@ 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
;;
@@ -148,6 +152,9 @@ 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"
@@ -164,6 +171,9 @@ 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"
@@ -921,6 +931,54 @@ 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
@@ -1011,6 +1069,37 @@ 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
@@ -1072,6 +1161,15 @@ 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 02b02370f..74f69e968 100755
--- a/base/deploy/scripts/pkidaemon
+++ b/base/deploy/scripts/pkidaemon
@@ -56,6 +56,20 @@ 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."