From: Viktor M. <mih...@us...> - 2005-04-27 11:53:30
|
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26639 Modified Files: Makefile.am configure.ac sfcb.spec.in sfcbrepos.sh.in Added Files: sfcb.init-none.in sfcb.init-redhat.in sfcb.init-suse.in Removed Files: sfcb.init-none sfcb.init-redhat sfcb.init-suse Log Message: Bug 1186414: Additional work was necessary to make the renamed package work. Bug 1190811: Changes to support sfcbd in /usr/sbin. --- NEW FILE: sfcb.init-suse.in --- #!/bin/bash # # $Id: sfcb.init-suse.in,v 1.1 2005/04/27 11:53:13 mihajlov Exp $ # ### BEGIN INIT INFO # Provides: sfcb # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Short-Description: Small Footprint CIM Broker Service # Description: Manage the sfcb Service ### END INIT INFO # Source function library. . /etc/rc.status echo $PATH | grep -q @sbindir@ ||PATH=@sbindir@:$PATH if [ -z "$LD_LIBRARY_PATH" ] || echo $LD_LIBRARY_PATH | grep -qv @libdir@ then LD_LIBRARY_PATH=@libdir@:$LD_LIBRARY_PATH export LD_LIBRARY_PATH fi # Add CMPI directory if [ -z "$LD_LIBRARY_PATH" ] || echo $LD_LIBRARY_PATH | grep -qv @libdir@/cmpi then LD_LIBRARY_PATH=@libdir@/cmpi:$LD_LIBRARY_PATH export LD_LIBRARY_PATH fi start() { echo -n "Starting sfcb: " startproc @sbindir@/sfcbd -d rcstatus -v } stop() { echo -n "Shutting down sfcb: " killproc sfcbd rcstatus -v } reload() { echo -n "Reloading sfcb configuration: " killproc -HUP sfcbd rcstatus -v } case "$1" in start) start ;; stop) stop ;; status) checkproc sfcbd rc_status -v ;; restart) stop start ;; reload) reload ;; condrestart) $0 status if test $? = 0; then $0 restart else rc_reset fi rc_status ;; *) echo "Usage: sfcb {start|stop|status|reload|restart|condrestart}" exit 1 ;; esac exit $? --- NEW FILE: sfcb.init-none.in --- #!/bin/bash # # $Id: sfcb.init-none.in,v 1.1 2005/04/27 11:53:13 mihajlov Exp $ # # Generic System V Init Script echo $PATH | grep -q @sbindir@ ||PATH=@sbindir@:$PATH if [ -z "$LD_LIBRARY_PATH" ] || echo $LD_LIBRARY_PATH | grep -qv @libdir@ then LD_LIBRARY_PATH=@libdir@:$LD_LIBRARY_PATH export LD_LIBRARY_PATH fi # Add CMPI directory if [ -z "$LD_LIBRARY_PATH" ] || echo $LD_LIBRARY_PATH | grep -qv @libdir@/cmpi then LD_LIBRARY_PATH=@libdir@/cmpi:$LD_LIBRARY_PATH export LD_LIBRARY_PATH fi start() { echo -n "Starting sfcb: " @sbindir@/sfcbd -d && echo "done." && return 0 || echo "failed." return 1 } stop() { echo -n "Shutting down sfcb: " killall sfcbd && echo "done." && return 0 || echo "failed." return 1 } reload() { echo -n "Reloading sfcb configuration: " killall -HUP sfcbd && echo "done." && return 0 || echo "failed." return 1 } case "$1" in start) start ;; stop) stop ;; status) echo -n "Checking SFCB status: " ps --noheaders -C sfcbd || echo "stopped." ;; restart) stop start ;; reload) reload ;; *) echo "Usage: sfcb {start|stop|status|reload|restart}" exit 1 ;; esac exit $? --- NEW FILE: sfcb.init-redhat.in --- #!/bin/bash # # $Id: sfcb.init-redhat.in,v 1.1 2005/04/27 11:53:13 mihajlov Exp $ # # chkconfig: 35 20 80 # # description: Small Footprint CIM Broker Service # # processname: sfcbd # # config: @sysconfdir@/sfcb/sfcb.cfg # Source function library. . /etc/init.d/functions echo $PATH | grep -q @sbindir@ ||PATH=@sbindir@:$PATH if [ -z "$LD_LIBRARY_PATH" ] || echo $LD_LIBRARY_PATH | grep -qv @libdir@ then LD_LIBRARY_PATH=@libdir@:$LD_LIBRARY_PATH export LD_LIBRARY_PATH fi # Add CMPI directory if [ -z "$LD_LIBRARY_PATH" ] || echo $LD_LIBRARY_PATH | grep -qv @libdir@/cmpi then LD_LIBRARY_PATH=@libdir@/cmpi:$LD_LIBRARY_PATH export LD_LIBRARY_PATH fi start() { echo -n "Starting sfcb: " daemon @sbindir@/sfcbd -d && touch /var/lock/subsys/sfcb && return 0 || return 1 } stop() { echo -n "Shutting down sfcb: " killproc sfcbd && rm -f /var/lock/subsys/sfcb && return 0 || return 1 } reload() { echo -n "Reloading sfcb configuration: " killproc sfcbd -HUP && return 0 || return 1 } case "$1" in start) start ;; stop) stop ;; status) status sfcbd ;; restart) stop start ;; reload) reload ;; condrestart) [ -f /var/lock/subsys/sfcb ] && restart || : ;; *) echo "Usage: sfcb {start|stop|status|reload|restart|condrestart}" exit 1 ;; esac exit $? --- sfcb.init-redhat DELETED --- Index: Makefile.am =================================================================== RCS file: /cvsroot/sblim/sfcb/Makefile.am,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- Makefile.am 27 Apr 2005 03:10:39 -0000 1.15 +++ Makefile.am 27 Apr 2005 11:53:13 -0000 1.16 @@ -45,7 +45,7 @@ libsfcBasicAuthentication.la \ libsfcIndCIMXMLHandler.la -bin_PROGRAMS = \ +sbin_PROGRAMS = \ sfcbd libsfcBrokerCore_la_SOURCES = \ @@ -156,7 +156,8 @@ EXTRA_DIST=sfcb.cfg.pre.in sfcb.spec sfcbrepos.sh.in sfcbstage.sh.in \ - sfcbunstage.sh.in sfcb.init-redhat sfcb.init-suse sfcb.init-none \ + sfcbunstage.sh.in sfcb.init-redhat.in sfcb.init-suse.in \ + sfcb.init-none.in \ regressionTests doc dist_pkgdata_SCRIPTS=genSslCert.sh getSchema.sh @@ -168,24 +169,28 @@ dist_bin_SCRIPTS=wbemcat sfcbrepos: sfcbrepos.sh - sed s?$$\{prefix\}?$(prefix)?g $< > $@ + sed -e s?$$\{prefix\}?$(prefix)?g \ + -e s?$$\{exec_prefix\}?$(prefix)?g $< > $@ sfcbstage: sfcbstage.sh - sed s?$$\{prefix\}?$(prefix)?g $< > $@ + sed -e s?$$\{prefix\}?$(prefix)?g \ + -e s?$$\{exec_prefix\}?$(prefix)?g $< > $@ sfcbunstage: sfcbunstage.sh - sed s?$$\{prefix\}?$(prefix)?g $< > $@ + sed -e s?$$\{prefix\}?$(prefix)?g \ + -e s?$$\{exec_prefix\}?$(prefix)?g $< > $@ sfcb.cfg: sfcb.cfg.pre - sed s?$$\{prefix\}?$(prefix)?g $< > $@ + sed -e s?$$\{prefix\}?$(prefix)?g \ + -e s?$$\{exec_prefix\}?$(prefix)?g $< > $@ getSchema.sh: getSchema.sh.pre - sed s?$$\{prefix\}?$(prefix)?g $< > $@ + sed -e s?$$\{prefix\}?$(prefix)?g \ + -e s?$$\{exec_prefix\}?$(prefix)?g $< > $@ sfcb.init: sfcb.$(INIT_STYLE) - sed -e "s?@sysconfdir\@?$(sysconfdir)?g" \ - -e "s?@bindir\@?$(bindir)?g" \ - -e "s?@libdir\@?$(libdir)?g" $< > $@ + sed -e s?$$\{prefix\}?$(prefix)?g \ + -e s?$$\{exec_prefix\}?$(prefix)?g $< > $@ providerRegister: providerRegister.c touch $@ @@ -213,6 +218,8 @@ rm -f $(DESTDIR)$(sfcbstatedir)/stage/default.reg rm -f $(DESTDIR)$(sfcbdocdir)/* rm -f $(DESTDIR)$(initdir)/sfcb + -rmdir $(sysconfdir)/sfcb + -rmdir $(sfcbdocdir) clean-local: rm -f sfcbrepos sfcbstage sfcbunstage sfcb.cfg getSchema.sh sfcb.init Index: sfcb.spec.in =================================================================== RCS file: /cvsroot/sblim/sfcb/sfcb.spec.in,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- sfcb.spec.in 26 Apr 2005 17:17:39 -0000 1.8 +++ sfcb.spec.in 27 Apr 2005 11:53:13 -0000 1.9 @@ -4,7 +4,7 @@ # Package spec for @PACKAGE@ # -BuildRoot: /var/tmp/buildroot +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release} Summary: Small Footprint CIM Broker Name: @PACKAGE_TARNAME@ @@ -65,6 +65,7 @@ echo "%{_sysconfdir}/init.d/sfcb" >> _pkg_list echo "%{_localstatedir}/lib/sfcb" >> _pkg_list echo "%{_bindir}/*" >> _pkg_list +echo "%{_sbindir}/*" >> _pkg_list echo "%{_libdir}/*.so*" >> _pkg_list echo ======================================= --- sfcb.init-suse DELETED --- Index: configure.ac =================================================================== RCS file: /cvsroot/sblim/sfcb/configure.ac,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- configure.ac 26 Apr 2005 13:23:55 -0000 1.9 +++ configure.ac 27 Apr 2005 11:53:13 -0000 1.10 @@ -133,5 +133,5 @@ AC_SUBST(MOFC_DIR) fi -AC_CONFIG_FILES([Makefile sfcb.spec sfcbrepos.sh sfcbstage.sh sfcbunstage.sh sfcb.cfg.pre getSchema.sh.pre]) +AC_CONFIG_FILES([Makefile sfcb.spec sfcbrepos.sh sfcbstage.sh sfcbunstage.sh sfcb.cfg.pre getSchema.sh.pre sfcb.init-redhat sfcb.init-suse sfcb.init-none]) AC_OUTPUT Index: sfcbrepos.sh.in =================================================================== RCS file: /cvsroot/sblim/sfcb/sfcbrepos.sh.in,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- sfcbrepos.sh.in 26 Apr 2005 17:17:39 -0000 1.6 +++ sfcbrepos.sh.in 27 Apr 2005 11:53:13 -0000 1.7 @@ -81,33 +81,48 @@ if [ -d $stagingdir ] && [ -f $stagingdir/default.reg ] && [ -f $cimschemadir/CIM_Schema.mof ] then - if rm -rf $registrationdir/repository.previous && - mv -f $registrationdir/repository $registrationdir/repository.previous && - mv -f $registrationdir/providerRegister $registrationdir/providerRegister.previous && - mkdir -p $registrationdir/repository/root/cimv2 && - cp $stagingdir/default.reg $registrationdir/providerRegister + if [ -d $registrationdir/repository ] then - if ls $stagingdir/regs/*.reg > /dev/null 2>&1 - then - if ! cat $stagingdir/regs/*.reg >> $registrationdir/providerRegister - then - echo Failed copying the registration files. >&2 - exit 1 - fi + rm -rf $registrationdir/repository.previous 2> /dev/null + mv -f $registrationdir/repository $registrationdir/repository.previous + if [ $? != 0 ] + then + echo "Failed to remove old repository" >&2 + exit 1 fi - if ls $stagingdir/mofs/*.mof > /dev/null 2>&1 + fi + if [ -f $registrationdir/providerRegister ] + then + mv -f $registrationdir/providerRegister $registrationdir/providerRegister.previous + if [ $? != 0 ] then - if ! sfcbmof -o $registrationdir/repository/root/cimv2/classSchemas -I $cimschemadir -i CIM_Schema.mof $stagingdir/mofs/*.mof - then - echo Failed compiling the MOF files. >&2 - exit 1 - fi + echo "Failed to remove old provider registry" >&2 + exit 1 fi - exit 0 - else - echo Failed to write sfcb registration files. >&2 + fi + mkdir -p $registrationdir/repository/root/cimv2 && + cp $stagingdir/default.reg $registrationdir/providerRegister + if [ $? != 0 ] + then + echo "Failed to create default repository and registry" >&2 exit 1 fi + if ls $stagingdir/regs/*.reg > /dev/null 2>&1 + then + if ! cat $stagingdir/regs/*.reg >> $registrationdir/providerRegister + then + echo Failed copying the registration files. >&2 + exit 1 + fi + fi + if ls $stagingdir/mofs/*.mof > /dev/null 2>&1 + then + if ! sfcbmof -o $registrationdir/repository/root/cimv2/classSchemas -I $cimschemadir -i CIM_Schema.mof $stagingdir/mofs/*.mof + then + echo Failed compiling the MOF files. >&2 + exit 1 + fi + fi else echo Could not find required staging files. Please check your setup. >&2 exit 1 --- sfcb.init-none DELETED --- |