Personal tools
You are here: Home ZOPE Zope自動起動の設定

今の天気
     25℃ 78% 1008hPa N 3m
福岡地方の今の天気
« August 2008 »
Su Mo Tu We Th Fr Sa
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
最近のログイン

seko
2008/08/30 21:17

Papasan
2008/08/30 07:20

hage88
2008/08/29 23:08

hiroakinagato
2008/08/23 14:54

Classiclll
2008/08/20 20:11

猫さん。
2008/08/20 05:58

魔流
2008/08/14 22:26

Navigation
 
Document Actions

Zope自動起動の設定

by Papasan last modified 2007-10-19 17:30

Zopeをソースからインストールしたときの自動起動設定方法

出典元:「Knowledge of Informational Engineers in Kyoto University.」

  1. /etc/init.d/zope として以下の起動用シェルスクリプト を作成します。:
     シェルスクリプト
    #!/bin/sh
    #
    # zope Start/Stop the Zope web-application server.
    #
    # chkconfig: 2345 73 73
    # description: zope is a web server specifically for handling \
    #              HTTP requests to the Zope web-application service.
    #
    # Source function library.
    . /etc/rc.d/init.d/functions
    #
    INSTANCE_HOME=/var/lib/zope
    INSTANCE_NAME=`basename ${INSTANCE_HOME}`
    RETVAL=0
    [ -f ${INSTANCE_HOME}/bin/zopectl ] || exit 0
    #
    case "$1" in
      start)
            echo -n "Starting zope: "
            umask 077
            ${INSTANCE_HOME}/bin/zopectl start > /dev/null 2>&1
            RETVAL=$?
            [ $RETVAL -eq 0 ] && success || failure
            echo
            [ $RETVAL -eq 0 ] && touch /var/lock/subsys/${INSTANCE_NAME}
            ;;
      stop)
            echo -n "Shutdown zope: "
            ${INSTANCE_HOME}/bin/zopectl stop > /dev/null 2>&1
            RETVAL=$?
            [ $RETVAL -eq 0 ] && success || failure
            echo
            [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/${INSTANCE_NAME}
            ;;
      restart|reload)
            $0 stop
            $0 start
            RETVAL=$?
            ;;
      condrestart)
            [ -f /var/lock/subsys/${INSTANCE_NAME} ] && $0 restart || RETVAL=0
            ;;
      status)
            ${INSTANCE_HOME}/bin/zopectl status
            [ $RETVAL -ne 0 ] && RETVAL=$?
            ;;
      *)
            echo "Usage: zope {start|stop|restart|condrestart|status}"
            exit 1
    esac
    #
    exit $RETVAL
    
  2. マシン起動時に自動起動されるように設定する。:
     # chown root:root /etc/init.d/zope
     # chmod 755 /etc/init.d/zope
     # /sbin/chkconfig --add zope
     # /usr/sbin/ntsysv <-- 自動起動サービスとしてチェックされてなければチェックする。Vine2.6などで起動できない場合は、次のようにしてみる。
      # cgkconfig --list | grep 5:on で確認して、リストになければ # chkconfig zope on
    
  3. 手操作での起動と停止:
     # /sbin/service zope [start | stop | restart | status | condrestart]
    
  4. Zope設定ファイル(/var/lib/zope/etc/zope.conf)に実効ユーザ(zope)を指定する。

    変更前:

      # Directive: effective-user
    #
    # Description:
    #     If you intend to run Zope as the "root" user, you must supply this
    #     directive with an effective username or userid number to which Zope
    #     will 'suid' after the server ports are bound. This directive only
    #     has effect under UNIX and if Zope is started as the root user.
    #
    # Default: unset
    #
    # Example:
    #
    #    effective-user chrism
    

    変更後:

      # Directive: effective-user
    #
    # Description:
    #     If you intend to run Zope as the "root" user, you must supply this
    #     directive with an effective username or userid number to which Zope
    #     will 'suid' after the server ports are bound. This directive only
    #     has effect under UNIX and if Zope is started as the root user.
    #
    # Default: unset
    #
    # Example:
    #
    #    effective-user chrism
    # Papasan added.
    effective-user zope <-- この1行を追記する。