강좌
클라우드/리눅스에 관한 강좌입니다.
리눅스 분류

리눅스데몬 스크립트파일 설명 -1-

작성자 정보

  • 웹관리자 작성
  • 작성일

컨텐츠 정보

본문

리눅스데몬 스크립트파일 설명 -1-

작성자 : (주)수퍼유저코리아, http://www.superuser.co.kr 서버팀


/etc/rc.d/init.d 디렉토리내에 있는 리눅스데몬스크립트 파일들


1. 리눅스 데몬스크립트 파일들 : /etc/rc.d/init.d/파일들

top


리눅스에는 많은 서비스들이 존재하며 이런 서비스들을 위한 데몬들이 존재하며 서비스데몬들을 시작하고 종료하며 재시작하는 등의 작업을 하기위한 스크립트가 또한 존재합니다. , 여러분들께서도 이미 잘 알고 계시는 바와같이 리눅스의 /etc/rc.d/init.d/디렉토리에는 리눅스의 여러가지 서비스데몬들을 시작하고 종료,재시작하는 스크립트파일들이 있습니다.

따라서 이번 장에서 설명하는 내용은 리눅스의 서비스데몬스크립트의 설명과 용도 및 간단한 사용법등에 대해서 다루고 있습니다. 따라서 각각의 서비스데몬스크립트 파일들의 설명과 사용법이라는 점에 고려하시기 바랍니다.

또한 /etc/rc.d/init.d/디렉토리내에 있는 거의 모든파일(101)들을 다루고 있으며 이번 장에서 다루는 각 파일들의 설명순서는 알파벳 오름차순으로 차례대로 설명되어 있습니다.


2. 데몬 스크립트 파일 : /etc/rc.d/init.d/aep1000

top



AEP1000 또는 AEP2000 코프로세스 드라이브를 로드(load)하는 데몬스크립트입니다.

사용옵션 : start|stop|restart|condrestart

사용장치명 : /dev/paep0

데몬파일 : /usr/sbin/aepdaemon


3. 데몬 스크립트 파일 : /etc/rc.d/init.d/amd

top


NFS환경하의 자동마운트데몬 스크립트입니다. 관리자가 직접 마운트를 하지 않아도 필요할 경우에 자동으로 마운트를 시키거나 또는 마운트 해제를 자동으로하는 자동마운트데몬인 amd데몬 스크립트입니다. 그리고 이 데몬은 원격지서버의 특정디렉토리를 마치 로컬서버에 존재하는 디렉토리 처럼 사용가능하기 때문에 매우 편리합니다. 예를 들어 “cd 디렉토리명”과 같이 했다면 지정한 디렉토리명은 원격지의 서버에 존재할 수 있습니다. 이때 amd데몬이 필요에 의해 자동으로 마운트를 시킵니다. 그리고 그 디렉토리를 마치 로컬서버에 존재하는 것처럼 사용할 수 있습니다. 이 또한 NFS를 이용한 분산시스템에 많이 사용될 수 있습니다. NFS 관련 데몬들과 함께 익혀두시기 바랍니다.

하지만 이렇게 편리한 반면 보안에는 매우 취약할 수 있습니다. 따라서 꼭 필요한 경우가 아니면 사용하지 않는 것이 좋습니다.

사용옵션 : start|stop|restart|reload|condrestart|status

프로세스명 : amd

설정파일 : /etc/amd.conf

데몬파일 : /usr/sbin/amd

기타 : /var/lock/subsys/amd

스크립트 사용예

[root@command init.d]# /etc/rc.d/init.d/amd restart

Stopping amd: [ OK ]

Starting amd: [ OK ]

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/amd stop

Stopping amd: [ OK ]

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/amd start

Starting amd: [ OK ]

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/amd status

amd (pid 2459) is running...

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/amd condrestart

Stopping amd: [ OK ]

Starting amd: [ OK ]

