AI 설치를 테스트하기 전에 서비스를 테스트하려면 간단히 테스트 시스템에 패키지를 설치하고 해당 테스트 시스템을 재부트하면 됩니다.
# pkg install first-boot-script Packages to install: 1 Create boot environment: No Create backup boot environment: No DOWNLOAD PKGS FILES XFER (MB) SPEED Completed 1/1 2/2 0.0/0.0 0B/s PHASE ITEMS Installing new actions 7/7 Updating package state database Done Updating image state Done Creating fast lookup database Done Reading search index Done # pkg list first-boot-script NAME (PUBLISHER) VERSION IFO first-boot-script (firstboot) 1.0-0 i-- # pkg info first-boot-script Name: first-boot-script Summary: AI first-boot script Description: Script that runs at first boot after AI installation Category: System/Administration and Configuration State: Installed Publisher: firstboot Version: 1.0 Build Release: 5.11 Branch: 0 Packaging Date: Dec 23, 2013 02:50:31 PM Size: 3.89 kB FMRI: pkg://firstboot/first-boot-script@1.0,5.11-0:20131223T145031Z
테스트 시스템을 재부트합니다. 위에 표시된 대로 스크립트가 새 부트 환경을 만든 경우 새 부트 환경으로 부트해야 합니다.
스크립트가 /opt/site 디렉토리에 있고 스크립트의 결과가 올바른지 확인합니다.
서비스의 상태를 확인합니다. 스크립트를 마치고 올바르게 종료된 경우 서비스가 disabled 상태여야 합니다.
# svcs first-boot-script-svc STATE STIME FMRI disabled 8:24:16 svc:/site/first-boot-script-svc:default
다음 명령 중 하나를 사용하여 completed 등록 정보의 값을 확인합니다.
# svcprop first-boot-script-svc:default config/completed boolean true # svcprop -p config/completed first-boot-script-svc:default true
서비스 로그 파일을 검토하려면 다음 명령을 사용하여 로그 파일의 위치를 찾습니다.
# svcs -x first-boot-script-svc svc:/site/first-boot-script-svc:default (?) State: disabled since Dec 23, 2013 08:24:16 AM PDT Reason: Temporarily disabled by service method: "Configuration completed." See: http://support.oracle.com/msg/SMF-8000-1S See: /var/svc/log/site-first-boot-script-svc:default.log Impact: This service is not running.
로그 파일은 다음 정보를 포함합니다.
[ Jul 23 08:22:57 Enabled. ] [ Jul 23 08:24:14 Executing start method ("/opt/site/first-boot-script.sh"). ] [ Jul 23 08:24:16 Method "start" exited with status 101. ] [ Jul 23 08:24:16 "start" method requested temporary disable: "Configuration completed" ] [ Jul 23 08:24:16 Rereading configuration. ]