[xrootd: 26/26] - Add startup scripts for cmsd service that replaces the deprecated olbd service
Mattias Ellert
ellert at fedoraproject.org
Wed Sep 1 08:53:08 UTC 2010
commit 5c8b77d0e1c5ff06db950c9b1a56f3923fccb1f6
Author: Mattias Ellert <mattias.ellert at fysast.uu.se>
Date: Wed Sep 1 10:51:31 2010 +0200
- Add startup scripts for cmsd service that replaces the deprecated
olbd service
cmsd.init | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
cmsd.sysconfig | 3 ++
xrootd.logrotate | 1 +
xrootd.spec | 50 ++++++++++++++++++++++---------
4 files changed, 124 insertions(+), 15 deletions(-)
---
diff --git a/cmsd.init b/cmsd.init
new file mode 100644
index 0000000..ce1c632
--- /dev/null
+++ b/cmsd.init
@@ -0,0 +1,85 @@
+#! /bin/sh
+#
+# cmsdd Start/Stop the CMSD daemon
+#
+# chkconfig: - 20 80
+# description: The cmsd daemon runs the XRD control network.
+#
+# processname: cmsd
+# pidfile: /var/run/cmsd.pid
+# config:
+
+CMSD=/usr/bin/cmsd
+
+# Source function library.
+. /etc/init.d/functions
+
+# Get config.
+. /etc/sysconfig/network
+
+# Get cmsd config
+[ -f /etc/sysconfig/cmsd ] && . /etc/sysconfig/cmsd
+
+# Configure the environment
+[ ! -z "$CMSDENVCONFIG" ] && [ -f "$CMSDENVCONFIG" ] && . $CMSDENVCONFIG
+
+# Check that networking is up.
+if [ ${NETWORKING} = "no" ]
+then
+ exit 0
+fi
+
+[ -x $CMSD ] || exit 0
+
+RETVAL=0
+prog="cmsd"
+
+start() {
+ echo -n $"Starting $prog: "
+ # Options are specified in /etc/sysconfig/cmsd .
+ # $CMSDUSER *must* be the name of an existing non-privileged user.
+ daemon $CMSD -b -l $CMSDLOG -R $CMSDUSER -c $CMSDCF $CMSDDEBUG
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/cmsd
+ return $RETVAL
+}
+
+stop() {
+ [ ! -f /var/lock/subsys/cmsd ] && return 0 || true
+ echo -n $"Stopping $prog: "
+ killproc cmsd
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/cmsd
+ return $RETVAL
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ status)
+ status cmsd
+ RETVAL=$?
+ ;;
+ restart|reload)
+ stop
+ start
+ ;;
+ condrestart)
+ if [ -f /var/lock/subsys/cmsd ]; then
+ stop
+ start
+ fi
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
+ exit 1
+esac
+
+exit $RETVAL
diff --git a/cmsd.sysconfig b/cmsd.sysconfig
new file mode 100644
index 0000000..842dde6
--- /dev/null
+++ b/cmsd.sysconfig
@@ -0,0 +1,3 @@
+CMSDLOG=/var/log/xrootd/cmsd.log
+CMSDUSER=xrootd
+CMSDCF=/etc/xrootd/cmsd.cf
diff --git a/xrootd.logrotate b/xrootd.logrotate
index 6b15b63..80ae68d 100644
--- a/xrootd.logrotate
+++ b/xrootd.logrotate
@@ -4,4 +4,5 @@
daily
rotate 30
compress
+ copytruncate
}
diff --git a/xrootd.spec b/xrootd.spec
index 95f937c..7cdd314 100644
--- a/xrootd.spec
+++ b/xrootd.spec
@@ -4,7 +4,7 @@
Name: xrootd
Version: 20100315
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: Extended ROOT file server
Group: System Environment/Daemons
@@ -18,9 +18,11 @@ Source0: http://xrootd.slac.stanford.edu/download/%{version}-1007/%{name}-%{vers
Source1: xrootd-manpages.tar.gz
Source2: %{name}.init
Source3: %{name}.sysconfig
-Source4: olbd.init
-Source5: olbd.sysconfig
-Source6: %{name}.logrotate
+Source4: cmsd.init
+Source5: cmsd.sysconfig
+Source6: olbd.init
+Source7: olbd.sysconfig
+Source8: %{name}.logrotate
Patch0: %{name}-jni.patch
Patch1: %{name}-perl-java.patch
Patch2: %{name}-dso.patch
@@ -52,15 +54,21 @@ Requires(postun): initscripts
%description
The Extended root file server consists of a file server called xrootd
-and a clustering server called olbd.
+and a cluster management server called cmsd.
-The server names are historical. The xrootd server was developed for
-the root analysis framework to serve root files. However, the server
-is agnostic to filetypes and provides POSIX-like access to any type
-of file. The olbd server was originally developed to cluster and load
-balance Objectivity/DB AMS database servers. Because the olbd was
-designed to work independently of the data server, it was easily
-usable with xrootd.
+The xrootd server was developed for the root analysis framework to
+serve root files. However, the server is agnostic to filetypes and
+provides POSIX-like access to any type of file.
+
+The cmsd server is the next generation version of the olbd server,
+originally developed to cluster and load balance Objectivity/DB AMS
+database servers. It provides enhanced capability along with lower
+latency and increased throughput.
+
+The old and now deprecated olbd server is still provided by the
+package, but it will be removed in a future release. If you are still
+using it consider scheduling a migration to the new cmsd server
+instead.
%package libs
Summary: Libraries used by xrootd servers and clients
@@ -201,13 +209,17 @@ install -p %{SOURCE2} $RPM_BUILD_ROOT%{_initrddir}/%{name}
install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}
echo '# Put your xrootd configuration here' \
> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.cf
-install -p %{SOURCE4} $RPM_BUILD_ROOT%{_initrddir}/olbd
-install -p -m 644 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/olbd
+install -p %{SOURCE4} $RPM_BUILD_ROOT%{_initrddir}/cmsd
+install -p -m 644 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/cmsd
+echo '# Put your cmsd configuration here' \
+ > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cmsd.cf
+install -p %{SOURCE6} $RPM_BUILD_ROOT%{_initrddir}/olbd
+install -p -m 644 %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/olbd
echo '# Put your olbd configuration here' \
> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/olbd.cf
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}
mkdir $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
-install -p -m 644 %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name}
+install -p -m 644 %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name}
# Man pages
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
@@ -234,20 +246,24 @@ exit 0
%post
if [ $1 = 1 ]; then
/sbin/chkconfig --add %{name}
+ /sbin/chkconfig --add cmsd
/sbin/chkconfig --add olbd
fi
%preun
if [ $1 = 0 ]; then
/sbin/service %{name} stop >/dev/null 2>&1 || :
+ /sbin/service cmsd stop >/dev/null 2>&1 || :
/sbin/service olbd stop >/dev/null 2>&1 || :
/sbin/chkconfig --del %{name}
+ /sbin/chkconfig --del cmsd
/sbin/chkconfig --del olbd
fi
%postun
if [ $1 -ge 1 ]; then
/sbin/service %{name} condrestart >/dev/null 2>&1 || :
+ /sbin/service cmsd condrestart >/dev/null 2>&1 || :
/sbin/service olbd condrestart >/dev/null 2>&1 || :
fi
@@ -346,6 +362,10 @@ fi
%doc %{_docdir}/%{name}-%{version}
%changelog
+* Wed Sep 01 2010 Mattias Ellert <mattias.ellert at fysast.uu.se> - 20100315-4
+- Add startup scripts for cmsd service that replaces the deprecated
+ olbd service
+
* Fri Jul 09 2010 Mattias Ellert <mattias.ellert at fysast.uu.se> - 20100315-3
- Fix broken jar
More information about the scm-commits
mailing list