From 71914dc072d1fb6fe2d702e46c121587c7492e8d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Mon, 19 Dec 2011 13:31:09 +0000 Subject: [PATCH] Start-up scripts according to Fedora Packaging Guidelines. --- org.glite.lb.harvester/config/startup | 4 ++++ org.glite.lb.harvester/project/glite-lb-harvester.spec | 6 +----- org.glite.lb.logger/config/startup | 4 ++++ org.glite.lb.logger/project/glite-lb-logger.spec | 6 +----- org.glite.lb.server/config/startup | 4 ++++ org.glite.lb.server/project/glite-lb-server.spec | 2 +- org.glite.lb.yaim/config/functions/config_glite_lb.in | 13 +++++-------- org.glite.px.proxyrenewal/config/startup | 4 ++++ .../project/glite-px-proxyrenewal.spec | 10 ++++------ 9 files changed, 28 insertions(+), 25 deletions(-) diff --git a/org.glite.lb.harvester/config/startup b/org.glite.lb.harvester/config/startup index 44462cb..3e374a3 100755 --- a/org.glite.lb.harvester/config/startup +++ b/org.glite.lb.harvester/config/startup @@ -197,6 +197,10 @@ case x$1 in xrestart|xforce-reload) stop; start;; xstatus) status;; xcleanup) cleanup;; + xcondrestart|xtry-restart) + status >/dev/null 2>&1 || exit 0 + stop; start + ;; x*) echo usage: $0 start,stop,restart,status,cleanup >&2 exit 1;; esac diff --git a/org.glite.lb.harvester/project/glite-lb-harvester.spec b/org.glite.lb.harvester/project/glite-lb-harvester.spec index 4549900..d5b20ba 100644 --- a/org.glite.lb.harvester/project/glite-lb-harvester.spec +++ b/org.glite.lb.harvester/project/glite-lb-harvester.spec @@ -62,10 +62,6 @@ exit 0 %post /sbin/chkconfig --add glite-lb-harvester -if [ $1 -eq 1 ] ; then - # XXX: or rather to detect finalized set-up in start-up scripts? - /sbin/chkconfig glite-lb-harvester off -fi %preun @@ -77,7 +73,7 @@ fi %postun if [ "$1" -ge "1" ] ; then - /sbin/service glite-lb-harvester restart >/dev/null 2>&1 || : + /sbin/service glite-lb-harvester condrestart >/dev/null 2>&1 || : fi diff --git a/org.glite.lb.logger/config/startup b/org.glite.lb.logger/config/startup index 2058325..8c5b52b 100755 --- a/org.glite.lb.logger/config/startup +++ b/org.glite.lb.logger/config/startup @@ -188,6 +188,10 @@ case x$1 in xstop) stop;; xrestart|xforce-reload) stop; start;; xstatus) status;; + xcondrestart|xtry-restart) + status >/dev/null 2>&1 || exit 0 + stop; start + ;; x*) echo usage: $0 start,stop,restart,status >&2 exit 1;; esac diff --git a/org.glite.lb.logger/project/glite-lb-logger.spec b/org.glite.lb.logger/project/glite-lb-logger.spec index 9ad4a31..9b33c52 100644 --- a/org.glite.lb.logger/project/glite-lb-logger.spec +++ b/org.glite.lb.logger/project/glite-lb-logger.spec @@ -60,10 +60,6 @@ exit 0 %post /sbin/chkconfig --add glite-lb-locallogger -if [ $1 -eq 1 ] ; then - # XXX: or rather to detect finalized set-up in the start-up scripts? - /sbin/chkconfig glite-lb-locallogger off -fi %preun @@ -75,7 +71,7 @@ fi %postun if [ "$1" -ge "1" ] ; then - /sbin/service glite-lb-locallogger restart >/dev/null 2>&1 || : + /sbin/service glite-lb-locallogger condrestart >/dev/null 2>&1 || : fi diff --git a/org.glite.lb.server/config/startup b/org.glite.lb.server/config/startup index e71b1e2..19b30b3 100755 --- a/org.glite.lb.server/config/startup +++ b/org.glite.lb.server/config/startup @@ -305,6 +305,10 @@ case x$1 in xstop) stop;; xrestart|xforce-reload) stop; start;; xstatus) status;; + xcondrestart|xtry-restart) + status >/dev/null 2>&1 || exit 0 + stop; start + ;; x*) echo usage: $0 start,stop,restart,status >&2 exit 1;; esac diff --git a/org.glite.lb.server/project/glite-lb-server.spec b/org.glite.lb.server/project/glite-lb-server.spec index 6b76902..1311f67 100644 --- a/org.glite.lb.server/project/glite-lb-server.spec +++ b/org.glite.lb.server/project/glite-lb-server.spec @@ -102,7 +102,7 @@ fi %postun if [ "$1" -ge "1" ] ; then - /sbin/service glite-lb-bkserverd restart >/dev/null 2>&1 || : + /sbin/service glite-lb-bkserverd condrestart >/dev/null 2>&1 || : fi diff --git a/org.glite.lb.yaim/config/functions/config_glite_lb.in b/org.glite.lb.yaim/config/functions/config_glite_lb.in index bbb7e39..6701b12 100644 --- a/org.glite.lb.yaim/config/functions/config_glite_lb.in +++ b/org.glite.lb.yaim/config/functions/config_glite_lb.in @@ -339,14 +339,11 @@ EOF fi fi - # Start services - if [ ! -f @glite_etc@/gLiteservices ] ; then - touch @glite_etc@/gLiteservices - fi - - grep glite-lb-bkserverd @glite_etc@/gLiteservices > /dev/null - if [ ! $? = 0 ] ; then - echo "${GLITE_LB_LOCATION_ETC}/init.d/glite-lb-bkserverd" >> @glite_etc@/gLiteservices + # upgrade from L&B <= 3.1.1 + # (legacy start-up stuff) + if [ -f @glite_etc@/gLiteservice ] ; then + grep -v 'glite-lb-bkserverd' > /tmp/gLiteservice + mv /tmp/gLiteservice @glite_etc@/gLiteservice fi if [ x"$GLITE_LB_RTM_ENABLED" = x"true" ]; then diff --git a/org.glite.px.proxyrenewal/config/startup b/org.glite.px.proxyrenewal/config/startup index 9ce39ff..b04e6d7 100755 --- a/org.glite.px.proxyrenewal/config/startup +++ b/org.glite.px.proxyrenewal/config/startup @@ -112,6 +112,10 @@ case x$1 in xstop) stop;; xrestart|xforce-reload) stop; start;; xstatus) status;; + xcondrestart|xtry-restart) + status >/dev/null 2>&1 || exit 0 + stop; start + ;; x*) echo usage: $0 start,stop,restart,status >&2 exit 1;; esac diff --git a/org.glite.px.proxyrenewal/project/glite-px-proxyrenewal.spec b/org.glite.px.proxyrenewal/project/glite-px-proxyrenewal.spec index 8806834..bbea177 100644 --- a/org.glite.px.proxyrenewal/project/glite-px-proxyrenewal.spec +++ b/org.glite.px.proxyrenewal/project/glite-px-proxyrenewal.spec @@ -89,14 +89,13 @@ rm -rf $RPM_BUILD_ROOT %pre -n %{name}-clients getent group glite >/dev/null || groupadd -r glite getent passwd glite >/dev/null || useradd -r -g glite -d /var/glite -c "gLite user" glite +mkdir -p /var/glite /var/log/glite 2>/dev/null || : +chown glite:glite /var/glite /var/log/glite +exit 0 %post -n %{name}-clients /sbin/chkconfig --add glite-proxy-renewald -if [ $1 -eq 1 ] ; then - # XXX: or rather to detect finalized set-up in the start-up scripts? - /sbin/chkconfig glite-proxy-renewald off -fi %preun -n %{name}-clients @@ -108,8 +107,7 @@ fi %postun -n %{name}-clients if [ "$1" -ge "1" ] ; then - # XXX: detect finalized set-up in the start-up scripts - /sbin/service glite-proxy-renewald restart >/dev/null 2>&1 || : + /sbin/service glite-proxy-renewald condrestart >/dev/null 2>&1 || : fi -- 1.8.2.3