[AIX 운영 체제와 장치 관리 9] AIX Runtime Expert (4) 카탈로그 요소 — ConstraintDef·CfgMethod·Get·Set·Diff·Discover
https://archive.horanglab.com/posts/aix-osdev-9
핵심 정리
- ConstraintDef는 값 변경이 적용되려면 데몬 재시작, 마운트 해제·마운트, 어댑터 오프라인·온라인 같은 중단 작업이 필요하다는 제약입니다. ParameterDef 안에 두거나 카탈로그 수준에서 id를 붙여 정의하고 constraint 속성으로 가리킵니다.
- BuiltIn 제약은 지금 bosboot 하나뿐이며, AIX Runtime Expert는 bosboot를 실행하지 않고 0590-206 경고만 냅니다. PreOp는 set 전에, PostOp는 set 뒤에 실행할 필수 셸 식이며 각각 0~1개입니다(예: trustchk의 clic 커널 확장 확인, auth의 setkst).
- CfgMethod는 여러 매개변수가 같은 명령을 쓰게 해 카탈로그를 줄이고 여러 매개변수를 명령 하나로 처리하게 합니다. Get·Set·Diff·Discover의
<Command>는 매개변수마다 CfgMethod나 ParameterDef 수준 가운데 한 곳에 반드시 있어야 합니다. - Get은 current(
artexget -r)와 nextboot(-n) 두 개를 정의하고,-p는 applyType에 따라 고릅니다. Set은 current·nextboot·permanent 세 종류이며 applyType(runtime·nextboot)과 정의된 Set 조합에 따라 실제 실행이 정해집니다. - Diff는 형별 내부 비교가 맞지 않을 때만 외부 명령을 씁니다. Discover는
class_1=inst;…줄을 출력하며, artexget은 빈 Target이나 match가 있을 때, artexset은-d와 setDiscover=true일 때 실행합니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 6.1 (5.3판에 없음) |
| 원문 | Operating system and device management — 5.3판에 없음, 6.1판 95~102쪽 |
| 파일 | trustchkParam.xml, authParam.xml, vmoParam.xml, mktcpipParam.xml, chuserParam.xml |
| 관련 명령어 | artexget -r·-n·-p, artexset -d, bosboot, diff |
<ConstraintDef> 요소
구문 — 부모 요소: <Catalog>, <ParameterDef>. 다음 속성을 지원합니다.
표 27. 속성
| 속성 | 필수 | 형 | 설명 |
|---|---|---|---|
| id | 아니요(주) | string | 매개변수 제약의 이름 |
주: 카탈로그 수준에서 정의한 <Constraint>(ConstraintDef) 요소에는 이 속성을 반드시 지정해야 합니다.
다음 자식 요소를 지원합니다.
표 28. 자식 요소
| 자식 요소 | 필수 | 설명 |
|---|---|---|
<Description> |
아니요 | 중단을 일으키는 명령의 설명 |
<PreOp> |
아니요 | 매개변수 값을 설정하기 전에 실행할 중단 작업 |
<PostOp> |
아니요 | 매개변수 값을 설정한 뒤 실행할 중단 작업 |
<BuiltIn> |
아니요 | 내장 중단 작업. 여러 번 나올 수 있습니다. |
사용법 — 일부 조정·구성 매개변수는 값 변경이 적용되려면 중단을 일으키는(disruptive) 작업이 필요할 수 있습니다. 중단 작업은 서비스나 장치 접근을 잠시 끊을 수 있는 모든 작업입니다. 전형적인 중단 작업은 데몬 재시작, 파일 시스템 마운트 해제나 마운트, 네트워크 어댑터 카드를 오프라인이나 온라인으로 하는 것입니다. AIX Runtime Expert 프로그램은 제약으로 매개변수 변경이 적용되려면 중단 작업이 필요함을 나타냅니다. 이런 제약은 <ConstraintDef> 요소로 정의합니다.
제약은 다음 가운데 한 곳에 정의할 수 있습니다.
- 제약이 매개변수 하나에만 적용되면
<ParameterDef>요소 안 - 카탈로그 수준. 이때 나중에
<ParameterDef>요소에서 제약을 가리킬 수 있도록<ConstraintDef>요소에 id 속성이 있어야 합니다.
내장(Built-In) 제약
<BuiltIn> 요소에는 속성도 자식 요소도 없습니다.
내장 제약은 핵심 엔진에 하드 코딩된 작업을 정의합니다. 지금 정의된 내장 제약은 bosboot 하나뿐입니다. 내장 제약이 다른 중단 작업과 다른 점은 AIX Runtime Expert가 bosboot 명령을 결코 실행하지 않는다는 것입니다. 핵심 엔진은 변경이 적용되려면 bosboot가 필요하다고 경고만 합니다.
0590-206 A manual post-operation is required for the changes to take effect
Please perform a bosboot
PreOp와 PostOp 제약
<PreOp> 요소는 set 구성 방법이 매개변수 값을 설정하기 전에 실행할 필수 명령(셸 식)을 정의합니다. <PostOp> 요소는 set 구성 방법을 실행한 뒤 실행할 필수 명령을 정의합니다.
<ConstraintDef> 요소에는 <PreOp> 자식 요소가 0개나 1개, <PostOp> 자식 요소가 0개나 1개 있어야 합니다.
예:
- (카탈로그 수준의) 내장 제약 예입니다.
<ConstraintDef id="bosboot">
<Description>
<NLSCatalog catalog="artexcat.cat" setNum="51" msgNum="3">
bosboot
</NLSCatalog>
</Description>
<Built>Inbosboot</BuiltIn>
</ConstraintDef>
<PreOp>제약 예입니다.trustchkParam.xml카탈로그의 clic 제약입니다. 이 예에서 preop 명령은 아무것도 실행하지 않고, set 명령에 필요한 커널 확장이 있는지만 확인한다는 점에 유의합니다. 커널 확장이 설치되어 있지 않으면<PreOp>요소에 정의한 제약이 실패하고 set 명령은 실행되지 않습니다.
<ConstraintDef id="clic">
<Description>
<NLSCatalog catalog="artexcat.cat" setNum="48" msgNum="3">
Check that the clic.rte kernel extension is installed.
</NLSCatalog>
</Description>
<Pre>Oplslpp -l "clic*"</PreOp>
</ConstraintDef>
<PostOp>제약 예입니다.authParam.xml카탈로그의 커널 보안 표 설정(set Kernel Security Tables) 제약입니다. 고친 데이터베이스는 모든 수정을 마친 뒤 커널에 한 번만 올리면 됩니다.
<ConstraintDef id="setkst">
<Description>
<NLSCatalog catalog="artexcat.cat" setNum="5" msgNum="3">
Send the authorizations database to the KST (Kernel Security Tables)
</NLSCatalog></Description>
<PostOp>/usr/sbin/setkst -t auth >/dev/null</PostOp>
</ConstraintDef>
<CfgMethod> 요소
구문 — 부모 요소: <Catalog>. 다음 속성을 지원합니다.
표 29. 속성
| 속성 | 필수 | 형 | 설명 |
|---|---|---|---|
| id | 예 | string | 구성 방법의 이름 |
다음 자식 요소를 지원합니다.
표 30. 자식 요소
| 자식 요소 | 필수 | 개수 | 설명 |
|---|---|---|---|
<Get> |
아니요 | 0~1 | get 작업의 구성 방법 정의. 여러 번 나올 수 있습니다(원문 그대로). |
<Set> |
아니요 | 0~1 | set 작업의 구성 방법 정의. 여러 번 나올 수 있습니다(원문 그대로). |
<Diff> |
아니요 | 0~1 | diff 작업의 구성 방법 정의 |
<Discover> |
아니요 | 0~1 | 대상 발견의 구성 방법 정의 |
<Property> |
아니요 | 0~여러 개 | 이 구성 방법을 쓰는 매개변수에 property를 할당합니다. |
사용법 — <CfgMethod> 요소는 나중에 매개변수가 <ParameterDef> 요소의 cfgmethod 속성으로 가리킬 수 있는 구성 방법을 정의합니다. 그러면 매개변수는 가리킨 구성 방법 아래 정의된 모든 요소를 상속합니다.
매개변수에 따라 구성 방법을 쓰면 로컬 정의보다 다음 이점이 있을 수 있습니다.
- 여러 매개변수에 같은 명령행 요소를 되풀이하지 않아 카탈로그 파일이 단순해집니다.
- 여러 매개변수를 명령 하나로 처리할 수 있습니다.
예 — vmoParam.xml 카탈로그는 같은 구성 방법을 쓰는 매개변수를 많이 정의합니다. 다음은 이 카탈로그를 단순하게 줄인 것입니다.
<Catalog id="vmoParam" version="2.1">
<CfgMethod id="vmo">
<Get type="current">
<Command>/usr/sbin/vmo -a</Command>
<Mask name="1" value="2">[[:space:]]*(.*) = (.*)</Mask>
</Get>
<Get type="nextboot">
<Command>/usr/sbin/vmo -r -a</Command>
<Mask name="1" value="2">[[:space:]]*(.*) = (.*)</Mask>
</Get>
<Set type="permanent">
<Command>/usr/sbin/vmo -p%a</Command>
<Argument>%n=%v1</Argument>
</Set>
<Set type="nextboot">
<Command>/usr/sbin/vmo -r%a</Command>
<Argument>%n=%v1</Argument>
</Set>
</CfgMethod>
<ParameterDef name="ame_maxfree_mem" cfgmethod="vmo" type="integer" />
<ParameterDef name="ame_min_ucpool_size" cfgmethod="vmo" type="integer" />
<ParameterDef name="ame_minfree_mem" cfgmethod="vmo" type="integer" />
...
</Catalog>
관련 정보:
- 명령행 생성,
<Get>요소,<Set>요소
<Get> 요소
구문 — 부모 요소: <CfgMethod>, <ParameterDef>. 다음 속성을 지원합니다.
표 31. 속성
| 속성 | 필수 | 형 | 설명 |
|---|---|---|---|
| type | 예 | string | get 명령의 종류(current나 nextboot) |
다음 자식 요소를 지원합니다.
표 32. 자식 요소
| 자식 요소 | 필수 | 개수 | 설명 |
|---|---|---|---|
<Command> |
아니요 | 0~1 | 명령 |
<Argument> |
아니요 | 0~1 | 명령행 인수 |
<Stdin> |
아니요 | 0~1 | <Stdin> 요소가 지원하는 인수 |
<Filter> |
아니요 | 0~1 | 필터 |
<Mask> |
아니요 | 0~1 | 출력 캡처 마스크 |
<Prereq> |
아니요 | 0~여러 개 | get 작업에 전제 조건을 할당합니다. |
<Command> 요소는 매개변수마다 <CfgMethod> 수준이나 <ParameterDef> 수준에 바로 정의해야 합니다.
사용법 — <Get> 요소는 특정 매개변수의 값을 가져오는 방법을 설명합니다. <ParameterDef> 요소 바로 아래에 쓰거나, cfgmethod 속성으로 <ParameterDef> 요소에서 가리키는 <CfgMethod> 요소 아래에 쓰거나, 두 방법을 조합해 쓸 수 있습니다.
매개변수마다 type 속성의 지원 값마다 하나씩, Get 요소 두 개를 정의해야 합니다.
- Get type="current"는 매개변수의 runtime 값을 가져오려고 실행할 방법을 식별합니다.
- Get type="nextboot"는 시스템을 다음에 재부팅한 뒤 매개변수가 가질 값을 가져오려고 실행할 방법을 식별합니다.
- 실행할 get 방법은 하는 작업에 따라 다릅니다.
- artexget 명령을
-r플래그로 부르면 current get 방법을 씁니다. - artexget 명령을
-n플래그로 부르면 nextboot get 방법을 씁니다. - artexget 명령을
-p플래그로 부르면, 실행할 방법은 매개변수의 applyType 속성에 따라 다릅니다. applyType 속성이 runtime인 매개변수에는 current get 방법을, applyType 속성이 reboot(원문 그대로, nextboot)인 매개변수에는 nextboot get 방법을 씁니다.
- artexget 명령을
관련 정보:
- 명령행 생성,
<Mask>요소
<Set> 요소
<Set> 요소는 매개변수 값을 설정하는 명령행을 만드는 방법을 정의합니다.
구문 — 부모 요소: <CfgMethod>, <ParameterDef>. 다음 속성을 지원합니다.
표 33. 속성
| 속성 | 필수 | 형 | 설명 |
|---|---|---|---|
| type | 예 | string | set 명령의 종류(current, nextboot, permanent) |
다음 자식 요소를 지원합니다.
표 34. 자식 요소
| 자식 요소 | 필수 | 개수 | 설명 |
|---|---|---|---|
<Command> |
아니요 | 0~1 | 명령 |
<Argument> |
아니요 | 0~1 | 명령행 인수 |
<Stdin> |
아니요 | 0~1 | Stdin 인수 |
<Prereq> |
아니요 | 0~여러 개 | <Set> 작업에 전제 조건을 할당합니다. |
참고: <Command> 요소는 매개변수마다 <CfgMethod> 수준이나 <ParameterDef> 수준에 바로 정의해야 합니다.
사용법 — 매개변수마다 정의할 수 있는 <Set> 요소는 필수 type 속성으로 구분하는 세 종류입니다.
- Set type="current"는 현재 세션에서만 매개변수 값을 바꾸는 set 작업을 정의합니다. 이 set 작업으로 한 변경은 시스템을 재부팅하면 사라집니다.
- Set type="nextboot"는 시스템을 다음에 재부팅한 뒤 매개변수가 가질 값만 바꾸는 set 작업을 정의합니다. 현재 값은 바뀌지 않습니다.
- Set type="permanent"는 매개변수의 current 값과 nextboot 값을 모두 바꾸는 set 작업을 정의합니다.
실행할 set 작업의 종류는 artexset 명령을 실행할 때 프로파일에 든 매개변수의 applyType 속성을 바탕으로 정해집니다. 다음 표는 카탈로그 파일에 정의한 set 방법과 매개변수의 applyType 속성에 따라 실행되는 set 방법을 요약합니다(1은 그 종류의 Set을 정의함, 0은 정의하지 않음).
표 35. set 방법 — 정의한 set 방법 종류와 매개변수 applyType 속성
| 정의: current | 정의: nextboot | 정의: permanent | applyType=runtime일 때 | applyType=nextboot일 때 |
|---|---|---|---|---|
| 0 | 0 | 0 | 설정하지 않음(오류) | 설정하지 않음(오류) |
| 0 | 0 | 1 | permanent로 설정 | 설정하지 않음(오류) |
| 0 | 1 | 0 | nextboot로 설정 + 경고 | nextboot로 설정 |
| 0 | 1 | 1 | permanent로 설정 | 설정하지 않음(오류) |
| 1 | 0 | 0 | current로 설정 + 경고 | nextboot로 설정 |
| 1 | 0 | 1 | permanent로 설정 | 설정하지 않음(오류) |
| 1 | 1 | 0 | current로 설정, nextboot로 설정 | nextboot로 설정 |
| 1 | 1 | 1 | permanent로 설정 | nextboot로 설정 |
관련 정보:
- 명령행 생성
<Diff> 요소
<Diff> 요소는 매개변수의 두 값을 비교하는 명령행을 만드는 방법을 정의합니다.
구문 — 부모 요소: <CfgMethod>, <ParameterDef>. 다음 자식 요소를 지원합니다.
표 36. 자식 요소
| 자식 요소 | 필수 | 설명 |
|---|---|---|
<Command> |
아니요 | 명령 |
<Argument> |
아니요 | 명령행 인수 |
<Stdin> |
아니요 | Stdin 인수 |
<Filter> |
아니요 | 필터 |
<Mask> |
아니요 | 출력 캡처 마스크 |
참고: <Command> 요소는 매개변수마다 <CfgMethod> 수준이나 <ParameterDef> 수준에 바로 정의해야 합니다.
사용법 — 틀이 형(string, integer, integer-bi, binary 등)을 바탕으로 두 매개변수 값을 내부적으로 비교할 줄 알므로 <Diff> 요소는 보통 필요 없습니다. 그러나 특정 매개변수에 내부 비교가 맞지 않으면 대신 외부 명령을 쓸 수 있습니다.
예 — 다음 <Diff> 요소는 대부분의 매개변수에 쓸 수 있지만, 내부 비교 함수를 쓰는 것이 더 효율적입니다. 이 <Diff> 요소는 diff 명령으로 두 값이 든 두 파일을 비교합니다.
<Diff>
<Command>/usr/bin/diff %f1 %f2; echo $?</Command>
</Diff>
관련 정보:
- 명령행 생성,
<Mask>요소
<Discover> 요소
<Discover> 요소는 대상을 지원하는 매개변수의 대상을 발견하는 명령행을 만드는 방법을 정의합니다.
구문 — 부모 요소: <CfgMethod>, <ParameterDef>. 다음 자식 요소를 지원합니다.
표 37. 자식 요소
| 자식 요소 | 필수 | 개수 | 설명 |
|---|---|---|---|
<Command> |
아니요 | 0~1 | 명령 |
<Prereq> |
아니요 | 0~여러 개 | discover 작업에 전제 조건을 할당합니다. |
참고: <Command> 요소는 매개변수마다 <CfgMethod> 수준이나 <ParameterDef> 수준에 바로 정의해야 합니다.
사용법 — discover 명령은 주어진 매개변수의 대상 인스턴스 목록을 얻는 데 씁니다.
대상 클래스 N개를 지원하는 매개변수의 discover 명령 출력 형식은 다음과 같습니다.
class_1=inst_1_1;class_2=inst_2_1;...;class_N=inst_N_1
class_1=inst_1_2;class_2=inst_2_2;...;
class_N=inst_N_2class_1=inst_1_3;
class_2=inst_2_3;...;class_N=inst_N_3
...
artexget 명령은 다음 조건 가운데 하나를 만족하는 매개변수에 discover 명령을 만들어 실행합니다.
- class와 instance 속성이 빈
<Target>요소가 있습니다:<Target class="" instance="" /> - match 속성이 있는
<Target>요소가 적어도 하나 있습니다:<Target class="..." match="..." />
artexset 명령은 다음 두 조건도 만족해야 합니다.
- artexset 명령을
-d플래그로 부릅니다. - 프로파일의
<Parameter>요소에 setDiscover 속성이 true로 설정되어 있습니다.
예:
mktcpipParam.xml카탈로그는 다음 discover 명령으로 시스템에 정의된 네트워크 인터페이스 목록을 얻습니다.
<Discover>
<Command>
/usr/sbin/lsdev -C -c if -F "name" | /usr/bin/sed -e ’s/^/interface=/’
</Command>
</Discover>
이 명령의 출력은 다음과 같습니다.
interface=en0
interface=et0
interface=lo0
chuserParam.xml카탈로그는 다음 discover 명령으로 모든 적재 인증 모듈의 모든 사용자 목록을 얻습니다.
<Discover>
<Command>
/usr/sbin/lsuser -a registry ALL |
/usr/bin/sed -e "s/\(.*\) registry=\(.*\)/module=\2;user=\1/g"
</Command>
</Discover>
이 명령의 출력은 다음과 같습니다.
module=LDAP;user=daemon
module=LDAP;user=bin
module=LDAP;user=sys
module=LDAP;user=adm
...
module=files;user=root
module=files;user=daemon
module=files;user=bin
module=files;user=sys
module=files;user=adm
...
영어 원문
<ConstraintDef> element
Syntax
Parent element: <Catalog>, <ParameterDef>
The following attributes are supported:
Table 27. Attributes
| Attribute | Required | Type | Description |
|---|---|---|---|
| id | no* |
string | Specifies the name of the parameter constraint. |
*This attribute must be specified for <Constraint> elements defined at the catalog level.
The following child elements are supported:
Table 28. Child Elements
| Child Elements | Required | Description |
|---|---|---|
<Description> |
no | Textual description of the disruptive command. |
<PreOp> |
no | Disruptive operations to run before setting the parameter value. |
<PostOp> |
no | Disruptive operations to run after setting the parameter value. |
<BuiltIn> |
no | Built-in disruptive operation This element may occur multiple times. |
Usage
Some tuning and configuration parameters may require disruptive operations for value changes to take effect. A disruptive operation is any operation that may temporarily interrupt access to a service or a device. Typical disruptive operations are restarting a daemon, unmounting or mounting a filesystem, bringing a network adapter card offline or online. The AIX Runtime Expert program uses constraints to show that a parameter requires a disruptive operations for changes to take effect. A <ConstraintDef> element is used to define such a constraint.
The constraint can be defined either:
Inside a
<ParameterDef>element, if the constraint only applies to the single parameter.At the catalog level, the
<ConstraintDef>element must have an id attribute to allow the constraint to be referenced later in<ParameterDef>elements.
Built-In constraint
The <BuiltIn> element does not contain any attribute or child element.
The built-in constraint defines operations that are hard coded in the core engine. There is currently only one built-in constraint defined: bosboot. The difference of built-in constraints with other disruptive operations is that the bosboot command is never run by AIX Runtime Expert. The core engine will only warn that a bosboot is required for changes to take effect.
0590-206 A manual post-operation is required for the changes to take effect
Please perform a bosboot
PreOp and PostOp constraint
The <PreOp> element defines mandatory commands (shell expressions) to be run before the parameter value is set by the set configuration method. The <PostOp> element defines mandatory commands to be run after the execution of the set configuration method.
An <ConstraintDef> element must contain 0 or one <PreOp> child element, and 0 or one <PostOp> child element.
Examples
- Example of a built-in constraint (at catalog level)
<ConstraintDef id="bosboot">
<Description>
<NLSCatalog catalog="artexcat.cat" setNum="51" msgNum="3">
bosboot
</NLSCatalog>
</Description>
<Built>Inbosboot</BuiltIn>
</ConstraintDef>
- Example of
<PreOp>constraint: The clic constraint in thetrustchkParam.xmlcatalog. Note that in this example, the preop command does not run anything, but only checks the presence of a kernel extension required by the set command. If the kernel extension is not installed, then the constraint defined in the<PreOp>element will fail and the set command will not be run:
<ConstraintDef id="clic">
<Description>
<NLSCatalog catalog="artexcat.cat" setNum="48" msgNum="3">
Check that the clic.rte kernel extension is installed.
</NLSCatalog>
</Description>
<Pre>Oplslpp -l "clic*"</PreOp>
</ConstraintDef>
- Example of
<PostOp>constraint: The set Kernel Security Tables constraint in theauthParam.xmlcatalog. The modified databases need to be loaded only once in the kernel after all modifications have been made.
<ConstraintDef id="setkst">
<Description>
<NLSCatalog catalog="artexcat.cat" setNum="5" msgNum="3">
Send the authorizations database to the KST (Kernel Security Tables)
</NLSCatalog></Description>
<PostOp>/usr/sbin/setkst -t auth >/dev/null</PostOp>
</ConstraintDef>
<CfgMethod> element:
Syntax
Parent element: <Catalog>
The following attribute is supported:
Table 29. Attribute
| Attribute | Required | Type | Description |
|---|---|---|---|
| id | yes | string | Specifies the name of the configuration method. |
The following child elements are supported:
Table 30. Child elements
| Child elements | Required | Number | Description |
|---|---|---|---|
<Get> |
no | 0 – 1 | Configuration method definition for the get operation. This element may occur multiple times. |
<Set> |
no | 0 – 1 | Configuration method definition for the set operation. This element may occur multiple times. |
<Diff> |
no | 0 – 1 | Configuration method definition for diff operation. |
<Discover> |
no | 0 – 1 | Configuration method definition for target discovery. |
<Property> |
no | 0 – any | Assigns a property to the parameters using the configuration method. |
Usage
The <CfgMethod> element defines a configuration method that can later be referenced by a parameter using the cfgmethod attribute of the <ParameterDef> element. The parameter then inherits all the elements defined under the referenced configuration method.
Depending on the parameter, using a configuration may offer several advantages over the local definition:
It simplifies the catalog file, avoiding duplication of the same command line elements for several parameters.
It allows multiple parameters to be treated by a single command.
Example
The vmoParam.xml catalog defines a lot of parameters that all use the same configuration method. Here is a simplified version of this catalog:
(24줄짜리 예는 위 한글 본문에 그대로 실었습니다.)
Related Information
Command line generation
The
<Get>elementThe
<Set>element
<Get> element:
Syntax
Parent element: <CfgMethod>, <ParameterDef>
The following attribute is supported:
Table 31. Attribute
| Attribute | Required | Type | Description |
|---|---|---|---|
| type | yes | string | Specifies the type of the get command (current or nextboot). |
The following child elements are supported:
Table 32. Child elements
| Child elements | Required | Number | Description |
|---|---|---|---|
<Command> |
no | 0 – 1 | Command |
<Argument> |
no | 0 – 1 | Command-line arguments |
<Stdin> |
no | 0 – 1 | Arguments supported by the <Stdin> element |
<Filter> |
no | 0 – 1 | Filter |
<Mask> |
no | 0 – 1 | Output capturing mask |
<Prereq> |
no | 0 – any | Assigns a prerequisite to the get operation |
The <Command> element must be defined for each parameter, either at the <CfgMethod> level or directly at the <ParameterDef> level.
Usage
The <Get> element describes how the value of a particular parameter is captured. It can be used either directly under the <ParameterDef> element, or under a <CfgMethod> element referenced in the <ParameterDef> element using the cfgmethod attribute, or using a combination of those two possibilities.
Two Get elements should be defined for each parameter, one for each supported value of the type attribute:
Get type=“current” identifies the method that will be run to retrieve the runtime value of the parameter.
Get type=“nextboot” identifies the method that will be run to retrieve the value that the parameter will have after the next reboot of the system.
The get method to be run depends on the operation being performed: – If the artexget command is called with the –r flag, the current get method is used. – If the artexget command is called with the –n flag, the nextboot get method is used. – If the artexget command is called with the –p flag, the method run depends on the parameters input to the applyType attribute. The current get method is used for the parameters that have their applyType attribute set to runtime and the nextboot get method is used for the parameters that have an applyType attribute of reboot.
Related Information
Command line generation
The <Mask> element.
<Set> element:
The <Set> element defines how to build a command line to set the value of a parameter.
Syntax
Parent element: <CfgMethod>, <ParameterDef>
The following attribute is supported:
Table 33. Attribute
| Attribute | Required | Type | Description |
|---|---|---|---|
| type | yes | string | Specifies the type of the set command as current or nextboot. |
The following child elements are supported:
Table 34. Child elements
| Child elements | Required | Number | Description |
|---|---|---|---|
<Command> |
no | 0 – 1 | Command |
<Argument> |
no | 0 – 1 | Command-line arguments |
<Stdin> |
no | 0 – 1 | Stdin arguments |
<Prereq> |
no | 0 – any | Assigns a prerequisite to the <Set> operation |
Note: The <Command> element must be defined for each parameter, either at the <CfgMethod> level or directly at the <ParameterDef> level.
Usage
There are three types of <Set> elements that can be defined for each parameter, identified by their required type attribute:
Set type=“current” defines a set operation that only changes the value of the parameter for the current session. Any change made using the set operation will be lost after a reboot of the system.
Set type=“nextboot” defines a set operation that only changes the value the parameter will take after the next reboot of the system. The current value is not modified.
Set type=“permanent” defines a set operation that changes both the current and the nextboot value of the parameter.
The type of the set operation run is decided based on parameters included when the artexset command is run, based the parameter applyType attribute in the profile. The following table summarizes the set methods that are run, depending on the set methods defined in the catalog file depending on the applyType attribute for the parameter:
Table 35. Set Methods - set method types defined and Parameter applyType attribute.
| current | nextboot | permanent | runtime | nextboot |
|---|---|---|---|---|
| 0 | 0 | 0 | not set (error) | not set (error) |
| 0 | 0 | 1 | set permanent | not set (error) |
| 0 | 1 | 0 | set nextboot + warning | set nextboot |
| 0 | 1 | 1 | set permanent | not set (error) |
| 1 | 0 | 0 | set current + warning | set nextboot |
| 1 | 0 | 1 | set permanent | not set (error) |
| 1 | 1 | 0 | set current set nextboot | set nextboot |
| 1 | 1 | 1 | set permanent | set nextboot |
Related Information
Command line generation.
<Diff> element:
The <Diff> element defines how to build a command line to compare two values of a parameter.
Syntax
Parent element: <CfgMethod>, <ParameterDef>
The following child elements are supported:
Table 36. Child elements
| Child elements | Required | Description |
|---|---|---|
<Command> |
no | Command |
<Argument> |
no | Command-line arguments |
<Stdin> |
no | Stdin arguments |
<Filter> |
no | Filter |
<Mask> |
no | Output capturing mask |
Note: The <Command> element must be defined for each parameter, either at the <CfgMethod> level or directly at the <ParameterDef> level.
Usage
The <Diff> element is usually not required, since the framework knows how to compare two parameter values internally based on the type (string, integer, integer-bi, binary, etc.). However, in case the internal comparison is not adapted for a particular parameter, it is possible to use an external command instead.
Example
The following <Diff> element can be used for most parameters, even though using the internal comparison function is more efficient. The <Diff> element uses the diff command to compare two files that contains the two values:
<Diff>
<Command>/usr/bin/diff %f1 %f2; echo $?</Command>
</Diff>
Related Information
Command line generation.
The <Mask> element.
<Discover> element:
The <Discover> element defines how to build a command line to discover targets for a parameter that supports them.
Syntax
Parent element: <CfgMethod>, <ParameterDef>
The following child elements are supported:
Table 37. Child elements
| Child elements | Required | Number | Description |
|---|---|---|---|
<Command> |
no | 0 – 1 | Command |
<Prereq> |
no | 0 – any | Assigns a prerequisite to the discover operation |
Note: The <Command> element must be defined for each parameter, either at the <CfgMethod> level or directly at the <ParameterDef> level.
Usage
A discover command is used to obtain the list of target instances for a given parameter.
The output of a discover command for a parameter that supports N target classes have the following format:
class_1=inst_1_1;class_2=inst_2_1;...;class_N=inst_N_1
class_1=inst_1_2;class_2=inst_2_2;...;
class_N=inst_N_2class_1=inst_1_3;
class_2=inst_2_3;...;class_N=inst_N_3
...
The artexget command generates and runs a discover command for parameters that satisfy one of the following criteria:
Contain a
<Target>element with empty class and instance attributes.<Targetclass="" instance="" />Contain at least one
<Target>element with a match attribute:<Targetclass="..." match="..." />
The artexset command additionally requires the following two criteria to be satisfied:
The artexset command is called with the –d flag.
The
<Parameter>element in the profile has the setDiscover attribute set to true.
Examples
- The
mktcpipParam.xmlcatalog uses the following discover command to obtain the list of the network interfaces defined on the system:
<Discover>
<Command>
/usr/sbin/lsdev -C -c if -F "name" | /usr/bin/sed -e ’s/^/interface=/’
</Command>
</Discover>
This command gives the following output:
interface=en0
interface=et0
interface=lo0
- The
chuserParam.xmlcatalog uses the following discover command to get to the list of all users for all loadable authentication modules:
<Discover>
<Command>
/usr/sbin/lsuser -a registry ALL |
/usr/bin/sed -e "s/\(.*\) registry=\(.*\)/module=\2;user=\1/g"
</Command>
</Discover>
This command gives the following output:
module=LDAP;user=daemon
module=LDAP;user=bin
module=LDAP;user=sys
module=LDAP;user=adm
...
module=files;user=root
module=files;user=daemon
module=files;user=bin
module=files;user=sys
module=files;user=adm
...