[AIX 운영 체제와 장치 관리 8] AIX Runtime Expert (3) 카탈로그 작성 — Catalog·버전·설명과 국제화·SubCat·ParameterDef·name 속성

핵심 정리

  • 카탈로그는 매개변수 정의와 값을 가져오고 설정하는 명령(구성 방법)을 묶은 내부 파일로, /etc/security/artex/catalogs에 두고 파일 이름이 id에 .xml을 붙인 것과 정확히 같아야 합니다. 사용자가 직접 다루지 않습니다.
  • 작성 순서: 매개변수마다 <ParameterDef> → 같은 명령을 쓰면 <CfgMethod>, 같은 제약이면 <ConstraintDef> → 매개변수마다 <Get type="current">·"nextboot", <Set>, 대상이 필요하면 targetClass와 discover, 재부팅이 필요하면 reboot=true → artexget -r, artexset -c -F -R -l all로 시험(-g 3 -g COMMANDS로 생성 명령 보기).
  • Catalog 속성: id(필수), version(MM.mm), date, priority(set 순서, 양수는 먼저·음수는 나중, 예: aixpertParam은 -1000), inherit(다른 카탈로그 요소를 상속). 주 버전이 엔진과 다르면 0590-117 오류, 주·부 버전이 프로파일과 다르면 0590-218 경고. 새 카탈로그의 부 번호는 0.
  • 설명은 문자열이나 NLSCatalog(catalog·setNum·msgNum), NLSSmitHelp(msgId), NLSCommand(명령의 -h 출력)로 국제화합니다. 지금은 ParameterDef의 설명만 artexget -i가 보여 줍니다.
  • ParameterDef 속성: name, type(string, integer, integer-bi(1024 배수 접미사), integer-si(1000 배수), boolean(0·1), binary(base64)), targetClass(쉼표 목록), reboot(설정하려면 artexset -l all), cfgmethod, constraint, priority. 매개변수 이름은 get 명령 출력의 이름과 맞추면 <Mask>나 %n·%v1로 여러 값을 한 번에 다룰 수 있습니다.
항목 내용
버전 AIX 6.1 (5.3판에 없음)
원문 Operating system and device management — 5.3판에 없음, 6.1판 83~94쪽
파일 /etc/security/artex/catalogs, commandParam.xml, aixpertParam.xml, vmoParam.xml, tsdParam.xml, sysdumpdevParam.xml, mktcpipParam.xml, coreParam.xml, artexcat.cat
관련 명령어 artexget -r, artexget -i, artexset -c -F -R -l all, raso -a, acctctl

카탈로그 파일은 AIX Runtime Expert 틀이 내부적으로 씁니다.

카탈로그 파일에는 매개변수 정의와, 매개변수 값을 가져오거나 설정하는 데 쓰는 명령을 설명하는 구성 방법에 대한 바인딩 정보가 들어 있습니다. 카탈로그 파일은 조정하고 구성하는 시스템에 로컬로 있습니다.

AIX Runtime Expert 카탈로그 개념

카탈로그 파일에는 정의, 사용 조건, 구성 방법을 포함해 매개변수 작업에 필요한 모든 정보가 들어 있습니다. 사용자가 카탈로그 파일을 직접 다루면 안 되며, AIX Runtime Expert 핵심 엔진을 거쳐서만 씁니다.

카탈로그는 AIX Runtime Expert 핵심 엔진과 함께 시스템에 설치됩니다. 시스템에 설치된 구성 요소나 서드파티 응용 프로그램에 새 카탈로그를 연결할 때는 설치된 AIX Runtime Expert 핵심 엔진과 수준이 맞는지 확인하는 것이 중요합니다.

카탈로그 위치

AIX Runtime Expert 카탈로그 파일은 /etc/security/artex/catalogs 디렉터리에 저장됩니다.

카탈로그 파일 이름은 id 속성에 .xml 확장자를 붙인 것과 정확히 같아야 합니다. 예를 들어 commandParam.xml이라는 카탈로그의 id 속성 값은 commandParam이어야 합니다.

카탈로그를 가리키는 프로파일이 카탈로그를 찾으려면, 카탈로그 XML 파일과 프로파일 XML 파일의 <Catalog> 요소에서 카탈로그 이름이 같아야 합니다. 기본으로 AIX Runtime Expert 핵심 엔진은 기본 디렉터리 /etc/security/artex/catalogs에서 카탈로그를 찾습니다. root 사용자에 한해 ARTEX_CATALOG_PATH 환경 변수로 이 동작을 바꿀 수 있습니다. 이 환경 변수에는 콜론(:) 구분자로 여러 디렉터리를 지정할 수 있습니다.

카탈로그 작성 과정

새 AIX Runtime Expert 카탈로그를 작성하는 단계입니다.

새 AIX Runtime Expert 카탈로그를 작성할 때는 다음 단계를 해야 합니다.

  1. 카탈로그 파일에 넣을 매개변수 목록을 만듭니다.

  2. 매개변수마다 <ParameterDef> 요소를 만듭니다.

  3. 여러 매개변수가 <Get>, <Set>, <Discover>, <Diff> 작업에 같은 명령을 쓰면:

    • 카탈로그 맨 위에 <CfgMethod> 요소를 정의합니다.
    • cfgmethod 속성으로 그 구성 방법을 상속합니다.
  4. 여러 매개변수가 같은 제약을 받으면 카탈로그 맨 위에 <ConstraintDef> 요소를 정의합니다.

  5. 매개변수마다 다음을 합니다.

    1. 매개변수마다 <Get type="current">와 <Get type="nextboot"> 작업을, <ParameterDef> 요소 바로 아래에 정의하거나, <CfgMethod> 요소 아래에서 참조하거나, 그 조합으로 정의합니다.

    2. 매개변수마다 지원하는 모든 <Set> 작업을, <ParameterDef> 요소 바로 아래나 참조하는 <CfgMethod> 요소 아래, 또는 그 조합으로 정의합니다.

    3. 매개변수에 대상이 필요하면:

      1. targetClass 속성으로 지원하는 대상 클래스를 정의합니다.

      2. discover 작업을 <ParameterDef> 요소 바로 아래나 참조하는 <CfgMethod> 요소, 또는 그 조합으로 정의합니다. 대부분 discover 방법은 구성 방법에 정의합니다.

    4. 매개변수 변경이 적용되려면 재부팅이 필요하면 reboot=true 속성을 더합니다.

    5. 매개변수가 제약을 받으면 <ParameterDef> 요소 아래에 <ConstraintDef> 요소를 정의하거나, constraint 속성으로 기존 제약을 가리킵니다.

  6. 카탈로그 파일을 시험하려면:

    1. 카탈로그 파일에 정의한 모든 매개변수로 프로파일을 만듭니다.

    2. artexget -r 명령으로 값을 가져와 <Discover>와 <Get> 작업을 시험합니다.

    3. 그 결과 프로파일에 artexset -c -F -R -l all 명령을 써서 <Set>과 <Diff> 작업을 시험합니다.

    4. 또 두 명령에 -g 3 -g COMMANDS 플래그를 더하면, 요청한 작업을 하려고 만든 명령행에 관한 정보를 더 얻을 수 있습니다.

