トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS   ログイン

コンピュータ系/ソフトウェア/OpenLDAP/設定/ファイル/slapd(起動・終了スクリプト) の変更点

[[up>コンピュータ系/ソフトウェア/OpenLDAP/設定/ファイル]]
----
-ディレクトリ:/etc/rc.d/
-ファイル名:slapd
-役割:slapdの起動・終了スクリプト
-備考:
--/etc/rc.d/slapd {start|stop|restart|status}で運用可能
--/etc/rc.confに以下を加えるだけでブート時起動可
---slapd=YES
--pkgsrcでインストールしている場合,ディレクトリ構造が違う.slapd.confを参考に読み替えること.
----
#contents
----
**例: [#bc99b97a]
 #! /bin/sh
 
 progname=slapd
 slapd=/usr/local/libexec/slapd
 pidfile=/usr/local/var/run/slapd.pid
 
 slapd_args=
 
 retval=0
 
 case "$1" in
   start)
     echo -n "Starting $progname:    "
     $slapd $slapd_args
 
     retval=$?
     if [ $retval -eq 0 ]
     then
       echo "OK"
     else
       echo "NG"
     fi
     ;;
   stop)
     echo -n "Stopping $progname:    "
     if [ -r $pidfile ]
     then
       kill -INT `cat $pidfile`
       retval=$?
       if [ $retval -eq 0 ]
       then
         echo "OK"
       else
         echo "NG"
       fi
     else
       retval=1
       echo "NG"
     fi
     ;;
   restart)
     $0 stop
     $0 start
     ;;
   status)
     if [ -r $pidfile ]
     then
       ps -p `cat $pidfile` > /dev/null 2>&1
       retval=$?
 
       if [ $retval -eq 0 ]
       then
         echo "$progname is running"
       else
         echo "$progname is stopping"
       fi
     else
       echo "$progname is stopping"
     fi
     ;;
   *)
     echo "Usage: $0 {start|stop|restart|status}"
     retval=1
 esac
 
 exit $retval

**コマンド一覧 [#o42fd537]