[root@command init.d]#

[root@command init.d]# ps -ef | grep amd

root 1716 1 0 09:15 ? 00:00:01 /usr/bin/spamd -d -c -a

root 2565 1 0 09:54 ? 00:00:00 /usr/sbin/amd -F /etc/amd.conf

root 2823 2007 0 10:18 pts/0 00:00:00 grep amd

[root@command init.d]#


4. 데몬 스크립트 파일 : /etc/rc.d/init.d/anacron

top


Anacron데몬 스크립트입니다. Anacron데몬은 주기적인 명령을 실행시켜주는 데몬입니다. 시스템이 중지된 동안에 실행되지않고 남겨져 있던 cron job을 실행합니다. Anacroncron job 리스트가 저장된 /etc/anacrontab 설정파일을 읽어서 그 파일내에 존재하는 각각의 Job들을 지정된 시각에 실행시킵니다.

사용옵션 : start|stop|restart|condrestart|status

데몬파일 : /usr/sbin/anacron

기타 : /var/lock/subsys/anacron

스크립트 사용예

[root@command init.d]# /etc/rc.d/init.d/anacron stop

Stopping anacron: [ OK ]

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/anacron start

Starting anacron: [ OK ]

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/anacron restart

Stopping anacron: [ OK ]

Starting anacron: [ OK ]

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/anacron status

anacron (pid 2218) is running...

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/anacron condrestart

Stopping anacron: [ OK ]

Starting anacron: [ OK ]

[root@command init.d]#

[root@command init.d]# ps -ef | grep anacron

root 1888 1 0 09:15 ? 00:00:00 anacron -s

root 2187 2007 0 09:51 pts/0 00:00:00 grep anacron

[root@command init.d]#


5. 데몬 스크립트 파일 : /etc/rc.d/init.d/apmd

top


시스템 밧데리 상태를 모니터링하거나 밧데리가 부족할 때에 시스템을 중지하기 위하여 사용되는 시스템 전원관리 데몬(/usr/sbin/apmd) 스크립트입니다. 특히 apmd데몬은 밧데리를 주로 사용하는 노트북에 유용하게 사용됩니다.

사용옵션 : start|stop|status|restart|reload|condrestart

데몬 : /usr/sbin/apmd

프로세스명 : apmd

설정파일 : /etc/sysconfig/apmd

시스템설정파일 : /etc/sysconfig/apmd

기타 : /var/lock/subsys/apmd


6. 데몬 스크립트 파일 : /etc/rc.d/init.d/arpwatch

top


이더넷(ethernet)IP의 주소매칭을 위한 arpwatch데몬 스크립트입니다. , 랜카드(이더넷카드, NIC)MAC주소에 할당된 IP주소와의 관계를 유지하기 위한 arpwatch데몬의 스크립트입니다.

사용옵션 : start|stop|status|restart|reload|condrestart

프로세스명 : arpwatch

시스템설정파일 : /etc/sysconfig/network

기타 : /var/lock/subsys/arpwatch

스크립트 사용예

[root@command init.d]# /etc/rc.d/init.d/arpwatch start

Starting arpwatch: [ OK ]

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/arpwatch restart

Stopping arpwatch: [ OK ]

Starting arpwatch: [ OK ]

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/arpwatch stop

Stopping arpwatch: [ OK ]

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/arpwatch status

arpwatch (pid 2128) is running...

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/arpwatch reload

Stopping arpwatch: [ OK ]

Starting arpwatch: [ OK ]

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/arpwatch condrestart

Stopping arpwatch: [ OK ]

Starting arpwatch: [ OK ]

[root@command init.d]#

[root@command init.d]# ps -ef | grep arpwatch

pcap 2128 1 0 09:48 ? 00:00:00 [arpwatch]

root 2132 2007 0 09:48 pts/0 00:00:00 grep arpwatch

[root@command init.d]#