AIX Runtime Expert 카탈로그 요소

<Catalog> 요소

<Catalog> 요소는 모든 카탈로그 파일의 루트 요소입니다.

구문 — 다음 속성을 지원합니다.

표 15. 속성

속성 필수 형 설명
id 예 string 카탈로그의 이름. 이 이름은 시스템에서 고유해야 합니다.
version 아니요 string 카탈로그의 버전 번호
date 아니요 dateTime 만든 날짜. 형식은 YYYY-MM-DDThh:mm:ss입니다.
priority 아니요 integer set 방법에서 다른 카탈로그에 대해 이 카탈로그를 실행하는 순서. 기본값은 0입니다.
inherit 아니요 string 상속할 카탈로그의 이름

다음 자식 요소를 지원합니다. 개수 열은 그 자식이 몇 번 나올 수 있는지 정의합니다.

표 16. 자식 요소

자식 요소 필수 개수 설명
<ShortDescription> 아니요 0~1 카탈로그의 짧은 설명
<Description> 아니요 0~1 카탈로그의 긴 설명
<SubCat> 아니요 0~여러 개 하위 범주
<ParameterDef> 아니요 0~여러 개 매개변수의 속성을 담습니다.
<ConstraintDef> 아니요 0~여러 개 매개변수 제약 정의(조건과 중단을 일으키는 명령)
<CfgMethod> 아니요 0~여러 개 구성 방법 정의
<PrereqDef> 아니요 0~여러 개 전제 조건을 정의합니다.
<PropertyDef> 아니요 0~여러 개 property를 정의합니다.
<SeedDef> 아니요 0~여러 개 seed를 정의합니다.

속성(표 17):

  • id: 카탈로그 파일 이름에서 .xml 확장자를 뗀 것과 맞아야 합니다. 카탈로그 id는 프로파일에서 <Catalog> 요소로 가리킵니다.
  • priority: 특정 카탈로그의 set 방법을, 같은 프로파일(예: 합성 프로파일 default.xml)에 들어 있는 다른 카탈로그의 set 방법보다 먼저나 나중에 실행해야 할 때 씁니다. 카탈로그의 기본 우선순위는 0입니다. 두 카탈로그의 우선순위가 같으면 set 방법은 정해지지 않은 순서로 실행됩니다. 카탈로그의 우선순위가 양수면 그 set 방법은 다른 것보다 먼저, 우선순위가 높은 순서로 실행됩니다. 우선순위가 음수면 그 set 방법은 다른 것보다 나중에, 우선순위가 높은 순서로 실행됩니다.
  • version: 프로파일과 카탈로그 모두에 있습니다. 버전으로 프로파일과 카탈로그가 AIX Runtime Expert 핵심 엔진과, 그리고 서로 호환되는지 알 수 있습니다. 자세한 내용은 버전 속성을 봅니다.
  • date: 지금 <Catalog> 요소에서는 쓰지 않습니다. 앞으로 쓰고 유지 보수하려고 들어 있습니다.
  • inherit: 상속할 카탈로그의 이름을 .xml 확장자 없이 지정합니다. 상속한 카탈로그에 정의된 모든 요소를 로컬에 정의한 것처럼 주 카탈로그에서 쓸 수 있습니다.

예 — priority 속성을 쓰는 카탈로그의 예입니다. aixpertParam.xml 카탈로그는 보안 옵션을 설정하며 다른 모든 카탈로그를 설정한 뒤에 설정해야 합니다. 그래서 우선순위를 큰 음수로 설정합니다.

text
<Catalog id="aixpertParam" version="2.0" priority="-1000">

버전 속성

구문 — 카탈로그의 버전은 MM.mm 형식의 속성으로 적으며 MM은 주 번호, mm은 부 번호입니다.

text
<Catalog id="commandParam" version="2.0">

주 버전 번호 — 주 버전 번호는 시스템에 설치된 모든 AIX Runtime Expert 카탈로그와, 그것을 가리키는 AIX Runtime Expert 틀 전체에서 같습니다. 이 주 번호는 프로파일과 카탈로그의 XML 스키마가 크게 바뀔 때마다 올라갑니다.

새 카탈로그를 만들 때는 주 버전 번호를 현재 AIX Runtime Expert 핵심 엔진 버전 번호로 설정합니다. 이 번호는 artex.base.rte 파일 세트와 함께 오는 표준 카탈로그 파일 아무것이나 열어 보면 알 수 있습니다.

주 버전 번호가 AIX Runtime Expert 핵심 엔진이 가리키는 것과 다른 프로파일에 artexget 명령을 실행하면 다음 오류로 실패합니다.

text
0590-117 Version error
This profile was created on a version unsupported by ARTEX

호환되려면 프로파일과 카탈로그의 주 버전 번호가 같은 것이 좋습니다. 프로파일은 특정 버전 번호로 카탈로그를 가리킵니다. 프로파일의 주 버전 번호가 카탈로그의 주 버전 번호와 다르면 AIX Runtime Expert 명령은 결과를 예측할 수 없다는 경고를 보여 줍니다.

text
0590-218 Catalog version differs from the one referenced in profile

