OSDN Git Service

Merge branch 'dev' master v0.7.0
authorKei Funagayama <kei.topaz@gmail.com>
Fri, 16 Jul 2010 10:34:06 +0000 (19:34 +0900)
committerKei Funagayama <kei.topaz@gmail.com>
Fri, 16 Jul 2010 10:34:06 +0000 (19:34 +0900)
Conflicts:
doc/redhat.spec

1  2 
doc/rc.d/init.d/silhouetted
doc/redhat.spec

@@@ -2,7 -2,7 +2,7 @@@
  #
  # silhouetted  The startup script for the Pysilhouette system.
  #
 -# chkconfig: 345 97 03
 +# chkconfig: 2345 97 03
  # description: Pysilhouette is an application running in the background system.
  #
  # processname: silhouetted
  # pidfile: /var/run/silhouetted.pid
  #          /var/run/schedulerd.pid
  #          /var/run/performerd.pid
+ #          /var/run/asynperformerd.pid
+ #          /var/run/asynschedulerd.pid
+ #
  # lockfile: /var/lock/subsys/silhouetted
  #           /var/lock/subsys/schedulerd
  #           /var/lock/subsys/performerd
+ #           /var/lock/subsys/asynperformerd
+ #           /var/lock/subsys/asynschedulerd
+ #
  
  source /etc/rc.d/init.d/functions
  source /etc/sysconfig/network
@@@ -33,6 -39,8 +39,8 @@@ progd="silhouetted
  app="pysilhouette"
  sch_progd='schedulerd'
  per_progd='performerd'
+ asyn_sch_progd='asynschedulerd'
+ asyn_per_progd='asynperformerd'
  
  sysconfig="/etc/sysconfig/${progd}"
  
@@@ -53,6 -61,10 +61,10 @@@ sch_pidfile="/var/run/${sch_progd}.pid
  sch_lockfile="/var/lock/subsys/${sch_progd}"
  per_pidfile="/var/run/${per_progd}.pid"
  per_lockfile="/var/lock/subsys/${per_progd}"
+ asyn_sch_pidfile="/var/run/${asyn_sch_progd}.pid"
+ asyn_sch_lockfile="/var/lock/subsys/${asyn_sch_progd}"
+ asyn_per_pidfile="/var/run/${asyn_per_progd}.pid"
+ asyn_per_lockfile="/var/lock/subsys/${asyn_per_progd}"
  
  # Daemon mode.
  extra_args=""
@@@ -78,15 -90,15 +90,15 @@@ start() 
            return 1
      fi
  
-     touch ${pidfile} ${sch_pidfile} ${per_pidfile}
-     chown ${USER}:${GROUP} ${pidfile} ${sch_pidfile} ${per_pidfile}
+     touch ${pidfile} ${sch_pidfile} ${per_pidfile} ${asyn_sch_pidfile} ${asyn_per_pidfile}
+     chown ${USER}:${GROUP} ${pidfile} ${sch_pidfile} ${per_pidfile} ${asyn_sch_pidfile} ${asyn_per_pidfile}
      if [ "x${PYTHON_SEARCH_PATH}" != "x" ]; then
          env="PYTHONPATH=${PYTHON_SEARCH_PATH}:\$PYTHONPATH"
      fi
      ${SU} -l ${USER} -c "${env} ${PYTHON} ${PREFIX}/opt/pysilhouette/bin/${prog}.py ${CMD_ARGS}"
      RETVAL=$?
      if [ ${RETVAL} -eq 0 ]; then
-         touch ${lockfile} ${sch_lockfile} ${per_lockfile}
+         touch ${lockfile} ${sch_lockfile} ${per_lockfile} ${asyn_sch_lockfile} ${asyn_per_lockfile}
          success
      else
          failure 
@@@ -120,24 -132,46 +132,46 @@@ stop() 
      if [ ${SIL_RETVAL} -eq 0 ]; then
          rm -f ${lockfile}
          rm -f ${pidfile}