7. 데몬 스크립트 파일 : /etc/rc.d/init.d/atalk

top


AppleTalk Networking Protocol을 통하여 Macintosh 컴퓨터와 리눅스와의 talk기능이 가능하도록 하기위한 데몬 스크립트입니다.

사용옵션 : start|stop|restart|status|condrestart

프로세스명 : atalkd

PID파일 : /var/run/atalkd.pid

설정파일 : /etc/atalk/atalkd.conf

관련디렉토리 : /etc/atalk

스크립트 사용예

[root@command init.d]# /etc/rc.d/init.d/atalk start

Starting AppleTalk services: (backgrounded)

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/atalk restart

Can't unregister command:Workstation@*K ]

Can't unregister command:netatalk@*[ OK ]

Starting AppleTalk services: (backgrounded)

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/atalk stop

Can't unregister command:Workstation@*LED]

Can't unregister command:netatalk@*

/etc/rc.d/init.d/atalk: line 195: kill: (2591) - No such process [ OK ]

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/atalk status

atalkd (pid 2691 2688) is running...

[root@command init.d]#

[root@command init.d]# ps -ef | grep atalk

root 2676 1 0 10:00 ? 00:00:00 papd -f /etc/atalk/papd.conf

root 2680 1 0 10:00 ? 00:00:00 afpd -c 20 -n command -f /etc/atalk/AppleVolumes.default -s /etc/atalk/AppleVolumes.system

root 2691 1 0 10:00 ? 00:00:00 atalkd -f /etc/atalk/atalkd.conf

root 2815 2007 0 10:17 pts/0 00:00:00 grep atalk

[root@command init.d]#


8. 데몬 스크립트 파일 : /etc/rc.d/init.d/atd

top


at명령어에 의해 설정되어 있는 시간에 정의되어 있는 작업을 실행시키는 데몬 스크립트입니다. 또한 시스템부하(load average)가 낮을 경우에 배치명령(batch commands)를 실행하도록 하는 데몬 스크립트입니다.

사용옵션 : start|stop|restart|condrestart|status

프로세스명 : atd

기타 : /var/lock/subsys/atd


스크립트 사용예

[root@command init.d]# /etc/rc.d/init.d/atd start

Starting atd: [ OK ]

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/atd restart

Stopping atd: [ OK ]

Starting atd: [ OK ]

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/atd stop

Stopping atd: [ OK ]

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/atd status

atd (pid 2794) is running...

[root@command init.d]#

[root@command init.d]# ps -ef | grep atd

rpcuser 1560 1 0 09:15 ? 00:00:00 [rpc.statd]

daemon 2794 1 0 10:15 ? 00:00:00 [atd]

root 2811 2007 0 10:16 pts/0 00:00:00 grep atd

[root@command init.d]#


9. 데몬 스크립트 파일 : /etc/rc.d/init.d/autofs

top


오토마운트 파일시스템(Automount Filesystem) 데몬 스크립트입니다. 파일시스템 사용을 요구받았을 경우에는 마운트를 하고 파일시스템 사용이 끝났을 경우에는 마운트를 해제하게 됩니다.

사용옵션 : start|stop|restart|reload|status

프로세스명 : /usr/sbin/automount

설정파일 : /etc/auto.master

스크립트 사용예

[root@command init.d]# /etc/rc.d/init.d/autofs start

Starting automount: No Mountpoints Defined[ OK ]

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/autofs stop

Stopping automount:[ OK ]

[root@command init.d]#

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/autofs restart

Stopping automount:[ OK ]

Starting automount: No Mountpoints Defined[ OK ]

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/autofs status

Configured Mount Points:

------------------------

Active Mount Points:

--------------------

[root@command init.d]#


10. 데몬 스크립트 파일 : /etc/rc.d/init.d/bcm5820

top