부 버전 번호 — 부 버전 번호는 카탈로그마다 다르며, 카탈로그가 크게 바뀌어 이전 버전과 호환되지 않을 때마다 올라갑니다. 프로파일은 특정 버전 번호로 카탈로그를 가리킵니다. 프로파일의 부 버전 번호가 카탈로그의 부 버전 번호와 다르면 AIX Runtime Expert 명령은 결과를 예측할 수 없다는 경고를 냅니다.

text
0590-218 Catalog version differs from the one referenced in profile

새 예제 프로파일이나 카탈로그를 만들 때는 부 버전 번호를 0으로 설정합니다.

<Description>과 <ShortDescription> 요소

설명은 카탈로그 파일의 여러 요소에 더할 수 있는 선택 정보용 텍스트 필드입니다. 이 필드는 선택이지만 카탈로그 작성자가 부모 요소를 문서화하는 데 쓰기를 권합니다.

구문 — <ShortDescription> 요소의 부모 요소는 <Catalog>나 <SubCat>입니다. <Description> 요소의 부모 요소는 <Catalog>, <SubCat>, <ParameterDef>, <ConstraintDef> 가운데 하나입니다.

<Description>과 <ShortDescription> 요소의 내용은 단순 문자열이거나, <NLSCatalog>, <NLSSmitHelp>, <NLSCommand> 요소 가운데 하나로 정의한 번역 메시지입니다. 자세한 정보는 국제화 지원 항목을 봅니다.

사용법 — 지금은 <ParameterDef> 요소의 설명만 -i 플래그를 준 artexget 명령이 가져와 보여 줍니다. 이 설명 필드의 텍스트에 국제화를 제공하기를 권합니다.

다른 요소의 설명 필드는 지금 AIX Runtime Expert 틀이 쓰지 않지만, 앞으로 쓰고 문서화하려고 제공해야 합니다.

예:

  1. 설명 필드의 간단한 예입니다.
text
<ShortDescription>
   chuser parameters
</ShortDescription>
<Description>
   Parameter definition for the chuser command
</Description>
  1. 같은 예를 artexcat.cat 메시지 파일의 번역 메시지로 쓴 것입니다.
text
<ShortDescription>
<NLSCatalog catalog="artexcat.cat" setNum="12" msgNum="1">
  chuser parameters
</NLSCatalog>
</ShortDescription>
<Description>
<NLSCatalog catalog="artexcat.cat" setNum="12" msgNum="2">
  Parameter definition for the chuser command
</NLSCatalog>
</Description>

국제화 지원

AIX Runtime Expert 카탈로그의 설명 필드에서 국제화를 구현하는 방법입니다.

구문 — 부모 요소: <Description>, <ShortDescription>. 부모 요소에는 다음 자식 요소 가운데 하나(하나만)가 들어갈 수 있습니다.

표 18. 자식 요소

자식 요소 필수 개수 설명
<NLSCatalog> 아니요 0~1 메시지 카탈로그에 들어 있는 문자열
<NLSSmitHelp> 아니요 0~1 SMIT 도움말 HTML 파일에 들어 있는 문자열
<NLSCommand> 아니요 0~1 AIX 명령이 내는 문자열

NLS Catalog — 보여 줄 지역화 메시지가 catgets() 형식의 기존 메시지 카탈로그에 들어 있을 때 씁니다. <NLSCatalog> 요소에는 다음 속성이 있습니다.

표 19. 속성

속성 필수 형 설명
catalog 예 string 메시지가 있는 카탈로그의 이름
setNum 예 integer 메시지가 있는 메시지 세트의 번호
msgNum 예 integer 메시지 세트 안의 메시지 번호

지역화 메시지 카탈로그가 없으면 기본 메시지를 대신 보여 줍니다. 기본 메시지는 선택적으로 <NLSCatalog> 요소의 내용으로 넣습니다. 기본 메시지를 주는 것이 권장 관행입니다.

NLS SMIT Help — 보여 줄 지역화 메시지가 이미 SMIT 도움말 HTML 파일에 있을 때 씁니다. <NLSSmitHelp> 요소에는 다음 속성이 있습니다.

표 20. 속성

속성 필수 형 설명
msgId 예 integer SMIT 스탠자에 있는 help_msg_id 필드

지역화 도움말 파일이 없으면 기본 메시지를 대신 보여 줍니다. 기본 메시지는 선택적으로 <NLSSmitHelp> 요소의 내용으로 넣습니다. 기본 메시지를 주는 것이 권장 관행입니다.

NLS Command — 보여 줄 지역화 메시지를 AIX 명령이 낼 때 씁니다. 특정 매개변수의 도움말 텍스트를 보여 주는 -h 플래그가 있는 모든 조정 명령(no, vmo 등)이 여기에 해당합니다. <NLSCommand> 요소에는 다음 속성이 있습니다.

표 21. 속성

속성 필수 형 설명
command 예(원문은 command) string 실행할 셸 식

예:

  1. 기본 메시지를 포함한, chssysParam.xml AIX Runtime Expert 카탈로그의 <NLSCatalog> 요소 예입니다.
text
<Description>
  <NLSCatalog catalog="artexcat.cat" setNum="10" msgNum="2">
    Changes a subsystem definition in the subsystem object class.
  </NLSCatalog>
</Description>
  1. <NLSSmitHelp> 요소의 예입니다.
text
<Description>
  <NLSSmitHelp msgId="055136"/>
</Description>
  1. schedoParam.xml 카탈로그의 <NLSCommand> 요소 예입니다.
text
<Description>
  <NLSCommand command="/usr/sbin/schedo -h maxspin | /usr/bin/tail -n +2"/>
</Description>

<SubCat> 요소

카탈로그 파일 안에서 <SubCat> 요소로 하위 범주, 곧 카탈로그 안의 선택 매개변수 부분 집합을 지정할 수 있습니다.

구문 — 부모 요소: <Catalog>, <SubCat>. 다음 속성을 지원합니다.

표 22. 속성

속성 필수 형 설명
id 예 string 카탈로그 하위 범주의 이름. 이 이름은 카탈로그 파일마다 고유해야 합니다.

다음 자식 요소를 지원합니다.

