- Solaris (SPARC, X86, X64) 자료실 -

순간을 위해 평생을 준비하라.
기회란 언제나 예고 없이 찾아온다 항상 낚싯대를 던져 놓아라.
전혀 기대하지 않았던 곳에서 고기가 잡히리라.




Vote Reply Modify Forward Prev Next List

  작성자   : 조성환 [ ladmin ] 추천: 2813, 수정: 1, 조회: 8097, 줄수: 107, 분류: Etc.
rc 스크립트 샘플 (자동 스크립트를 응용해서 만들면 유용함)

[spam:/etc/rc2.d] #   cat spamsniper



#!/bin/sh

################################################################################
# Spamsniper                                                                   #
#                                                                              #
# Writed      : 2005. 5. 2                                                     #
# Function    : Spamsniper Service start and stop                              #
# Usage       : ./spamsniper {start|stop}                                      #
# Comments to support chkconfig on RedHat Linux                                #
# chkconfig: 2345 99 99                                                        #
# description: Spamsniper Service start and stop                               #
#                                                                              #
################################################################################

OS=`uname -s`

if [ $OS = "Linux" ]; then
       # Source function library.
       . /etc/rc.d/init.d/functions

       # Source networking configuration.
       if [ ! -f /etc/sysconfig/network ]; then
       exit 0
       fi

       . /etc/sysconfig/network

       # Check that networking is up.
       [ ${NETWORKING} = "no" ] && exit 0
fi


LD_LIBRARY_PATH=".:/usr/local/lib:/usr/lib:/lib:/usr/X11R6/lib:/usr/local/lib/mysql"

PATH=".:/bin:/sbin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/ucb:/usr/ccs/bin"

export LD_LIBRARY_PATH PATH

case "$1" in
       'start')
               echo "=================================================="
               echo "Starting Spamsniper Service Daemon..."

               /sniper/init.d/httpd start            ; sleep 1
               /sniper/init.d/mysqld start           ; sleep 1
               /sniper/init.d/sophosd start          ; sleep 1
               /sniper/init.d/log_brokerd start      ; sleep 1
               /sniper/init.d/ai_blockingd start     ; sleep 1
               /sniper/init.d/snipe start            ; sleep 1
               /sniper/init.d/rrd start              ; sleep 1
               /sniper/init.d/crond start            ; sleep 1
               /sniper/init.d/wv_detectord start     ; sleep 1
               /sniper/init.d/spamcheckerd start

               echo ""
               ;;

       'stop')
               echo "=================================================="
               echo "Stopping Spamsniper Service Daemon..."

               /sniper/init.d/httpd stop
               /sniper/init.d/snipe stop
               /sniper/init.d/log_brokerd stop
               /sniper/init.d/ai_blockingd stop
               /sniper/init.d/sophosd stop
               /sniper/init.d/crond stop
               /sniper/init.d/wv_detectord stop
               /sniper/init.d/mysqld stop
               /sniper/init.d/rrd stop
               /sniper/init.d/spamcheckerd stop
               /sniper/web-aux/tools/init.sh stop

               echo ""
               ;;

       'cdb')
               echo ""
               /sniper/init.d/snipe cdb
               ;;

       'restart')
               echo "Restarting Spamsniper Service Daemon..."

               /sniper/init.d/snipe restart

               echo ""
               ;;

       *)
               echo "Usage: $0 {start|stop|help}"
               exit 1
               ;;
esac

exit 0





이전: phpMyAdmin config.inc.php 파일 (샘플)
다음: Apache apr, aprutil, ant 설치 방법
2006/11/11(02:22) from 59.30.129.220
CrazyWWWBoard 2000

Vote Reply Modify Forward Prev Next List

(c) Nobreak Technologies, Inc.