Oracle® Solaris 11.2의 시스템 서비스 관리

인쇄 보기 종료

업데이트 날짜: 2014년 7월
 
 

svcbundle을 사용하여 프로파일을 만드는 방법

svc:/system/rmtmpfiles 서비스는 부트 시 /tmp 디렉토리를 정리하는 역할을 수행합니다. 기본적으로 rmtmpfiles 서비스는 /var/tmp를 정리하지 않습니다. 부트 프로세스 중에 /var/tmp를 정리하려면 options/clean_vartmp 등록 정보를 true로 설정하여 svc:/system/rmtmpfiles 서비스의 동작을 변경합니다. 여러 시스템에서 동작을 이와 같이 변경하는 가장 간편한 방법은 프로파일을 만들고 각 시스템의 /etc/svc/profile/site에 저장하는 것입니다.

  1. 프로파일을 만듭니다.

    다음 명령은 /tmp/rmtmpfiles.xml에서 새 프로파일을 만듭니다.

    $ svcbundle -o /tmp/rmtmpfiles.xml -s service-name=system/rmtmpfiles \
    	    -s bundle-type=profile -s service-property=options:clean_vartmp:boolean:true
  2. 필요에 따라 프로파일을 변경합니다.
  3. 프로파일을 올바른 디렉토리로 복사합니다.
    $ cp /tmp/rmtmpfiles.xml /etc/svc/profile/site/rmtmpfiles.xml
  4. 매니페스트 가져오기 서비스를 다시 시작하여 프로파일을 시스템에 적용합니다.
    $ svcadm restart manifest-import
예 4-16  svcbundle을 사용하여 프로파일 자동 설치

새 프로파일을 변경할 필요가 없으면 -i 옵션을 사용하여 생성된 직후 프로파일을 설치합니다. svcbundle 명령은 프로파일을 /etc/svc/profile/site/rmtmpfiles.xml에 쓰고 manifest-import 서비스를 다시 시작합니다. /etc/svc/profile/site 디렉토리에서 이름이 같은 기존 파일을 덮어씁니다.

# svcbundle -i -s service-name=system/rmtmpfiles \
	    -s bundle-type=profile -s service-property=options:clean_vartmp:boolean:true