표 23. 자식 요소

자식 요소 필수 설명
<ShortDescription> 아니요 하위 범주의 짧은 설명
<Description> 아니요 하위 범주의 긴 설명
<SubCat> 아니요 중첩 하위 범주. 여러 번 나올 수 있습니다.
<ParameterDef> 아니요 매개변수의 속성을 담습니다. 여러 번 나올 수 있습니다.

속성 — 하위 범주는 카탈로그에 로컬입니다.

  • 하위 범주 id는 카탈로그 파일 안에서 고유합니다.
  • 여러 카탈로그가 같은 하위 범주 식별자를 쓸 수 있습니다.

카탈로그에 정의한 하위 범주는 연결된 예제 프로파일에 나오는 하위 범주와 정확히 맞아야 합니다.

<ParameterDef> 요소

AIX Runtime Expert 매개변수는 카탈로그 파일에서 <ParameterDef> 요소로 정의합니다.

구문 — 부모 요소: <Catalog>, <ParameterDef>(원문 그대로, SubCat). 다음 속성을 지원합니다.

표 24. 속성

속성 필수 형 설명
name 예 string 매개변수 이름. 이 이름은 카탈로그마다 고유해야 합니다.
type 예 string 핵심 엔진이 보는 매개변수 형
targetClass 아니요 string 매개변수의 대상 클래스(있다면)
reboot 아니요 boolean true면 재부팅이 필요하다는 뜻입니다. 기본값은 false입니다.
cfgmethod 아니요 string 이 매개변수에 쓸 방법이 든, <Catalog> 수준에서 정의한 구성 방법의 id
constraint 아니요 string 현재 카탈로그 파일의 <Catalog> 요소 수준에서 정의한 제약의 id
priority 아니요 integer 이 카탈로그의 다른 매개변수에 대해 set 방법에서 이 매개변수를 실행하는 순위. 기본값은 0입니다.

다음 자식 요소를 지원합니다.

표 25. 자식 요소

자식 요소 필수 설명
<Description> 아니요 매개변수의 설명
<ConstraintDef> 아니요 매개변수 제약 정의(중단을 일으키는 명령)
<Get> 아니요 get 작업의 구성 방법 정의. 여러 번 나올 수 있습니다.
<Set> 아니요 set 작업의 구성 방법 정의. 여러 번 나올 수 있습니다.
<Diff> 아니요 diff 작업의 구성 방법 정의
<Discover> 아니요 대상 발견의 구성 방법 정의

속성(표 26):

  • name: 카탈로그 파일 안에서 매개변수를 고유하게 식별합니다. 자세한 정보는 매개변수 name 속성 항목을 봅니다.
  • type: 필수인 type 속성은 매개변수의 값 형을 나타냅니다. 지원하는 값은 다음과 같습니다.
    • string: 영숫자 문자열
    • integer: 숫자 값
    • integer-bi: 대문자나 소문자 K, M, G, T, P, E 접미사(킬로, 메가, 기가, 테라, 페타, 엑사)를 선택적으로 붙인 숫자 값. 이 접미사는 1024의 거듭제곱으로 해석합니다.
    • integer-si: 선택적 SI 접미사를 붙인 숫자 값. integer-bi 형과 같지만 접미사를 1000의 거듭제곱으로 해석합니다.
    • boolean: 불 값. 지원하는 값은 0과 1입니다.
    • binary: 2진 값. 프로파일에서는 base-64 문자열로 인코딩합니다.
  • reboot: 불 속성 reboot의 기본값은 false입니다. 매개변수 변경이 적용되려면 재부팅이 필요하면 이 매개변수의 reboot 속성을 true로 설정해야 합니다. AIX Runtime Expert 자체는 시스템을 재부팅하지 않습니다. 기본으로 artexset 명령은 reboot 매개변수를 강제로 설정하지 않습니다. 프로파일에 reboot 매개변수가 있으면 명령이 실패합니다: 0590-502: profile has parameters that require a reboot. Profile has not been set. Use -l all flag to force set for all parameters. 알맞은 -l 플래그로 부르면 artexset 명령은 값을 설정하고 변경이 적용되려면 재부팅이 필요하다고 사용자에게 경고합니다: 0590-206 A manual post-operation is required for the changes to take effect Please reboot the system
  • priority: 기본으로 artexset 명령은 정해진 순서 없이 매개변수를 설정합니다. priority 속성으로 이 동작을 바꿔 매개변수를 다른 매개변수보다 먼저나 나중에 설정하게 할 수 있습니다. 기본 우선순위는 0입니다. priority 속성으로 이 기본 우선순위를 -2147483648부터 2147483647 사이의 정수 값으로 바꿀 수 있습니다. 우선순위가 높은 매개변수가 낮은 매개변수보다 먼저 실행됩니다. 우선순위가 같은 매개변수의 설정 순서는 정해지지 않습니다.
  • targetClass: 프로파일의 Target 요소 절에서 설명했듯이 일부 매개변수는 대상과 연결해야 합니다. 이런 매개변수의 targetClass 속성은 지원하는 대상 클래스의 쉼표 구분 목록으로 설정해야 합니다.
  • cfgmethod: <ParameterDef> 요소는 cfgmethod 속성으로 <CfgMethod> 요소의 id 속성을 가리켜 그 구성 방법의 명령행 요소를 상속할 수 있습니다. 구성 방법에 관한 자세한 정보는 <CfgMethod> 요소 절을 봅니다.
  • constraint: <ParameterDef> 요소는 constraint 속성으로 <ConstraintDef> 요소의 id 속성을 가리켜, 매개변수가 그 제약을 받는다는 것을 나타낼 수 있습니다. 제약에 관한 자세한 정보는 <ConstraintDef> 요소 절을 봅니다.

예:

  1. 다른 정수 형을 쓰는 매개변수 정의의 예입니다. vmoParam.xml 카탈로그 파일의 kernel_heap_psize입니다.
text
<ParameterDef name="kernel_heap_psize" type="integer-bi">

artexget 명령으로 이 매개변수 값을 추출하면 결과는 다음과 비슷합니다(결과 프로파일에서 뽑음).