BCM5820이란 Broadcom BCM5820 Cryptonet 초기화 스크립트입니다. 이 스크립트는 리눅스 지원을 위한 Broadcom Cryptonet driver에 포함되어 있습니다. 참고로 이에 대한 저작권은 Broadcom Corporation사에 있습니다.

사용옵션 : start|stop|restart|status|condrestart

기타 : /var/lock/subsys/bcm5820


11. 데몬 스크립트 파일 : /etc/rc.d/init.d/bgpd

top


BGPv4, BGPv4+, BGPv4- 라우팅 프로토콜 데몬 스크립트입니다.

사용옵션 : start|stop|restart|reload|condrestart|status

프로세스명 : bgpd

설정파일 : /etc/zebra/bgpd.conf


12. 데몬 스크립트 파일 : /etc/rc.d/init.d/bootparamd

top


bootparamd 데몬스크립트입니다. bootparamd데몬은 썬 워크스테이션(Sun workstations)이 리눅스시스템으로 부터 네트웍부팅을 가능하도록 하는 데몬입니다. RARP와 함께 현재는 거의 사용되지 않는 것으로서 요즘에는 BOOTPDHCP로 대체되고 있습니다.

사용옵션 : start|stop|status|restart|reload

프로세스명 : rpc.bootparamd

설정파일 : /etc/bootparams


13. 데몬 스크립트 파일 : /etc/rc.d/init.d/canna

top



canna 서버데몬 스크립트입니다. CannaCanna Japanese 번역데몬입니다.

사용옵션 : start|stop|restart|condrestart|status

데몬파일위치 : /usr/sbin/cannaserver

기타 : /var/lock/subsys/canna


14. 데몬 스크립트 파일 : /etc/rc.d/init.d/crond

top


cron 데몬 스크립트입니다. 여러분들께서도 잘 아시는 바와 같이 cron은 특정한 시간에 지정된 작업을 주기적으로 하도록 하는 리눅스 작업관리자 데몬입니다. 이런 cron데몬을 시작, 재시작 또는 종료시키는 스크립트입니다.

사용옵션 : start|stop|status|reload|restart|condrestart

설정파일 : /etc/crontab

크론관련파일들

- 시간주기 cron 실행파일보관 디렉토리 : /etc/cron.hourly

- 일주기 cron 실행파일보관 디렉토리 : /etc/cron.daily

- 주주기 cron 실행파일보관 디렉토리 : /etc/cron.weekly

- 월주기 cron 실행파일보관 디렉토리 : /etc/cron.monthly

PID파일 : /var/run/crond.pid

스크립트 사용예

[root@command init.d]# /etc/rc.d/init.d/crond stop

Stopping crond: [ OK ]

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/crond start

Starting crond: [ OK ]

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/crond restart

Stopping crond: [ OK ]

Starting crond: [ OK ]

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/crond status

crond (pid 4037) is running...

[root@command init.d]#

[root@command init.d]# ps -ef | grep cron

root 4037 1 0 11:26 ? 00:00:00 crond

root 4052 2007 0 11:27 pts/0 00:00:00 grep cron

[root@command init.d]#


15. 데몬 스크립트 파일 : /etc/rc.d/init.d/cups

top


CUPSCommon UNIX Printing System을 의미합니다. , Common UNIX Printing System을 위한 데몬이 cupsd이며 이 데몬의 시작과 종료를 가능하게 하는 스크립트입니다. 참고로 이에 대한 저작권은 Easy Software Products사에 있습니다.

사용옵션 : start|stop|restart|condrestart|reload|status

데몬파일 : /usr/sbin/cupsd

기타 : /var/lock/subsys/cups

스크립트 사용예

[root@command init.d]# /etc/rc.d/init.d/cups start

Starting cups: [ OK ]

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/cups stop

Stopping cups: [ OK ]

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/cups start

Starting cups: [ OK ]

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/cups restart

Stopping cups: [ OK ]

Starting cups: [ OK ]

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/cups status

cupsd (pid 4188) is running...

