起動rcスクリプト

 #!/bin/bash
 # chkconfig: 345 99 15
 # description: sample app
 
 PATH=/home/taro/bin:$PATH
 
 start() {
     cd /home/taro
     su taro -c "bin/myserver >/dev/null 2>&1 &"
 }
 
 stop() {
     killall myserver
 }
 
 case "$1" in
     start)
         start
         ;;
     stop)
         killall myserver
         ;;
     restart)
         stop
         sleep 1
         start
         ;;
     *)
     echo USAGE: "$0 {start|stop|restart}"
     exit 1
 esac

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS

Last-modified: 2013-10-01 (火) 13:32:59