text
<Parameter name="kernel_heap_psize" value="16M"... />

매개변수 값은 형에 따라 다르게 해석됩니다.

  • integer-bi 형으로 선언했으므로 값은 16M = 16,777,216입니다.
  • integer-si 형이었다면 값은 16M = 16,000,000이었을 것입니다.
  1. 2진 매개변수의 예입니다. tsdParam.xml 카탈로그의 신뢰 서명 데이터베이스 tsd.dat입니다.
text
<ParameterDef name="tsdatabase" type="binary">
  1. reboot 속성이 있는 매개변수의 예입니다. sysdumpdevParam.xml 카탈로그의 덤프 종류 매개변수입니다.
text
<ParameterDef name="type_of_dump" type="string" reboot="true">
  1. 대상 클래스가 하나인 매개변수의 예입니다. mktcpipParam.xml 카탈로그의 addr 매개변수는 특정 네트워크 인터페이스에 적용됩니다.
text
<ParameterDef name="addr" type="string" cfgmethod="mktcpip" targetClass="interface">
  1. 대상 클래스가 여럿인 매개변수의 예입니다. coreParam.xml의 naming specification 매개변수는 특정 레지스트리(files, LDAP)의 특정 사용자(root, admin, guest 등)에 적용됩니다.
text
<ParameterDef name="namingspecification" type="string" reboot="true" targetClass="user,registry"
cfgmethod="coremgt">
  1. cfgmethod 속성을 쓰는 예입니다. <Get type="current"> 작업에서 chlicenseParam.xml 카탈로그의 fixed 매개변수는 chlicense 구성 방법에서 <Command> 요소를 상속하지만, 같은 작업에 자기 <Filter>와 <Mask>도 로컬로 정의합니다.
text
<CfgMethod id="chlicense">
  <Get type="current">
    <Command>lslicense -c -A</Command>
  </Get>
</CfgMethod>
<ParameterDef name="fixed" cfgmethod="chlicense" type="integer">
  <Get type="current">
    <Filter>tail -n 1 | cut -d: -f3</Filter>
    <Mask value="1">(.*)</Mask>
  </Get>
</ParameterDef>
  1. constraint 속성을 쓰는 예입니다. authParam.xml 카탈로그의 authorizations 매개변수는 앞서 <ConstraintDef> 요소에 정의한 setkst 제약을 받습니다.
text
<ParameterDef name="authorizations" cfgmethod="cat" constraint="setkst" type="string">

name 속성

매개변수 이름은 흔히 그 매개변수를 가져오거나 설정하는 데 쓰는 명령이 정합니다.

매개변수 이름은 카탈로그 파일 안에서 고유해야 합니다. 그래야 프로파일의 <Parameter> 요소를 카탈로그 파일의 고유한 <ParameterDef> 요소와 연결할 수 있습니다.

  • get 명령이 매개변수-값 쌍을 여럿 보여 주면, <Mask> 요소로 명령 출력 하나에서 여러 매개변수를 추출할 수 있습니다. 이는 매개변수 이름이 get 명령 출력에 쓰인 이름과 맞을 때만 가능합니다.
  • set 명령이 매개변수-값 쌍을 여럿 받으면, <Argument> 요소에 %n과 %v1 시퀀스를 써서 명령 하나로 여러 매개변수를 설정할 수 있습니다. 이는 매개변수 이름이 set 명령이 쓰는 이름과 맞을 때만 가능합니다.

예:

  1. rasoParam.xml 카탈로그에서 쓰는 raso -a 명령은 줄마다 매개변수 하나를 보여 줍니다.
text
kern_heap_noexec = 0
kernel_noexec = 1
mbuf_heap_noexec = 0
mtrc_commonbufsize = 485

이 쉬운 경우 매개변수 이름은 kernel_heap_noexec, kernel_noexec 등이 됩니다(원문 그대로, 출력은 kern_heap_noexec). 2. acctctlParam.xml 카탈로그의 get 구성 방법에서 쓰는 명령은 해석하기 더 어려운 결과를 보여 줍니다. 매개변수 이름이 형식 없는 문장 안에 들어 있을 뿐 아니라, 매개변수 이름과 값이 모두 지역화되어 있습니다. get 구성 방법은 환경 변수 LANG=C로 명령을 실행하고, 각 줄에서 핵심 단어를 알맞은 매개변수 이름으로 바꿔야 합니다.

text
Advanced Accounting is not running.
Email notification is off.
The current email address to be used is not set.
Recover CPU accounting time in turbo mode is False.

위 예에서 고른 변수 이름은 accounting, email, email_adddr, turacct입니다.

영어 원문

Writing AIX Runtime Expert catalogs

Catalog files are used internally by the AIX Runtime Expert framework.

The catalog files contain the parameter definitions and binding information to configuration methods that describe the commands used to retrieve or set parameter values. Catalog files are local to the system which is being tuned and configured.

AIX Runtime Expert catalog concepts

Catalog files contain all the information required to perform operations on parameters, including definitions, conditions of use, and configuration methods. Catalog files must not be manipulated directly by users and are only used through the AIX Runtime Expert core engine.

Catalogs are installed on a system at the same time as the AIX Runtime Expert core engine. When new catalogs are linked to components or third-party applications that are installed on a system, it is important to ensure they are in level with the installed AIX Runtime Expert core engine.

Catalog location:

AIX Runtime Expert catalog files are stored in the /etc/security/artex/catalogs directory.

The name of a catalog file must exactly match its id attribute, suffixed with .xml extension. For example, a catalog named commandParam.xml must have an id attribute value commandParam.

In order to be located by the profile that reference it, the catalog must have the same name in the catalog XML file and in the <Catalog> element of the profile XML file. By default, the AIX Runtime Expert core engine looks for catalogs in the default directory /etc/security/artex/catalogs. This behavior can be changed, for the root user only, by setting the ARTEX_CATALOG_PATH environment variable. Multiple directories can be specified in this environment variable using the : separator.

Catalog process:

Steps to write a new AIX Runtime Expert catalog.