-     fi  
+     fi
+     # scheduler
      eval "/etc/rc.d/init.d/${sch_progd} stop"
      SCH_RETVAL=$?
      if [ ${SCH_RETVAL} -eq 0 ]; then
          rm -f ${sch_lockfile}
          rm -f ${sch_pidfile}
-     fi  
+     fi
+     # performer
      eval "/etc/rc.d/init.d/${per_progd} stop"
      PER_RETVAL=$?
      if [ ${PER_RETVAL} -eq 0 ]; then
          rm -f ${per_lockfile}
          rm -f ${per_pidfile}
-     fi  
+     fi
+     # asynscheduler
+     eval "/etc/rc.d/init.d/${asyn_sch_progd} stop"
+     ASYN_SCH_RETVAL=$?
+     if [ ${ASYN_SCH_RETVAL} -eq 0 ]; then
+         rm -f ${asyn_sch_lockfile}
+         rm -f ${asyn_sch_pidfile}
+     fi
+     # asynperformer
+     eval "/etc/rc.d/init.d/${asyn_per_progd} stop"
+     ASYN_PER_RETVAL=$?
+     if [ ${ASYN_PER_RETVAL} -eq 0 ]; then
+         rm -f ${asyn_per_lockfile}
+         rm -f ${asyn_per_pidfile}
+     fi
      # The return code of the performer daemon is the first digit. 
      # The return code of the scheduler daemon is the second digit. 
      # The return code of the silhouetted daemon is the third digit. 
      # All stop functions return only the exit code of 0(Normal) or 1(Abnormal).
-     RETVAL=`expr ${SIL_RETVAL} \* 100 + ${SCH_RETVAL} \* 10 + ${PER_RETVAL}`
+     #RETVAL=`expr ${SIL_RETVAL} \* 100 + ${SCH_RETVAL} \* 10 + ${PER_RETVAL}`
+     RETVAL=`expr ${SIL_RETVAL} \* 10000 + ${SCH_RETVAL} \* 1000 + ${PER_RETVAL} \* 100 + ${ASYN_SCH_RETVAL} \* 10 + ${ASYN_PER_RETVAL}`
      return ${RETVAL}
  }
  
@@@ -166,6 -200,8 +200,8 @@@ case "$1" i
        status ${progd}
      eval "/etc/rc.d/init.d/${sch_progd} status"
      eval "/etc/rc.d/init.d/${per_progd} status"
+     eval "/etc/rc.d/init.d/${asyn_sch_progd} status"
+     eval "/etc/rc.d/init.d/${asyn_per_progd} status"
        RETVAL=$?
        ;;
      *)
diff --combined doc/redhat.spec
@@@ -1,12 -1,11 +1,12 @@@
  %define name pysilhouette
- %define version 0.6.3
- %define release 2
+ %define version 0.7.0
+ %define release 1
  %define date %(echo `LANG=C date +%%Y%%m%%d%%H%%M%%S`)
  
  %define _prefix /opt
  
  %define __python $(which python)
 +%define __chkconfig     /sbin/chkconfig
  %define __app pysilhouette
  %define __prog silhouette
  %define __progd %{__prog}d
@@@ -22,7 -21,7 +22,7 @@@
  %define _uid_max        350
  
  Summary: A python-based background job manager
- Summary(ja): ã\82ªã\83¼ã\83\97ã\83³ã\82½ã\83¼ã\82¹ã\81®ã\83\90ã\83\83ã\82¯ã\82°ã\83©ã\82¦ã\83³ã\83\89ã\82¸ã\83§ã\83\96ã\83\9eã\83\8dã\83¼ã\82¸ã\83£ã\83¼
+ Summary(ja): オープンソースバックグラウンドジョブマネージャー
  Name: %{name}
  Version: %{version}
  #Release: %{release}.%{date}