[root@command init.d]#

[root@command init.d]# ps -ef | grep cupsd

root 4188 1 2 11:34 ? 00:00:00 cupsd

root 4234 2007 0 11:34 pts/0 00:00:00 grep cupsd

[root@command init.d]#


16. 데몬 스크립트 파일 : /etc/rc.d/init.d/dhcpd

top


dhcpd 데몬의 시작과 종료를 위한 스크립트입니다. dhcpd데몬은 Dynamic Host Control Protocol Daemon의 약어로서 특정 호스트에게 동적 IP할당을 가능하도록하는 프로토콜 데몬입니다. 즉 특정 호스트에게 통신이 가능하도록 하기위하여 유동IP, 즉 동적인 IP주소와 함께 게이트웨이(Gateway), 서브넷마스크(SubnetMask)등의 네트워크 정보를 제공하는 데몬입니다.

사용옵션 : start|stop|restart|condrestart|status

시스템설정파일 : /etc/sysconfig/dhcpd


17. 데몬 스크립트 파일 : /etc/rc.d/init.d/dhcrelay

top


dhcrelayDHCP(Dynamic Host Control Protocol)에 대한 릴레이(relay)를 제공하기위한 dhcrelay데몬 스크립트입니다.

사용옵션 : start|stop|restart|condrestart|status

데몬파일 : /usr/sbin/dhcrelay


18. 데몬 스크립트 파일 : /etc/rc.d/init.d/firstboot

top


Firstboot은 리눅스가 설치된 후에 처음 부팅될 때에 실행되는 DRUID 스타일(style) 프로그램입니다. 이 프로그램은 먼저 /etc/sysconfig/firstboot파일이 존재하는가를 체크하여 만약 이 파일을 찾지 못한다면 firstboot프로그램은 실행이 될 것이고 만약 이 파일을 찾게 된다면 firstboot프로그램은 실행되지 않을 것입니다.

다음은 firstboot 프로그램을 활용하기 위한 조언입니다.

Firstboot이 현재 시스템에 이미 실행이 되어 있다면 firstboot을 실행시키기 위하여 쉘프롬프트에서 다음과 같이 실행하시기 바랍니다.

1) rm /etc/sysconfig/firstboot

2) /usr/sbin/firstboot

만약 시스템이 부팅되는 과정에서 실행시키려면 다음과 같은 명령어를 이용하시면 됩니다.

1) rm /etc/sysconfig/firstboot

2) chkconfig --level 5 firstboot on

3) reboot


데몬파일 : /usr/sbin/firstboot


19. 데몬 스크립트 파일 : /etc/rc.d/init.d/FreeWnn

top


FreeWnnjserver(Japanese Conversion Engine) 데몬의 시작과 종료등을 위한 스크립트입니다.

사용옵션 : start|stop|status|restart|reload

프로세스명 : jserver

데몬파일 : /usr/bin/jserver

스크립트 사용예

[root@command init.d]# /etc/rc.d/init.d/FreeWnn stop

Shutting down FreeWnn: [ OK ]

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/FreeWnn start

Starting FreeWnn: [ OK ]

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/FreeWnn restart

Shutting down FreeWnn: [ OK ]

Starting FreeWnn: [ OK ]

[root@command init.d]#

[root@command init.d]# /etc/rc.d/init.d/FreeWnn status

jserver (pid 4378) is running...

[root@command init.d]#

[root@command init.d]# ps -ef | grep jserver

wnn 4378 1 0 12:02 pts/0 00:00:00 [jserver]

root 4391 2007 0 12:02 pts/0 00:00:00 grep jserver

[root@command init.d]#


 
copyright.gif

관련자료

댓글 0
등록된 댓글이 없습니다.

공지사항


뉴스광장


  • 현재 회원수 :  60,041 명
  • 현재 강좌수 :  35,842 개
  • 현재 접속자 :  148 명