(자꾸 까먹어서 적어 놓습니다 ;;)
예를들어, sshd를 돌리고 싶다고 하겠습니다. 그리고 지금 fedora core 3을 깔았다고 해보죠. 그러면 일단 ls /etc/init.d/sshd 를 해보면 이미 시작/재시작/종료 등을 위한 스크립트가 있음을 알 수 있습니다. 그러면, 런레벨 2,3,4,5에서 이를 on 하도록 설정 해보겠습니다. (참고로 런레벨 4는 unused지만 그 런레벨에서도 활성화 시키더군요. 이유는 모르겠지만…)
$chkconfig –level 2345 sshd on
간단하죠?
마찬가지로 fedora에는 vsftpd 정도는 /etc/init.d 에 이미 다 있습니다. 다만 자동 시작이 안되게 되어있어서 그렇죠. 마찬가지로 httpd도 있죠. 이들을 2345에서 시작시키려면 역시나
$chkconfig –level 2345 vsftpd on
$chkconfig –level 2345 httpd on
그리고 현재 런레벨이 3(다사용자), 또는 5(X윈도우)인 상태로 이미 진입해있는 상태니까 껐다켜지 않는한 chkconfig 내용이 반영은 안됩니다. 따라서 서비스는 별도로 실행을 시켜줘야합니다.
$service sshd start
실행방법은 위와 같습니다. 하지만 사실은 저렇게 실행하나
$/etc/init.d/sshd start
로 실행하나 같은 내용입니다.
하지만 sshd 같은 서비스 등록이 공짜로 한번에 되는건 아닙니다. man chkconfig 를 해보면 나오지만,
chkconfig 를 위한 설정
For example, random.init has these three lines:
# chkconfig: 2345 20 80
# description: Saves and restores system entropy pool for \
# higher quality random number generation.
This says that the random script should be started in levels 2, 3, 4,
and 5, that its start priority should be 20, and that its stop priority
should be 80. You should be able to figure out what the description
says; the \ causes the line to be continued. The extra space in front
of the line is ignored.
뭐 어쨌든 rc<레벨>.d 디렉토리 들어가서 일일히 심볼릭 링크 만들던거 생각하면 편한거죠..