The following steps are required to be performed when writing a new AIX Runtime Expert catalog:

  1. Make a list of parameters you want in the catalog file.

  2. For each parameter, create a <ParameterDef> element

  3. If several parameters use the same command for a <Get>, <Set>, <Discover> or <Diff> operation:

  • Define a <CfgMethod> element at the top of the catalog.

  • Use the cfgmethod attribute to inherit from the configuration method.

  1. If several parameters are subject to the same constraint, define a <ConstraintDef> element at the top of the catalog.

  2. For each parameter: a. Define the <Get type=“current”> and <Get type=“nextboot”> operations for each parameter, either directly under the <ParameterDef> element, or referenced under the <CfgMethod> element, or using any of the combinations. b. Define all the supported <Set> operations for each parameter, either directly under the <ParameterDef> element, or under the referenced <CfgMethod> element, or using any combination of those possibilities. c. If the parameter requires a target: 1) Define the supported target classes using the targetClass attribute 2) Define the discover operation, either directly under the <ParameterDef> element, or the referenced <CfgMethod> element, or using any combination of those possibilities. In most cases the discover method will be defined in a configuration method. d. If the parameter requires a reboot for a change to take effect, add the reboot =true attribute. e. If the parameter is subject to a constraint, either define a <ConstraintDef> element under the <ParameterDef> element, or use the constraint attribute to reference an existing constraint.

  3. To test the catalog file: a. Create a profile with all the parameters defined in the catalog file. b. Use the artexget –r command to capture values and test the <Discover> and <Get> operations. c. Use the artexset –c –F –R –l all command on the resulting profile to test the <Set> and <Diff> operations. d. Additionally, the –g 3 –g COMMANDS flags can be added to those two commands to get more information about the command line generated to perform the requested operation.

Related information

See the topic about the <Catalog> root element.

AIX Runtime Expert catalog elements

<Catalog> element:

The <Catalog> element is the root element for all catalog files.

Syntax

The following attributes are supported:

Table 15. Attributes

Attribute Required Type Description
id yes string Specifies the name of the catalog. This name must be unique on the system.
version no string Specifies the version number of the catalog.
date no dateTime Specifies the date of creation. Format is YYYY-MM- DDThh:mm:ss.
priority no integer Specifies the order of execution of the catalog relative to others in the set methods. Default value is 0.
inherit no string Specifies the name of a catalog to inherit.

The following child elements are supported. The number column defines how many occurrences of the child are allowed:

Table 16. Child elements

Child element Required Number Description
<ShortDescription> no 0 – 1 Short textual description for the catalog.
<Description> no 0 – 1 Long textual description for the catalog.
<SubCat> no 0 – any Sub category
<ParameterDef> no 0 – any Contains the properties of a parameter.
<ConstraintDef> no 0 – any Parameter constraints definition (conditions and disruptive commands).
<CfgMethod> no 0 – any Configuration method definition
<PrereqDef> no 0 – any Defines a prerequisite.
<PropertyDef> no 0 – any Defines a property.
<SeedDef> no 0 – any Defines a seed.

Attributes

Table 17. Attributes

  • id — The id attribute should match the catalog file name, stripped from its .xml extension. The catalog id is referenced in profiles using the <Catalog> element.
  • Priority — The priority attribute is used when the set methods of a specific catalog are required to be run before or after the set methods of other catalogs when they are included in the same profile (for example, the compound profile default.xml). The default priority of a catalog is 0. The rule is that when two catalogs share the same priority, their set methods are run in an undefined order. If a catalog has a priority with a positive value, its set methods are executed before the others, in the descending priority order. If a catalog has a priority with a negative value, its set methods are executed after the others, in the descending priority order.
  • Version — The Version attribute is present in both profiles and catalogs. The version helps identifying whether profiles and catalogs are compatible with the AIX Runtime Expert core engine and with each other. See Version attribute for more details.
  • Date — The date attribute is not currently used for the <Catalog> element. It is included for future use and maintainability.
  • inherit — The inherit attribute specifies the name of a catalog to inherit from, without the .xml extension. All the elements defined in the inherited catalog are available in the main catalog, as if they were defined locally.

Example

Following is an example of a catalog using the priority attribute. The aixpertParam.xml catalog sets security options and must be set after all other catalogs have been set. Thus, its priority is set to a high negative value.

text
<Catalog id="aixpertParam" version="2.0" priority="-1000">

Related information

The <ConstraintDef> element.

The <CfgMethod> element.

The <Description> and <ShortDescription> elements.

The <ParameterDef> element.

The <SubCat> element.

Version attribute:

Syntax

The version of a catalog is written as an attribute in the format MM.mm where MM is the major number and mm is the minor number.

text
<Catalog id="commandParam" version="2.0">

Major version number

The major version number is the same for all AIX Runtime Expert catalogs installed on a system, and the whole AIX Runtime Expert framework, where it is referenced. This major number is increased at each major change of the XML schema of the profiles and catalogs.

When creating a new catalog, set the major version number to the current AIX Runtime Expert core engine version number, which can be found by looking inside any of the standard catalog files that come with the artex.base.rte fileset.

If an artexget command is invoked on a profile whose major version number differs from the one referenced in the AIX Runtime Expert core engine, the command fails with the following error:

text
0590-117 Version error
This profile was created on a version unsupported by ARTEX

It is also advised that a profile and a catalog share the same major version number in order to be compatible. A profile references catalogs with a specific version number. If the major version number of the profile is not the same as the catalog major version number, any AIX Runtime Expert command will display a warning to inform the user that results may be unpredictable:

text
0590-218 Catalog version differs from the one referenced in profile

Minor version number

The minor version number is specific to each catalog and is increased each time a major change in the catalog makes it incompatible with the previous version. A profile references catalogs with a specific version number. If the profile minor version number is not the same as the catalog minor version number, any AIX Runtime Expert command will issue a warning to inform the user that results may be unpredictable:

text
0590-218 Catalog version differs from the one referenced in profile

When creating a new sample profile or catalog, set the minor version number to 0.

<Description> and <ShortDescription> elements:

Descriptions are optional informative text fields that can be added to various elements in the catalog files. These fields are optional, but it is recommended that catalog writers use them to document the parent element.

Syntax

The parent element of a <ShortDescription> element can be one of:

  • <Catalog>

  • <SubCat>