@@@ -71,8 -70,10 +71,10 @@@ install -c -m 644 doc/whitelist.conf.ex
  install -c -m 644 doc/rc.d/init.d/* $RPM_BUILD_ROOT%{_initrddir}/
  install -c -m 644 doc/sysconfig/%{__progd} $RPM_BUILD_ROOT/etc/sysconfig/%{__progd}
  
- chmod +x $RPM_BUILD_ROOT%{python_sitelib}/%{__app}/%{__prog}.py
- %{__ln_s} %{python_sitelib}/%{__app}/%{__prog}.py $RPM_BUILD_ROOT%{__bindir}
+ install -c -m 744 tool/psil-cleandb $RPM_BUILD_ROOT%{__bindir}
+ install -c -m 744 tool/psil-set $RPM_BUILD_ROOT%{__bindir}
+ chmod +x %{__app}/%{__prog}.py
  
  %clean
  rm -rf $RPM_BUILD_ROOT
@@@ -111,20 -112,21 +113,23 @@@ if [ $? -ne 0 ]; the
  fi
  
  %post
+ #echo "%{__ln_s} %{python_sitelib}/%{__app}/%{__prog}.py %{__bindir}"
+ %{__ln_s} %{python_sitelib}/%{__app}/%{__prog}.py %{__bindir}
  if [ ! -e %{__datadir} ]; then
    mkdir -p %{__datadir} 2> /dev/null
  fi
  %{__chkconfig} --add silhouetted >/dev/null 2>&1
  %{__chkconfig} silhouetted on >/dev/null 2>&1
 +#%{_initrddir}/silhouetted start >/dev/null 2>&1
  
  %postun
+ rm -f %{__bindir}/%{__prog}.py
  if [ $1 = 0 ]; then
    /usr/sbin/userdel %{_user} 2> /dev/null || :
    /usr/sbin/groupdel %{_group} 2> /dev/null || :
  fi
 -
 +#%{_initrddir}/silhouetted stop >/dev/null 2>&1
 +#%{__chkconfig} --del silhouetted >/dev/null 2>&1
  
  %files -f INSTALLED_FILES
  %defattr(-,root,root)
  %attr(0644, root, root) %config(noreplace) %{__sysconfdir}/whitelist.conf
  %attr(0644, root, root) %{__sysconfdir}/whitelist.conf.example
  %attr(0644, root, root) %config(noreplace) /etc/sysconfig/%{__progd}
- %{__bindir}/%{__prog}.py
+ #%{__bindir}/%{__prog}.py
+ %{__bindir}/psil-cleandb
+ %{__bindir}/psil-set
  %dir /var/log/%{__app}
  
  %changelog
- * Fri Jun 04 2010 Kei Funagayama <kei.topaz@gmail.com> - 0.6.3-2
- - bugfix: http://list.karesansui-project.info/pipermail/karesansui-users-jp/2010-June/000063.html
+ * Fri Jul 29 2010 Kei Funagayama <kei.topaz@gmail.com> - 0.7.0-1
+ - 0.7.0 released.
+ * Tue Jun 29 2010 Kei Funagayama <kei.topaz@gmail.com> - 0.7.0-1beta3
+ - 0.7.0 beta3 released.
+ * Fri Apr 09 2010 Kei Funagayama <kei.topaz@gmail.com> - 0.7.0-1beta2
+ - 0.7.0 beta2 released.
+ * Fri Apr 09 2010 Kei Funagayama <kei.topaz@gmail.com> - 0.7.0-1beta1
+ - 0.7.0 beta1 released.
+ * Wed Jan 03 2010 Kei Funagayama <kei@karesansui-project.info> - 0.7.0-1alpha1
+ - 0.7.0 alpha1 released.
  
  * Tue Aug 04 2009 Kei Funagayama <kei@karesansui-project.info> - 0.6.3-1
  - Add Command Tools.
  
  * Tue Feb 4 2009 HDE Package Maintainer <info@hde.co.jp> - 0.1.0-1
  - Initial build.