AIX Runtime Expert とは?
AIX Runtime Expert で構成プロファイル(xmlファイル)を元に、OSの複数の構成設定を単一コマンドで行います。複数の環境に同じ設定を行いたいという場合などに便利です。
参照:AIX Runtime Expert
https://www.ibm.com/docs/ja/aix/7.2?topic=administration-aix-runtime-expert
サンプル構成プロファイル
サンプル構成プロファイルが/etc/security/artex/samples 下に用意されています。
# cd /etc/security/artex/samples/
# ls
acctctlProfile.xml coreProfile.xml iooProfile.xml roleProfile.xml
aixpertProfile.xml ctctrlProfile.xml krecoveryProfile.xml ruserProfile.xml
all.xml custom_dumpctrlProfile.xml login.cfgProfile.xml schedoProfile.xml
alogProfile.xml default.xml lvmoProfile.xml secattrProfile.xml
authProfile.xml devProfile.xml lvup.xml shconfProfile.xml
authentProfile.xml dumpCompTraceProfile.xml mktcpipProfile.xml skctlProfile.xml
chconsProfile.xml dumpctrlProfile.xml mkuser.defaultProfile.xml smtctlProfile.xml
chdevProfile.xml envProfile.xml namerslvProfile.xml syscorepathProfile.xml
chlicenseProfile.xml errctrlProfile.xml nfsProfile.xml sysdumpdevProfile.xml
chservicesProfile.xml errdemonProfile.xml nfsoProfile.xml trcctlProfile.xml
chssysProfile.xml ewlmProfile.xml nisProfile.xml trustchkProfile.xml
chsubserverProfile.xml ffdcProfile.xml noProfile.xml tsdProfile.xml
chuserProfile.xml filterProfile.xml probevueProfile.xml vmoProfile.xml
classProfile.xml gencopyProfile.xml rasoProfile.xml
#
サンプル構成プロファイルを使用した値の取得
一例で/etc/security/artex/samples/chdevProfile.xml を使用して、現行の値を取得します。
# artexget -r /etc/security/artex/samples/chdevProfile.xml
<?xml version="1.0" encoding="UTF-8"?>
<Profile origin="get" version="2.0.1" date="2021-05-27T08:13:26Z">
<Catalog id="chdev.sys0Param" version="2.0">
<Parameter name="SW_dist_intr" value="0" applyType="nextboot"/>
<Parameter name="autorestart" value="1" applyType="nextboot"/>
<Parameter name="cpuguard" value="1" applyType="nextboot"/>
<Parameter name="enhanced_RBAC" value="1" applyType="nextboot"/>
<Parameter name="fullcore" value="0" applyType="nextboot"/>
<Parameter name="iostat" value="0" applyType="nextboot"/>
<Parameter name="log_pg_dealloc" value="1" applyType="nextboot"/>
<Parameter name="max_logname" value="9" applyType="nextboot"/>
<Parameter name="maxbuf" value="20" applyType="nextboot"/>
<Parameter name="maxmbuf" value="0" applyType="nextboot"/>
<Parameter name="maxpout" value="8193" applyType="nextboot"/>
<Parameter name="maxuproc" value="128" applyType="nextboot"/>
<Parameter name="minpout" value="4096" applyType="nextboot"/>
<Parameter name="ncargs" value="256" applyType="nextboot"/>
<Parameter name="nfs4_acl_compat" value="secure" applyType="nextboot"/>
<Parameter name="pre430core" value="0" applyType="nextboot"/>
<Parameter name="pre520tune" value="0" applyType="nextboot"/>
<Parameter name="sed_config" value="select" applyType="nextboot"/>
</Catalog>
</Profile>
#
"chdev.sys0Param" とあり、sys0 の一部の値の設定を取得しています。
プロファイルに定義された値のみを取得していて、sys0設定値の全てではありません。
参考:
・AIX Runtime Expert プロファイル値を入手する:https://www.ibm.com/docs/ja/aix/7.2?topic=expert-getting-aix-runtime-profile-values
・artexget コマンド:https://www.ibm.com/docs/ja/aix/7.2?topic=artexget-command
取得したプロファイルでの適用
適用は artexset コマンドで実行します。
artexset -r <profile 名>
オプションは種々あるのでマニュアルを参照ください。
・AIX Runtime Expert プロファイルを適用する
https://www.ibm.com/docs/ja/aix/7.2?topic=expert-applying-aix-runtime-profiles
・artexset コマンド
https://www.ibm.com/docs/ja/aix/7.2?topic=artexset-command
使い方のテスト・シナリオ
AIX7.2 TL03SP03 で sys0 の max_logname および enhanced_RBAC を変更する
- max_lognameおよびenhanced_RBACの設定を手動で変更
- chdevProfile.xml を使用し現行の設定値をファイル取得
- max_lognameおよびenhanced_RBACの設定を再度手動で変更
- 取得していたプロファイルを適用し、変更した値がプロファイル設定値に戻るかどうかを確認
- リブートを行い、max_logname および enhanced_RBAC を確認する
実行ログ
環境
# oslevel -s
7200-03-03-1914
変更前の値を確認
# lsattr -El sys0 -a max_logname -a enhanced_RBAC
max_logname 9 Maximum login name length at boot time True
enhanced_RBAC true Enhanced RBAC Mode True
値を手動で変更
# chdev -l sys0 -a max_logname=30
sys0 changed
# chdev -l sys0 -a enhanced_RBAC=false
sys0 changed
確認
# lsattr -El sys0 -a max_logname -a enhanced_RBAC
max_logname 30 Maximum login name length at boot time True
enhanced_RBAC false Enhanced RBAC Mode True
/tmp/artexディレクトリ下に現行値を取得したプロファイル(cur_chdevProfile.xml)を作成
# mkdir -p /tmp/artex
# cd /tmp/artex
# artexget -r /etc/security/artex/samples/chdevProfile.xml > cur_chdevProfile.xml
# echo $?
0
# ls -l
total 8
-rw-r--r-- 1 root system 1338 Jun 04 02:36 cur_chdevProfile.xml
#
確認
# cat cur_chdevProfile.xml
<?xml version="1.0" encoding="UTF-8"?>
<Profile origin="get" version="2.0.1" date="2020-06-04T07:36:13Z">
<Catalog id="chdev.sys0Param" version="2.0">
<Parameter name="SW_dist_intr" value="0" applyType="nextboot"/>
<Parameter name="autorestart" value="1" applyType="nextboot"/>
<Parameter name="cpuguard" value="1" applyType="nextboot"/>
<Parameter name="enhanced_RBAC" value="0" applyType="nextboot"/> ##<= 0 でfalse
<Parameter name="fullcore" value="0" applyType="nextboot"/>
<Parameter name="iostat" value="0" applyType="nextboot"/>
<Parameter name="log_pg_dealloc" value="1" applyType="nextboot"/>
<Parameter name="max_logname" value="30" applyType="nextboot"/> ##<= 30
<Parameter name="maxbuf" value="20" applyType="nextboot"/>
<Parameter name="maxmbuf" value="0" applyType="nextboot"/>
<Parameter name="maxpout" value="8193" applyType="nextboot"/>
<Parameter name="maxuproc" value="128" applyType="nextboot"/>
<Parameter name="minpout" value="4096" applyType="nextboot"/>
<Parameter name="ncargs" value="256" applyType="nextboot"/>
<Parameter name="nfs4_acl_compat" value="secure" applyType="nextboot"/>
<Parameter name="pre430core" value="0" applyType="nextboot"/>
<Parameter name="pre520tune" value="0" applyType="nextboot"/>
<Parameter name="sed_config" value="select" applyType="nextboot"/>
</Catalog>
</Profile>
#
パラメーターは applyType="nextboot" のため、適用の反映は次のブート後であることを示しています。では、対象値を手動で変更します。
# chdev -l sys0 -a max_logname=9
sys0 changed
# chdev -l sys0 -a enhanced_RBAC=true
sys0 changed
確認
# lsattr -El sys0 -a max_logname -a enhanced_RBAC
max_logname 9 Maximum login name length at boot time True
enhanced_RBAC true Enhanced RBAC Mode True
値が変更された状態で、先ほど取得したプロファイルを適用します。
# ls -l /tmp/artex/cur_chdevProfile.xml
-rw-r--r-- 1 root system 1338 Jun 04 02:36 /tmp/artex/cur_chdevProfile.xml
# artexset -r /tmp/artex/cur_chdevProfile.xml
0590-206 A manual post-operation is required for the changes to take effect
Please reboot the system
#
リブートするようにメッセージが出力されました。
確認
# lsattr -El sys0 -a max_logname -a enhanced_RBAC
max_logname 30 Maximum login name length at boot time True
enhanced_RBAC false Enhanced RBAC Mode True
#
applyType="nextboot"でしたが、cur_chdevProfile.xml プロファイルで設定している値が出力されています。
ODMへの反映にブートが必要なのかもしれません。
リブートします。
# shutdown -Fr
SHUTDOWN PROGRAM
Thu Jun 4 02:44:03 CDT 2020
リブート後の確認
# lsattr -El sys0 -a max_logname -a enhanced_RBAC
max_logname 30 Maximum login name length at boot time True
enhanced_RBAC false Enhanced RBAC Mode True
#
ブート後も変わらず cur_chdevProfile.xml の設定値が反映されています。
テスト終了、以上です。
参考
テストに使用したsys0設定値変更の参考:
・同期入出力のチューナブル・パラメーター
https://www.ibm.com/support/knowledgecenter/ja/ssw_aix_72/performance/sync_io.html
・RBAC モードの構成
https://www.ibm.com/support/knowledgecenter/ja/ssw_aix_72/security/rbac_config_mode.html
$ chdev -l sys0 -a enhanced_RBAC=false
・ODM データベースでのユーザー・グループおよび名前の長さ制限の変更
https://www.ibm.com/support/knowledgecenter/ja/ssw_aix_72/security/change_user_group_name_limit.html
$ chdev -l sys0 -a max_logname=30