From 3c590738d422913ea64a81cd15e41741180bfd9e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Kou=C5=99il?= Date: Wed, 13 Oct 2004 09:15:36 +0000 Subject: [PATCH] Added startup script --- org.glite.security.proxyrenewal/config/startup | 63 ++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100755 org.glite.security.proxyrenewal/config/startup diff --git a/org.glite.security.proxyrenewal/config/startup b/org.glite.security.proxyrenewal/config/startup new file mode 100755 index 0000000..a71cca6 --- /dev/null +++ b/org.glite.security.proxyrenewal/config/startup @@ -0,0 +1,63 @@ +#!/bin/sh + +GLITE_LOCATION=/opt/glite +GLITE_USER=glite +GLITE_LOCATION_VAR=/opt/glite/var + +PROXY_REPOSITORY="$GLITE_LOCATION_VAR/spool/glite-renewd" + +[ -f /etc/glite.conf ] && . /etc/glite.conf +[ -f $HOME/.glite.conf ] && . $HOME/.glite.conf + +#[ -f $GLITE_LOCATION/etc/lb.conf ] && . $GLITE_LOCATION/etc/lb.conf +#[ -f $GLITE_LOCATION_VAR/etc/lb.conf ] && . $GLITE_LOCATION_VAR/etc/lb.conf + +start() +{ + [ -n "$GLITE_HOST_CERT"] X509_USER_CERT="$GLITE_HOST_CERT" + [ -n "$GLITE_HOST_KEY" ] X509_USER_KEY="$GLITE_HOST_KEY" + + echo -n Starting ProxyRenewal Daemon: glite-proxy-renewd ... + + if [ ! -d "$PROXY_REPOSITORY" ]; then + mkdir -p $PROXY_REPOSITORY || exit 1 + chown $GLITE_USER $PROXY_REPOSITORY + chmod 0700 $PROXY_REPOSITORY + fi + + su $GLITE_USER -c "$GLITE_LOCATION/bin/glite-proxy-renewd" \ + -r $PROXY_REPOSITORY && echo " done" +} + +stop() +{ + echo -n "Stopping ProxyRenewal Daemon: glite-proxy-renewd ..." + PIDS=`ps -C glite-proxy-renewd -o pid --no-heading` + if [ -z "$PIDS" ]; then + echo " no process glite-proxy-renewd running" + exit 1 + else + kill $PIDS && echo " done" + fi +} + +status() +{ + PIDS=`ps -C glite-proxy-renewd -o pid --no-heading` + if ps p $PIDS >/dev/null 2>&1; then + echo glite-proxy-renewd running \($PIDS\) + return 0 + fi + + echo glite-proxy-renewd not running + return 1 +} + +case x$1 in + xstart) start;; + xstop) stop;; + xrestart) stop; start;; + xstatus) status;; + x*) echo usage: $0 start,stop,restart,status >&2 + exit 1;; +esac -- 1.8.2.3