기본 설명
/etc/init.d/ 는 /etc/rc.d/init.d/ 심볼릭 링크(바로가기) 로 같은 폴더이다
/etc/rc.d/내에는 rc1.d , rc2.d ,rc3.d rc4.d rc5.d ,rc6.d init.d 각 부트레벨을 포함한다
서비스 확인 방법
# service crond
# /etc/init.d/crond status
# chkconfig list
서비스 등록 방법
/etc/init.d 내에 스크립트 작성
# vi /etc/init.d/test
#!/bin/sh
# chkconfig: 234 90 90 ※ chkconfig 등록하기 위해 반드시 필요
# description: test service ※ chkconfig 등록하기 위해 반드시 필요
case $"1" in
start)
echo "start"
;;
stop)
echo "stop"
;;
*)
echo "Usage:{start|stop}"
exit 1
esac
exit 0
# chmod 755 test
# chwon root.root test
# chkconfig --add test
# service test start
# service test stop
참고 사이트
'OS > Linux' 카테고리의 다른 글
[Centos] yum 으로 mysql 설치 (0) | 2014.02.06 |
---|---|
[Centos] rpm 명령어 (0) | 2014.02.06 |
[Centos] apache+tomcat mod_jk를 이용한 연동 (0) | 2014.02.06 |
[Centos] Java 1.7.0.51 설치 (1) | 2014.02.05 |
[Centos] Centos 6.5 tomcat 7.0.50 설치 (0) | 2014.02.05 |