The parent element of a <Description> element can be one of:

  • <Catalog>

  • <SubCat>

  • <ParameterDef>

  • <ConstraintDef>

The content of the <Description> and <ShortDescription> elements is either a simple string, or a translated message defined by one of the <NLSCatalog>, <NLSSmitHelp> or <NLSCommand> elements. See the Globalization support topic for more information.

Usage

Currently, only the description of <ParameterDef> elements is retrieved and displayed by the artexget command with the -i flag. It is recommended to provide globalization for the text included in those description fields.

The description field of the other elements are currently not used by the AIX Runtime Expert framework, but they should be provided for future use and for documentation purpose.

Example

  1. Here is a simple example of description fields:
text
<ShortDescription>
   chuser parameters
</ShortDescription>
<Description>
   Parameter definition for the chuser command
</Description>
  1. The same example, using translated messages from the artexcat.cat message file:
text
<ShortDescription>
<NLSCatalog catalog="artexcat.cat" setNum="12" msgNum="1">
  chuser parameters
</NLSCatalog>
</ShortDescription>
<Description>
<NLSCatalog catalog="artexcat.cat" setNum="12" msgNum="2">
  Parameter definition for the chuser command
</NLSCatalog>
</Description>

Related information

Globalization support

Globalization support:

This section describes how globalization is implemented in the descriptive fields of the AIX Runtime Expert catalogs.

Syntax

Parent element: <Description>, <ShortDescription>

The parent element may contain one (and only one) of the following child elements:

Table 18. Child Elements

Child element Required Number Description
<NLSCatalog> no 0 – 1 String included in a message catalog
<NLSSmitHelp> no 0 – 1 String included in a SMIT help HTML file
<NLSCommand> no 0 – 1 String issued by an AIX command

NLS Catalog

The NLS Catalog globalization format is used when the localized message to display is included in an existing message catalog in the catgets() format.

The <NLSCatalog> element contains the following attributes:

Table 19. Attributes

Attribute Required Type Description
catalog yes string Name of the catalog where the message resides
setNum yes integer Number of the message set where the message resides
msgNum yes integer Number of the message in the message set

If the localized message catalog does not exist, the default message is displayed instead. The default message is, optionally, included as the contents of the <NLSCatalog> element. It is a recommended practice to provide a default message.

NLS SMIT Help

The NLS Smit Help globalization format is used when the localized message to display already exists in a SMIT help HTML file.

The <NLSSmitHelp> element contains the following attribute:

Table 20. Attributes

Attribute Required Type Decsription
msgId yes integer The help_msg_id field provided in the SMIT stanza

If the localized help file does not exist, the default message is displayed instead. The default message is, optionally, included as the contents of the <NLSSmitHelp> element. It is a recommended practice to provide a default message.

NLS Command

The NLS Command globalization format is used when the localized message to display is issued by an AIX command. This is the case for all tuning commands (like no, vmo) that provide a –h flag to display help text for a specific parameter.

The <NLSCommand> element contains the following attribute:

Table 21. Attribute

Attribute Required Type Description
command command string Shell expression to execute

Examples

  1. Example of the <NLSCatalog> element from the chssysParam.xml AIX Runtime Expert catalog, including a default message.
text
<Description>
  <NLSCatalog catalog="artexcat.cat" setNum="10" msgNum="2">
    Changes a subsystem definition in the subsystem object class.
  </NLSCatalog>
</Description>
  1. Example of the <NLSSmitHelp> element:
text
<Description>
  <NLSSmitHelp msgId="055136"/>
</Description>
  1. Example of the <NLSCommand> element from the schedoParam.xml catalog:
text
<Description>
  <NLSCommand command="/usr/sbin/schedo -h maxspin | /usr/bin/tail -n +2"/>
</Description>

<SubCat> element:

Subcategories, optional parameters, subsets inside a catalog, can be specified by using the <SubCat> element inside a catalog file.

Syntax

Parent element: <Catalog>,<SubCat>

The following attributes are supported:

Table 22. Attributes

Attribute Required Type Description
id yes string Specifies the name of the catalog subcategory. This name should be unique per catalog file.

The following child elements are supported:

Table 23. Child Elements

Child element Required Description
<ShortDescription> no Short textual description of the subcategory.
<Description> no Long textual description of the subcategory.
<SubCat> no Nested subcategory. This element may occur multiple times.
<ParameterDef> no Contains the properties of a parameter. This element may occur multiple times.

Attribute

A subcategory is local to a catalog:

  • A subcategory id is unique inside a catalog file.

  • Multiple catalogs can make use of the same subcategory identifier.

The subcategories defined in a catalog must exactly match the subcategories reported in the associated sample profile.

Related information

The <Description> and <ShortDescription> elements.

The <SubCat> element.

The <ParameterDef> element.

<ParameterDef> element:

AIX Runtime Expert are defined in a catalog file by using the <ParameterDef> element.

Syntax

Parent element: <Catalog>,<ParameterDef>

The following attributes are supported:

Table 24. Attributes

Attribute Required Type Description
name yes string Specifies the name of the parameter. This name must be unique per catalog.
type yes string Specifies the parameter type, as seen from the core engine.
targetClass no string Specifies the target classes for the parameter if any.
reboot no boolean When true, indicates that a reboot is required. Default value is false.
cfgmethod no string Specifies the id of the configuration method defined at <Catalog> level that contains methods to use for this parameter.
constraint no string Specifies the id of a constraint defined at <Catalog> element level for the current catalog file.
priority no integer Execution rank of this parameter in the set method relative to other parameters in this catalog. Default value is 0.

The following child elements are supported:

Table 25. Child Elements

Child element Required Description
<Description> no Textual description of the parameter.
<ConstraintDef> no Parameter constraint definition (disruptive commands).
<Get> no Configuration method definition for the get operation. This element may occur multiple times.
<Set> no Configuration method definition for the set operation. This element may occur multiple times.
<Diff> no Configuration method definition for diff operation.
<Discover> no Configuration method definition for target discovery.

Attribute

Table 26. Attributes

  • name — The name attribute uniquely identifies a parameter within a catalog file. See the parameter name attribute topic for more information.
  • type — The required type attribute indicates the value type of the parameter. The supported values are: • string, for alphanumerical strings; • integer, for numerical values; • integer-bi, for numerical values with an optional uppercase or lowercase K, M, G, T, P or E suffix for “kilo”, “mega”, “giga”, “tera”, “peta” and “exa”. These suffixes are interpreted as powers of 1024; • integer-si, for numerical values with an optional SI suffix. Same as the integer-bi type, except suffixes are interpreted as powers of 1000. • boolean, for boolean values. Supported values are 0 and 1. • binary, for binary values, encoded as base-64 strings in profiles.
  • reboot — The default for the boolean ‘reboot’ attribute is “false”. If a parameter change requires a reboot to take effect, then this parameter must have its ‘reboot’ attribute set to “true”. AIX Runtime Expert itself never reboots systems. By default, the artexset command will not force the setting of reboot parameters. If the profile contains reboot parameters, the command will fail: 0590-502: profile has parameters that require a reboot. Profile has not been set. Use -l all flag to force set for all parameters If called with the proper –l flag, the artexset command sets the value and warns the users that a reboot is required for changes to take effect: 0590-206 A manual post-operation is required for thechanges to take effect Please reboot the system
  • priority — By default, parameters are set in no defined order by the artexset command. The priority attribute can be used alter this behavior and force a parameter to be set before or after other parameters. The default priority is 0. The priority attribute can be used to change this default priority to any integer value between -2147483648 and 2147483647. Parameters with a higher priority are executed before parameters with a lower priority. The order in which parameters with the same priority are set is undefined.
  • targetClass — Some parameters have to be associated with a target, as explained in section on “The Target element” of a profile. Those parameter must have their targetClass attribute set to the coma-separated list of their supported target classes.
  • cfgmethod — A <ParameterDef> element can inherit command line elements from a <CfgMethod> element by referencing this configuration method id attribute with the cfgmethod attribute. For more information on configuration methods, refer to the section on <CfgMethod> element.
  • constraint — A <ParameterDef> element can use the constraint attribute to reference the id attribute of a <ConstraintDef> element, indicating that the parameter is subjected to the constraint. For more information on constraints, refer to the section on “The <ConstraintDef> element”.

Examples

  1. Following is an example of a parameter definition with an alternative integer type: kernel_heap_size, from the vmoParam.xml catalog file:
text
<ParameterDef name="kernel_heap_psize" type="integer-bi">

When extracting the value of this parameter through an artexget command, the result is something like (excerpted from the resulting profile).

text
<Parameter name="kernel_heap_psize" value="16M"... />

The parameter value will be interpreted differently, depending on the type:

  • Since it is declared to be of type integer-bi, the value is 16M= 16,777,216.

  • If the type had been integer-si, the value would have been “16M”=16,000,000.

  1. Example of a binary parameter: the trusted signature database tsd.dat in the tsdParam.xml catalog:
text
<ParameterDef name="tsdatabase" type="binary">
  1. Example of a parameter with a reboot attribute. The type of dump parameter in the sysdumpdevParam.xml catalog:
text
<ParameterDef name="type_of_dump" type="string" reboot="true">
  1. Example of a parameter with one target class: the addr parameter from the mktcpipParam.xml catalog applies to a specific network interface:
text
<ParameterDef name="addr" type="string" cfgmethod="mktcpip" targetClass="interface">
  1. Example of a parameter with several target classes: the naming specification parameter from the coreParam.xml applies to a specific user (root, admin, guest, etc.) in a specific registry (files, LDAP).
text
<ParameterDef name="namingspecification" type="string" reboot="true" targetClass="user,registry"
cfgmethod="coremgt">
  1. Example of use of the cfgmethod attribute: For the <Get type="current"> operation, the fixed parameter of the chlicenseParam.xml catalog inherits the <Command> element from the chlicense configuration method, but it also defines its own <Filter> and <Mask> locally for this same operation:
text
<CfgMethod id="chlicense">
  <Get type="current">
    <Command>lslicense -c -A</Command>
  </Get>
</CfgMethod>
<ParameterDef name="fixed" cfgmethod="chlicense" type="integer">
  <Get type="current">
    <Filter>tail -n 1 | cut -d: -f3</Filter>
    <Mask value="1">(.*)</Mask>
  </Get>
</ParameterDef>
  1. Example of usage of the constraint attribute: the authorizations parameter of the authParam.xml catalog is subjected to the setkst constraint defined earlier in a <ConstraintDef> element:
text
<ParameterDef name="authorizations" cfgmethod="cat" constraint="setkst" type="string">

Related information

The name attribute.

name attribute:

The name of a parameter is often dictated by the command used to get or set the parameter.

Parameter names must be unique within a catalog file. This is required to ensure that a <Parameter> element in a profile can be associated with a unique <ParameterDef> element in a catalog file.

  • If the get command displays several parameter-value pairs, then the <Mask> element can be used to extract multiple parameters from a single command output. This is only possible if the name of the parameter matches the name used in the output of the get command.

  • If the set command accepts several parameter-value pairs, then the %n and %v1 sequences can be used in an <Argument> element to set multiple parameters with a single command. This is only possible if the name of the parameter matches the name used by the set command.

Examples

  1. Example: The raso –a command used in the rasoParam.xml catalog displays one parameter per line of display:
text
kern_heap_noexec = 0
kernel_noexec = 1
mbuf_heap_noexec = 0
mtrc_commonbufsize = 485

In this easy case, the parameter names will be kernel_heap_noexec, kernel_noexec, etc.

  1. Example: The command used in the get configuration method of the acctctlParam.xml catalog displays a result that is more difficult to parse. Not only is the name of the parameter integrated into a non-formatted sentence, but both the parameter names and their values are localized. The get configuration methods will have to run the command while setting the environment variable LANG=C, and, in each line, replace the key words by pertinent parameter names:
text
Advanced Accounting is not running.
Email notification is off.
The current email address to be used is not set.
Recover CPU accounting time in turbo mode is False.

In the above example, the variable names that have been chosen are accounting, email, email_adddr and turacct.

Related information

  • The <Parameter> element

  • The <Mask> element

  • Expansion of command line elements