ラズパイ4相当の性能が出るらしいRISC-VコアのSBC StarFive Vision Five 2のクラウドファンディングが進行中


2022/12/30追記: 届いたので記事追加中です。

StarFive Vision Five 2の2022年12月出荷分を使うには面倒くさい手順が必要


例のごとくにcnxsoftwareで「StarFive VisionFive 2 quad-core RISC-V SBC launched for $46 and up (Crowdfunding)」という記事が出ていて、RISC-Vコアのボードのクラファン案件を知る

RISC-Vコアを実装しているベンダの1つであるStarFive techが新しくRV64GCを4コアつんだSoC JH7110を開発し、それを積んだボード StarFive Vision Five 2のクラウドファンディングを開始した、というもの

現時点で公開されているスペックは下記

1Gb NICが2ポートあるというのは興味深い。

そして、M.2 M-Keyのストレージスロットがあるので、そこを使うとそこそこのストレージ性能は出せそうな雰囲気

電源供給はType-C PDとGPIO経由というのはラズパイ4と同等という感じ。

大きさはラズパイ4が85*56mmのところ、100*72mmと大きい

その他、ラズパイ4とスペック比較をすると、下記のようになっており、オレンジになってる部分はスペックが上ということになっている。

GPUがOpenGL ES3.2.OpenCL 1.2, Vulkan 1.2対応と額面スペックとしては上になっているが、はたして実装/実態はどうなっていることか?

そして、気になる新SoC JH7110の演算性能は下記のようにうたわれている。

そして、GPUベンチマークについては上だということになっている。

気になる価格は下記

ただ、今回のクラファンでは、4GBモデルは2022年11月出荷を目指すものの、それ以外の2GBモデルと8GBモデルについては2023年2月出荷予定、と遅れている点に注意が必要。

さしあたっては面白そうなので「VF2-4GB」のSuper Early Birdに1枠入れました。日本への送料込みで約8千円といったところです。

はたして、どのようになるか楽しみですね。

NFS v4ではUTF-8ファイルのみ使用でき、EUCファイル名は使用できない


むかしからSolarisサーバを使っているユーザのとこにNetAppを入れることになった。

どうやらEUC-JPファイル名のものがあるらしいのでNetAppのvolume language を ja_v1で作成してから検証してみたところ、Solaris10環境からNFSマウントして書き込もうとすると「引数が正しくありません」というエラーとなり書き込みが出来ない。

しばらくあれやこれや悩んだ結果、「NFS v4で許されているファイル名は UTF-8 記述のものだけ」という仕様上の問題であることが判明した。(RFC7530 Network File System (NFS) Version 4 Protocol の 12.4. String Encoding に記載)

このため、EUC-JPのファイル名を使いたい場合は、NFS ver3でマウントすることが必須、ということが分かった。

検証過程

まず、Solaris10環境から、NFS ver4で /mnt4 にマウントし、NFS ver3で /mnt3 にマウントした。

# mount 172.17.44.103:/eucvol /mnt4
# mount -o vers=3 172.17.44.103:/eucvol /mnt3
# df -h|grep mnt
mnttab                   0K     0K     0K     0%    /etc/mnttab
172.17.44.103:/eucvol   1.9G   808K   1.9G     1%    /mnt4
172.17.44.103:/eucvol   1.9G   808K   1.9G     1%    /mnt3
# mount|grep /mnt
/etc/mnttab on mnttab read/write/setuid/devices/rstchown/dev=4c80001 on (金)  8 月 12 15:30:07 2022
/mnt4 on 172.17.44.103:/eucvol remote/read/write/setuid/devices/rstchown/xattr/dev=4f40004 on (金)  8月 12 15:33:31 2022
/mnt3 on 172.17.44.103:/eucvol remote/read/write/setuid/devices/rstchown/vers=3/xattr/dev=4f40005 on (金)  8月 12 15:33:38 2022
#

この状態でそれぞれを確認すると、下記の様になっている。

# ls -l /mnt3
合計 8
-rw-r--r--   1 root     root           6  8月 10日  14:37 test.txt
-rw-r--r--   1 root     root           0  8月 10日  14:51 てすと
drwxr-xr-x   2 root     other       4096  8月 10日  14:35 表計算
# ls -l /mnt4
合計 8
-rw-r--r--   1 root     root           6  8月 10日  14:37 test.txt
-rw-r--r--   1 root     root           0  8月 10日  14:51 礒窿
・rwxr-xr-x   2 root     daemon      4096  8月 10日  14:35 茵 ・
・
#

NFS ver4でマウントしている /mnt4 の方は日本語文字(EUC-JP)が正常に表示できていない。

次に /tmp/てすと2 のコピーを試みる

# cp  /tmp/てすと2 /mnt4
cp: /mnt4/てすと2 を作成できません: 引数が正しくありません。
# LANG=C
# export LANG
# date
Fri Aug 12 15:37:39 JST 2022
# cp  /tmp/てすと2 /mnt4
cp: cannot create /mnt4/てすと2: Invalid argument
#

NFS ver4でマウントしている領域へのコピーは「引数が正しくありません」、英語メッセージの場合は「Invalid argument」で失敗する。

対して、NFS ver3領域へのコピーは問題なく実施できる。

# LANG=ja
# export LANG
# date
2022年08月12日 (金) 15時39分11秒 JST
# cp /tmp/てすと2 /mnt3
# ls -l /mnt3
合計 8
-rw-r--r--   1 root     root           6  8月 10日  14:37 test.txt
-rw-r--r--   1 root     root           0  8月 10日  14:51 てすと
-rw-r--r--   1 root     root           8  8月 12日  15:39 てすと2
drwxr-xr-x   2 root     other       4096  8月 10日  14:35 表計算
#

なお、この領域をWindows側から見た場合はこのように正常に表示されている。

ちなみに・・・ONTAP CLIからvolume languageコマンドを実行してみたところ、標準権限(admin)とadvanced権限とで表示される内容が違う、というのが興味深かったです。

netapp101::> volume language -vserver netapp103 -volume eucvol

Volume language is ja_v1 (Japanese euc-j) for netapp103:eucvol

netapp101::> set adv

Warning: These advanced commands are potentially dangerous; use them only when directed to do so by NetApp personnel.
Do you want to continue? {y|n}: y

netapp101::*> volume language -vserver netapp103 -volume eucvol

Volume language is ja_v1 (Japanese euc-j) for netapp103:eucvol

Translation Versions
        OEM Character set is cp932_v1|cp932_v1|Wed Jan 22 23:18:24 UTC 2003 for netapp103:eucvol

        NFS Character set is eucj_v1|eucj_v1|Wed Jan 22 00:46:42 UTC 2003 for netapp103:eucvol

netapp101::*>

ONTAP 9.x環境でActive DirectoryとNISとでユーザ名マッピングを行わせた場合の確認手法


Windows Active Direcotry環境とNISによるユーザ管理を行っているSolaris/Linux環境の両方からONTAP 9.9上の共有にアクセスする場合、ユーザ名マッピング設定を行う。

ただ、指定したマッピングが正しく動いているかを確認する方法がわかりにくいのでメモ書き。

(関連資料「ONTAP 9.xでntpやDNSの動作確認」)

今回はStorage VM:netapp103に対して、 Active Directory:VM2 (vm2.adosakana.local) と NISドメイン:nisdom を接続した。

NISに接続できているかを確認

「vserver services name-service nis-domain show」で設定を確認

netapp101::> vserver services name-service nis-domain show
                                  NIS
Vserver       Domain              Server
------------- ------------------- ------------------------------------
netapp103     nisdom              172.17.44.49

netapp101::>

接続できているかを確認するには「vserver services name-service nis-domain show-bound」を実行する。接続できている場合は「Bound NIS Server」に接続出来ているNISサーバのIPアドレスが表示される。

netapp101::> vserver services name-service nis-domain show-bound
                                  Bound
Vserver       Domain              NIS Server
------------- ------------------- -----------------
netapp103     nisdom              172.17.44.49

netapp101::>

接続できていない場合は、「-」という表示になる

netapp101::> vserver services name-service nis-domain show-bound
                                  Bound
Vserver       Domain              NIS Server
------------- ------------------- -----------------
netapp103     nisdom              -

netapp101::>

なぜ接続出来ていないかを確認するには権限をdiagに変更した上で「vserver services name-service nis-domain show-bound-debug」を実行して確認する。(advancedでは使えない)

netapp101::*> vserver services name-service nis-domain show-bound-debug
                                  Bound              Bound
Vserver       Domain              NIS Server         Status
------------- ------------------- -----------------  -------------------
netapp103     nisdom              172.17.44.49       Could not connect to server

netapp101::*>

今回は「Could not connect to server」ということで、NISサーバへの接続がうまくいかない、ということだった。確認したところ、途中のfirewall設定の問題でNISに関するポートが空いていないためだった。

設定変更後、手動でNISの再接続を行う場合は、ypbindの再起動を行う。このコマンドはノード名を指定することに注意

netapp101::*> vserver services name-service ypbind restart -node ノード名

netapp101::*>

再度「vserver services name-service nis-domain show-bound-debug」を実行して「Status: Success」となっていれば問題ない。

netapp101::*> vserver services name-service nis-domain show-bound-debug
                                  Bound              Bound
Vserver       Domain              NIS Server         Status
------------- ------------------- -----------------  -------------------
netapp103     nisdom              172.17.44.49       Success

netapp101::*>

ネームサービススイッチ設定

/etc/nsswitch.confに相当する設定をStorage VMに対して行い、ユーザ名とグループ名に関してNISから情報を持ってくるように設定する。

設定を確認するには「vserver services ns-switch show」を実行する

netapp101::> vserver services ns-switch show
                               Source
Vserver         Database       Order
--------------- ------------   ---------
netapp103       hosts          files,
                               dns
netapp103       group          files,
                               nis
netapp103       passwd         files,
                               nis
netapp103       netgroup       files
netapp103       namemap        files
netapp101     hosts          files,
                               dns
netapp101     group          files
netapp101     passwd         files
8 entries were displayed.
netapp101::>

UNIX側でLDAP情報を使っていない場合は、LDAPを登録する必要は無い。(Windows側だけでActive Directory/LDAPを使っている場合はnsswitchには登録しない)

なお、ONTAP 9.xでは、NISを使用できるのは passwd, group, netgroup となっており、hosts では使用できない。

情報取得の確認

まず、UNIX側のユーザ名とUIDに関する情報がひけるかを確認するため「vserver services name-service getxxbyyy getpwbyname」と「vserver services name-service getxxbyyy getpwbyuid」を実行する。

これらはadvanced権限が必要となっているので「set adv」で切り替えてから実行する。

netpp101::*> vserver services name-service getxxbyyy getpwbyname -vserver netapp103 -username osakanataro
pw_name: osakanataro
pw_passwd: !!
pw_uid: 1000
pw_gid: 1000
pw_gecos:
pw_dir: /home/osakanataro
pw_shell: /bin/bash


netpp101::*> vserver services name-service getxxbyyy getpwbyuid -vserver netapp103 -userID 1000
pw_name: osakanataro
pw_passwd: !!
pw_uid: 1000
pw_gid: 1000
pw_gecos:
pw_dir: /home/osakanataro
pw_shell: /bin/bash


netpp101::*>

このような形で情報が引けたら問題ない

うまく取得出来ていない場合は、下記の様な出力となる

netapp101::*> vserver services name-service getxxbyyy getpwbyname -vserver netapp103 -username osakanataro

Error: command failed: Failed to resolve osakanataro. Reason: Entry not found for
       "username: osakanataro".

netapp101::*>

マッピング設定

UNIX/Linuxのユーザ名/UIDとWindowsのユーザ名/SIDを変換するには ONTAPにネームマッピング設定を行う必要がある。

WindowsからUNIX/Linuxに対するマッピング(win-unix)と、UNIX/Linuxに対するマッピング(unix-win)の2種類を設定する必要がある。

netapp101::> vserver name-mapping show

Vserver:   netapp103
Direction: win-unix
Position Hostname         IP Address/Mask
-------- ---------------- ----------------
1       -                 -                   Pattern: VM2\\*
                                          Replacement: *

Vserver:   netapp103
Direction: unix-win
Position Hostname         IP Address/Mask
-------- ---------------- ----------------
1       -                 -                   Pattern: *
                                          Replacement: VM2\\*
2 entries were displayed.

netapp101::>

基本的に1対1となるようであれば、「ADドメイン\Windowsユーザ名」→「UNIXユーザ名」というルール(win-unixにある「VM2\\* → *」)と「UNIXユーザ名」→「ADドメイン\Windowsユーザ名」(unix-winにある「* → VM2\\*」)を設定することになる。

なお、”\”は2つ指定する必要がある。

マッピングの確認

実際にどのようなマッピングが行われているのかを確認するには「vserver services access-check name-mapping show」を使います。このコマンドもadvanced権限が必要です。

netapp101::*> vserver services access-check name-mapping show -vserver netapp103 -direction win-unix -name osakanataro

ATTENTION: Mapping of Data ONTAP "admin" users to UNIX user "root" is enabled, but the following information does not reflect this mapping.

'osakanataro' maps to 'osakanataro'


netapp101::*> 
Windowsの名前からUNIXを探すときはにユーザ名を「-name "vm2\\osakanataro"」というように"でくくると正常な動作とならないので注意。
また、ドメインとユーザの区切りは「\\」と2つ続ける必要がある。
netapp101::*> vserver services access-check name-mapping show -vserver netapp103 -direction win-unix -name vm2\\osakanataro

ATTENTION: Mapping of Data ONTAP "admin" users to UNIX user "root" is enabled, but the following information does not reflect this mapping.

'vm2\\osakanataro' maps to 'osakanataro'


netapp101::*> vserver services access-check name-mapping show -vserver netapp103 -direction unix-win -name osakanataro

'osakanataro' maps to 'VM2\osakanataro'


netapp101::*>

なお、NISサーバにアクセスできない場合にこのコマンドを実行すると、以下の様な結果になります。

netapp101::*> vserver services access-check name-mapping show -vserver netapp103 -direction unix-win -name osakanataro

Vserver: netapp103 (internal ID: 3)

Error: RPC map name request procedure failed
  [  4 ms] Mapping Successful for Unix-user 'osakanataro' to Windows
           user 'VM2*' at position 1
  [    11] Successfully connected to ip 172.17.44.49, port 445 using
           TCP
  [    59] Unknown error: 12
  [    59] Failed to initiate Kerberos authentication. Trying NTLM.
  [    70] Encountered NT error (NT_STATUS_MORE_PROCESSING_REQUIRED)
           for SMB command SessionSetup
  [    95] Successfully authenticated with DC
           samba.adosakana.local
  [   109] Encountered NT error (NT_STATUS_PENDING) for SMB command
           Read
  [   117] Could not find Windows name 'VM2*'
**[   120] FAILURE: Name mapping for UNIX user 'osakanataro' failed.
**         Explicit Mapping failed and no default mapping found

Error: command failed: Failed to find mapping for the user. Reason: "SecD
       Error: The mapped user does not exist and no default user is defined".

netapp101::*>

ファイル権限確認

ONTAP上に置かれているファイルの権限をONTAP OS上から確認する「vserver security file-directory show-effective-permissions」がadvanced権限にあります。

確認したいファイル/ディレクトリをフルパスで指定します。

Windows側ユーザ名でアクセスした場合の確認。このコマンドではドメインとユーザの区切りは「\」が1つとなる。

netapp101::*> vserver security file-directory show-effective-permissions -vserver netapp103 -win-user-name VM2\osakanataro -path /sharevol/testfile.txt

                        Vserver: netapp103
              Windows User Name: VM2\osakanataro
                 Unix User Name: osakanataro
                      File Path: /sharevol/testfile.txt
                CIFS Share Path: -
          Effective Permissions:
                                 Effective File or Directory Permission: 0x1f01ff
                                        Read
                                        Write
                                        Append
                                        Read EA
                                        Write EA
                                        Execute
                                        Delete Child
                                        Read Attributes
                                        Write Attributes
                                        Delete
                                        Read Control
                                        Write DAC
                                        Write Owner
                                        Synchronize

netapp101::*>

UNIX/Linux側からアクセスした場合の確認

netapp101::*> vserver security file-directory show-effective-permissions -vserver netapp103 -unix-user-name osakanataro -path /sharevol/testfile.txt

                        Vserver: netapp103
              Windows User Name: VM2\osakanataro
                 Unix User Name: osakanataro
                      File Path: /sharevol/testfile.txt
                CIFS Share Path: -
          Effective Permissions:
                                 Effective File or Directory Permission: 0x1f01ff
                                        Read
                                        Write
                                        Append
                                        Read EA
                                        Write EA
                                        Execute
                                        Delete Child
                                        Read Attributes
                                        Write Attributes
                                        Delete
                                        Read Control
                                        Write DAC
                                        Write Owner
                                        Synchronize

netapp101::*>

細かい動作確認

ユーザ名/UID/SID変換の詳細を確認したい場合は、advanced権限にある「vserver services access-check authentication」を使います

UNIX用ユーザ名からUNIX UIDを検索

netapp101::*> vserver services access-check authentication translate -vserver netapp103 -unix-user-name osakanataro
1000


netapp101::*>

UNIX UIDからUNIX用ユーザ名を検索

netapp101::*> vserver services access-check authentication translate -vserver netapp103 -uid 1000
osakanataro


netapp101::*>

UNIX UIDからWindows用SIDを検索

netapp101::*> vserver services access-check authentication uid-to-sid -vserver netapp103 -uid 1000
SID: S-1-5-21-937304154-1581684492-536532533-1180


netapp101::*>

SIDからUNIX用ユーザ名 と Windows用ユーザ名を検索

netapp101::*> vserver services access-check authentication sid-to-unix-name -vserver netapp103 -sid S-1-5-21-937304154-1581684492-536532533-1180
    SID Type: User
   Unix Name: osakanataro
 Domain Name: VM2
Windows Name: osakanataro


netapp101::*>

Windows用ユーザ名からSIDを検索。このコマンドではドメインとユーザの区切りは「\」が1つとなる。

netapp101::*> vserver services access-check authentication translate -vserver  netapp103 -win-name osakanataro
S-1-5-21-937304154-1581684492-536532533-1180


netapp101::*> vserver services access-check authentication translate -vserver  netapp103 -win-name vm2\osakanataro
S-1-5-21-937304154-1581684492-536532533-1180


netapp101::*>

AlmaLinux 8にRStudio serverをインストールしてみる


AlmaLinux 8環境にRStudio serverをセットアップする必要がある、ということで検証してみた。

Rのインストール

まずはRをインストールする。

Install R」を参考に作業。

必要なレポジトリとして「CodeReady」と「EPEL」と書かれている。

AlmaLinux/RockyLinuxではCodeReadyは「powertools」であるため「dnf config-manager –enable powertools」を実行してPowerToolsレポジトリを有効化する

# dnf config-manager --enable powertools
#

続いてEPELを有効化するため「dnf install epel-release」を実行する。

# dnf install epel-release
メタデータの期限切れの最終確認: 0:00:21 時間前の 2022年08月05日 17時05分19秒 に実施しました。
依存関係が解決しました。
==============================================================================================================
 パッケージ                   アーキテクチャー       バージョン                  リポジトリー           サイズ
==============================================================================================================
インストール:
 epel-release                 noarch                 8-10.el8                    extras                  22 k

トランザクションの概要
==============================================================================================================
インストール  1 パッケージ

ダウンロードサイズの合計: 22 k
インストール後のサイズ: 32 k
これでよろしいですか? [y/N]: y
<略>
インストール済み:
  epel-release-8-10.el8.noarch

完了しました!
#

現在有効になっているレポジトリを確認するため「dnf repolist」を実行

# dnf repolist
repo id                           repo の名前
appstream                         AlmaLinux 8 - AppStream
baseos                            AlmaLinux 8 - BaseOS
epel                              Extra Packages for Enterprise Linux 8 - x86_64
epel-modular                      Extra Packages for Enterprise Linux Modular 8 - x86_64
extras                            AlmaLinux 8 - Extras
powertools                        AlmaLinux 8 - PowerTools
# dnf repolist --all

続いてR本体をインストールする。

まず、インストールできるRバージョンを「https://cran.r-project.org/src/base/R-4/」にアクセスして確認する

バージョン「4.1.3」をインストールする場合は環境変数「R_VERSION」を「4.1.3」と指定して実行する

# export R_VERSION=4.1.3
# curl -O https://cdn.rstudio.com/r/centos-8/pkgs/R-${R_VERSION}-1-1.x86_64.rpm
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 61.6M  100 61.6M    0     0  4741k      0  0:00:13  0:00:13 --:--:-- 3486k
# ls -l R-4.1.3-1-1.x86_64.rpm
-rw-r--r--. 1 root root 64609131  8月  5 17:08 R-4.1.3-1-1.x86_64.rpm
# dnf install R-4.1.3-1-1.x86_64.rpm
メタデータの期限切れの最終確認: 0:02:34 時間前の 2022年08月05日 17時06分28秒 に実施しました。
依存関係が解決しました。
==============================================================================================================
 パッケージ                       Arch            バージョン                      リポジトリー          サイズ
==============================================================================================================
インストール:
 R-4.1.3                          x86_64          1-1                             @commandline           62 M
依存関係のインストール:
 binutils                         x86_64          2.30-113.el8                    baseos                5.8 M
 bzip2-devel                      x86_64          1.0.6-26.el8                    baseos                224 k
 cairo                            x86_64          1.15.12-6.el8                   appstream             718 k
 cpp                              x86_64          8.5.0-10.1.el8_6.alma           appstream              10 M
 dejavu-fonts-common              noarch          2.35-7.el8                      baseos                 73 k
 dejavu-sans-fonts                noarch          2.35-7.el8                      baseos                1.5 M
 fontconfig                       x86_64          2.13.1-4.el8                    baseos                273 k
 fontpackages-filesystem          noarch          1.44-22.el8                     baseos                 16 k
 fribidi                          x86_64          1.0.4-8.el8                     appstream              89 k
 gcc                              x86_64          8.5.0-10.1.el8_6.alma           appstream              23 M
 gcc-c++                          x86_64          8.5.0-10.1.el8_6.alma           appstream              12 M
 gcc-gfortran                     x86_64          8.5.0-10.1.el8_6.alma           appstream              12 M
 glibc-devel                      x86_64          2.28-189.5.el8_6                baseos                 78 k
 glibc-headers                    x86_64          2.28-189.5.el8_6                baseos                482 k
 graphite2                        x86_64          1.3.10-10.el8                   appstream             121 k
 harfbuzz                         x86_64          1.7.5-3.el8                     appstream             295 k
 isl                              x86_64          0.16.1-6.el8                    appstream             841 k
 jbigkit-libs                     x86_64          2.1-14.el8                      appstream              54 k
 kernel-headers                   x86_64          4.18.0-372.16.1.el8_6           baseos                9.3 M
 libICE                           x86_64          1.0.9-15.el8                    appstream              73 k
 libSM                            x86_64          1.2.3-1.el8                     appstream              47 k
 libX11                           x86_64          1.6.8-5.el8                     appstream             610 k
 libX11-common                    noarch          1.6.8-5.el8                     appstream             157 k
 libXau                           x86_64          1.0.9-3.el8                     appstream              37 k
 libXext                          x86_64          1.3.4-1.el8                     appstream              45 k
 libXft                           x86_64          2.3.3-1.el8                     appstream              66 k
 libXmu                           x86_64          1.1.3-1.el8                     appstream              75 k
 libXrender                       x86_64          0.9.10-7.el8                    appstream              33 k
 libXt                            x86_64          1.1.5-12.el8                    appstream             185 k
 libcurl-devel                    x86_64          7.61.1-22.el8_6.3               baseos                833 k
 libdatrie                        x86_64          0.2.9-7.el8                     appstream              33 k
 libgfortran                      x86_64          8.5.0-10.1.el8_6.alma           baseos                643 k
 libicu                           x86_64          60.3-2.el8_1                    baseos                8.8 M
 libicu-devel                     x86_64          60.3-2.el8_1                    baseos                922 k
 libjpeg-turbo                    x86_64          1.5.3-12.el8                    appstream             156 k
 libmpc                           x86_64          1.1.0-9.1.el8                   appstream              60 k
 libpkgconf                       x86_64          1.4.2-1.el8                     baseos                 35 k
 libquadmath                      x86_64          8.5.0-10.1.el8_6.alma           baseos                170 k
 libquadmath-devel                x86_64          8.5.0-10.1.el8_6.alma           appstream              23 k
 libstdc++-devel                  x86_64          8.5.0-10.1.el8_6.alma           appstream             2.0 M
 libthai                          x86_64          0.1.27-2.el8                    appstream             203 k
 libtiff                          x86_64          4.0.9-21.el8                    appstream             187 k
 libxcb                           x86_64          1.13.1-1.el8                    appstream             231 k
 libxcrypt-devel                  x86_64          4.1.1-6.el8                     baseos                 24 k
 make                             x86_64          1:4.2.1-11.el8                  baseos                497 k
 openblas-threads                 x86_64          0.3.15-3.el8                    appstream             4.9 M
 pango                            x86_64          1.42.4-8.el8                    appstream             296 k
 pcre2-devel                      x86_64          10.32-2.el8                     baseos                604 k
 pcre2-utf16                      x86_64          10.32-2.el8                     baseos                228 k
 pcre2-utf32                      x86_64          10.32-2.el8                     baseos                220 k
 pixman                           x86_64          0.38.4-2.el8                    appstream             256 k
 pkgconf                          x86_64          1.4.2-1.el8                     baseos                 38 k
 pkgconf-m4                       noarch          1.4.2-1.el8                     baseos                 17 k
 pkgconf-pkg-config               x86_64          1.4.2-1.el8                     baseos                 15 k
 tcl                              x86_64          1:8.6.8-2.el8                   baseos                1.1 M
 tk                               x86_64          1:8.6.8-1.el8                   appstream             1.6 M
 unzip                            x86_64          6.0-46.el8                      baseos                195 k
 xz-devel                         x86_64          5.2.4-4.el8_6                   baseos                 62 k
 zip                              x86_64          3.0-23.el8                      baseos                270 k
 zlib-devel                       x86_64          1.2.11-18.el8_5                 baseos                 57 k

トランザクションの概要
==============================================================================================================
インストール  61 パッケージ

合計サイズ: 165 M
ダウンロードサイズの合計: 103 M
インストール後のサイズ: 416 M
これでよろしいですか? [y/N]: y
<略>
完了しました!
#

R本体が必要としているパッケージ群が追加でインストールされる。

Rは/opt以下にインストールされる

# ls -l /opt
合計 0
drwxr-xr-x. 3 root root 19  8月  5 17:10 R
# ls -l /opt/R/
合計 0
drwxr-xr-x. 5 root root 41  8月  5 17:10 4.1.3
# ls -l /opt/R/4.1.3/
合計 0
drwxr-xr-x. 2 root root 30  8月  5 17:10 bin
drwxr-xr-x. 4 root root 32  8月  5 17:10 lib
drwxr-xr-x. 3 root root 17  8月  5 17:10 share
# du -ks /opt/R/
157716  /opt/R/
#

/opt/R/bin/ は標準的なパスに入っていないので、標準的なパスである /usr/local/bin 以下にRを配置する。

# sudo ln -s /opt/R/${R_VERSION}/bin/R /usr/local/bin/R
# sudo ln -s /opt/R/${R_VERSION}/bin/Rscript /usr/local/bin/Rscript
# which R
/usr/local/bin/R
# R --version
R version 4.1.3 (2022-03-10) -- "One Push-Up"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
https://www.gnu.org/licenses/.

#

Rstudio serverのインストール

Download RStudio Server for Red Hat/CentOS の手順に従い、rpmファイルをダウンロードし、インストールする。

# curl -O https://download2.rstudio.org/server/rhel8/x86_64/rstudio-server-rhel-2022.07.1-554-x86_64.rpm
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 73.7M  100 73.7M    0     0  4257k      0  0:00:17  0:00:17 --:--:-- 7049k
# ls -l rstudio-server-rhel-2022.07.1-554-x86_64.rpm
-rw-r--r--. 1 root root 77282076  8月  5 17:16 rstudio-server-rhel-2022.07.1-554-x86_64.rpm
# dnf install rstudio-server-rhel-2022.07.1-554-x86_64.rpm
メタデータの期限切れの最終確認: 0:11:33 時間前の 2022年08月05日 17時06分28秒 に実施しました。
依存関係が解決しました。
==============================================================================================================
 パッケージ                  アーキテクチャー    バージョン                   リポジトリー              サイズ
==============================================================================================================
インストール:
 rstudio-server              x86_64              2022.07.1+554-1              @commandline               74 M
依存関係のインストール:
 libpq                       x86_64              13.5-1.el8                   appstream                 197 k
 sqlite                      x86_64              3.26.0-15.el8                baseos                    667 k

トランザクションの概要
==============================================================================================================
インストール  3 パッケージ

合計サイズ: 75 M
ダウンロードサイズの合計: 864 k
インストール後のサイズ: 346 M
これでよろしいですか? [y/N]: y
<略>
Created symlink /etc/systemd/system/multi-user.target.wants/rstudio-server.service → /usr/lib/systemd/system/rstudio-server.service.
● rstudio-server.service - RStudio Server
   Loaded: loaded (/usr/lib/systemd/system/rstudio-server.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2022-08-05 17:19:06 JST; 1s ago
  Process: 29307 ExecStart=/usr/lib/rstudio-server/bin/rserver (code=exited, status=0/SUCCESS)
 Main PID: 29308 (rserver)
    Tasks: 4 (limit: 49426)
   Memory: 2.4M
   CGroup: /system.slice/rstudio-server.service
           mq29308 /usr/lib/rstudio-server/bin/rserver

 8月 05 17:19:06 rserver.adosakana.local systemd[1]: Starting RStudio Server...
 8月 05 17:19:06 rserver.adosakana.local systemd[1]: Started RStudio Server.

  検証             : sqlite-3.26.0-15.el8.x86_64                                                          1/3
  検証             : libpq-13.5-1.el8.x86_64                                                              2/3
  検証             : rstudio-server-2022.07.1+554-1.x86_64                                                3/3

インストール済み:
  libpq-13.5-1.el8.x86_64       rstudio-server-2022.07.1+554-1.x86_64       sqlite-3.26.0-15.el8.x86_64

完了しました!
#

インストールするとrstudio-serverがsystemdに登録され、起動している。

firewalldへの設定

rstudio-server の標準設定では port 8787 となっている。

これをfirewalldに登録して外部からアクセスできるようにする。

# firewall-cmd --permanent --add-port=8787/tcp
success
# firewall-cmd --reload
success
# firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens192
  sources:
  services: cockpit dhcpv6-client ssh
  ports: 8787/tcp
  protocols:
  forward: no
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:
#

設定後にブラウザからアクセスすると下記の様な表示が確認出来る

Rstudio Serverを使う為のSELinux設定

Rstudio Serverは一般ユーザのアカウントでログインして使用するため、SELinux側の設定を調整しないとログインもできない。

SELinuxのポリシーをそれなりに設定しようとするのであればaudit2allowコマンドとSELinuxのteファイルをppファイルにコンパイルできる環境が必要になる。

そのためには「policycoreutils-python-utils」と「selinux-policy-devel」パッケージを追加する

# dnf install policycoreutils-python-utils selinux-policy-devel

で・・・具体的にはログインを繰り返して、/var/log/audit/audit.log の出力を確認しつつ、許可する要素を増やしていく形となる

まずは「ausearch -m AVC |grep “denied”」を実行して、SELinuxで拒否されているものを確認する。

# ausearch -m AVC |grep "denied"
type=AVC msg=audit(1659948002.217:181): avc:  denied  { setpgid } for  pid=48278 comm="rserver" scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=process permissive=0
type=AVC msg=audit(1659948020.309:182): avc:  denied  { setpgid } for  pid=48279 comm="rserver" scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=process permissive=0
type=AVC msg=audit(1659948380.864:88): avc:  denied  { setpgid } for  pid=5723 comm="rserver" scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=process permissive=1
type=AVC msg=audit(1659948381.339:89): avc:  denied  { setpgid } for  pid=5723 comm="rsession" scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=process permissive=1
type=AVC msg=audit(1659950719.013:139): avc:  denied  { setpgid } for  pid=6574 comm="rsession" scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=process permissive=1
type=AVC msg=audit(1659950719.419:140): avc:  denied  { name_connect } for  pid=6574 comm="R" dest=443 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:http_port_t:s0 tclass=tcp_socket permissive=1
type=AVC msg=audit(1659950783.684:141): avc:  denied  { write open } for  pid=5723 comm="rsession" path="/home/osakanataro/sample.R" dev="dm-2" ino=148 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:user_home_t:s0 tclass=file permissive=1
type=AVC msg=audit(1659950783.684:141): avc:  denied  { create } for  pid=5723 comm="rsession" name="sample.R" scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:user_home_t:s0 tclass=file permissive=1
type=AVC msg=audit(1659950783.684:142): avc:  denied  { read } for  pid=5723 comm="rsession" name="sample.R" dev="dm-2" ino=148 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:user_home_t:s0 tclass=file permissive=1
type=AVC msg=audit(1660013043.066:93): avc:  denied  { setpgid } for  pid=1774 comm="rserver" scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=process permissive=0
type=AVC msg=audit(1660014586.546:175): avc:  denied  { rename } for  pid=2783 comm="rsession" name="sample.R" dev="dm-2" ino=148 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:user_home_t:s0 tclass=file permissive=0
type=AVC msg=audit(1660014641.065:176): avc:  denied  { rmdir } for  pid=2783 comm="rsession" name="test" dev="dm-2" ino=134217876 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:user_home_t:s0 tclass=dir permissive=0
type=AVC msg=audit(1660017628.367:179): avc:  denied  { rename } for  pid=2783 comm="rsession" name="Untitled" dev="dm-2" ino=159 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:user_home_t:s0 tclass=file permissive=0
type=AVC msg=audit(1660018249.703:187): avc:  denied  { rename } for  pid=2783 comm="rsession" name="test" dev="dm-2" ino=134217876 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:user_home_t:s0 tclass=dir permissive=0
type=AVC msg=audit(1660019006.786:116): avc:  denied  { reparent } for  pid=1809 comm="rsession" name="test2" dev="dm-2" ino=159 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:user_home_t:s0 tclass=dir permissive=0
type=AVC msg=audit(1660028279.975:127): avc:  denied  { map } for  pid=1978 comm="rsession" path="/home/osakanataro/R/x86_64-pc-linux-gnu-library/4.1/digest/libs/digest.so" dev="dm-2" ino=177 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:user_home_t:s0 tclass=file permissive=0
type=AVC msg=audit(1660028329.771:128): avc:  denied  { map } for  pid=1978 comm="rsession" path="/home/osakanataro/R/x86_64-pc-linux-gnu-library/4.1/digest/libs/digest.so" dev="dm-2" ino=177 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:user_home_t:s0 tclass=file permissive=0
type=AVC msg=audit(1660028356.760:129): avc:  denied  { map } for  pid=1978 comm="rsession" path="/home/osakanataro/R/x86_64-pc-linux-gnu-library/4.1/digest/libs/digest.so" dev="dm-2" ino=177 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:user_home_t:s0 tclass=file permissive=0
type=AVC msg=audit(1660028659.078:132): avc:  denied  { execute } for  pid=1978 comm="rsession" path="/home/osakanataro/R/x86_64-pc-linux-gnu-library/4.1/digest/libs/digest.so" dev="dm-2" ino=177 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:user_home_t:s0 tclass=file permissive=0
type=AVC msg=audit(1660028775.153:135): avc:  denied  { append } for  pid=21355 comm="R" name="sample.spin.R" dev="dm-2" ino=10541 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:user_home_t:s0 tclass=file permissive=0
type=AVC msg=audit(1660028911.809:138): avc:  denied  { setattr } for  pid=21400 comm="R" name="sample.spin.R" dev="dm-2" ino=10541 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:user_home_t:s0 tclass=file permissive=0
type=AVC msg=audit(1660029171.607:143): avc:  denied  { name_connect } for  pid=1365 comm="rserver" dest=6687 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket permissive=0
type=AVC msg=audit(1660029171.607:144): avc:  denied  { name_connect } for  pid=1365 comm="rserver" dest=6687 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket permissive=0
type=AVC msg=audit(1660029171.630:145): avc:  denied  { read write } for  pid=1978 comm="rsession" name="ptmx" dev="devtmpfs" ino=1120 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:ptmx_t:s0 tclass=chr_file permissive=0
type=AVC msg=audit(1660029288.326:148): avc:  denied  { open } for  pid=1978 comm="rsession" path="/dev/ptmx" dev="devtmpfs" ino=1120 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:ptmx_t:s0 tclass=chr_file permissive=0
type=AVC msg=audit(1660029372.850:151): avc:  denied  { ioctl } for  pid=1978 comm="rsession" path="/dev/ptmx" dev="devtmpfs" ino=1120 ioctlcmd=0x5401 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:ptmx_t:s0 tclass=chr_file permissive=0
type=AVC msg=audit(1660029433.944:154): avc:  denied  { open } for  pid=1978 comm="rsession" path="/dev/pts/2" dev="devpts" ino=5 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:devpts_t:s0 tclass=chr_file permissive=0
type=AVC msg=audit(1660029433.944:155): avc:  denied  { open } for  pid=1978 comm="rsession" path="/dev/pts/2" dev="devpts" ino=5 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:devpts_t:s0 tclass=chr_file permissive=0
type=AVC msg=audit(1660029551.674:158): avc:  denied  { execmem } for  pid=21641 comm="deno" scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=process permissive=0
type=AVC msg=audit(1660029594.331:162): avc:  denied  { execmem } for  pid=21664 comm="deno" scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=process permissive=0
type=AVC msg=audit(1660029676.859:168): avc:  denied  { link } for  pid=21714 comm="rsession" name=".rstudio-lock-41c29-rserver.adosakana.local-21714-7f2b6802e980" dev="dm-2" ino=17682 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:user_home_t:s0 tclass=file permissive=0
#

特に問題ないようであれば、これをSELinux用のモジュールとする。

# ausearch -m AVC |grep "denied" | audit2allow -M rstudio
******************** 重要 ***********************
このポリシーパッケージを有効にするには、以下を実行して下さい:

semodule -i rstudio.pp

#

このコマンド実行によりrstudio.te というテキストファイルと、rstudio.pp というバイナリファイルが出力される。rstudio.te は下記のような内容となっている。

# cat rstudio.te

module rstudio 1.0;

require {
        type devpts_t;
        type init_t;
        type http_port_t;
        type ptmx_t;
        type user_home_t;
        type unreserved_port_t;
        class process { execmem setpgid };
        class tcp_socket name_connect;
        class file { append create execute link map open read rename setattr write };
        class dir { rename reparent rmdir };
        class chr_file { ioctl open read write };
}

#============= init_t ==============

#!!!! This avc is allowed in the current policy
allow init_t devpts_t:chr_file open;

#!!!! This avc is allowed in the current policy
allow init_t http_port_t:tcp_socket name_connect;

#!!!! This avc is allowed in the current policy
#!!!! This av rule may have been overridden by an extended permission av rule
allow init_t ptmx_t:chr_file { ioctl open read write };

#!!!! This avc is allowed in the current policy
allow init_t self:process { execmem setpgid };

#!!!! This avc is allowed in the current policy
allow init_t unreserved_port_t:tcp_socket name_connect;

#!!!! This avc is allowed in the current policy
allow init_t user_home_t:dir { rename reparent rmdir };
allow init_t user_home_t:file link;

#!!!! This avc is allowed in the current policy
allow init_t user_home_t:file { append create execute map open read rename setattr write };
#

作成されたモジュールを読み込み、モジュール一覧に表示されることを確認する。

# semodule -l | grep rstu
# semodule -i rstudio.pp
# semodule -l | grep rstu
rstudio
#

これで一通りは動作すると思われる

確認した内容
・ファイルの新規作成、削除、リネーム、移動
・ディレクトリの新規作成、削除、リネーム、移動
・Comnpile Reportでのレポート出力
cranパッケージを各ユーザディレクトリにインストールすること
・rstudio上でのshellコマンド実行
・rstudio上でのgitによるバージョン管理(別途 dnf install git でインストールしておくこと)

SELinuxのteファイルをppファイルにする

以下のteファイルをppにします。

# ls
rstudio.te
# cat rstudio.te

module rstudio 1.1;

require {
        type devpts_t;
        type init_t;
        type http_port_t;
        type ptmx_t;
        type user_home_t;
        type unreserved_port_t;
        class process { execmem setpgid };
        class tcp_socket name_connect;
        class file { append create execute link map open read rename setattr write };
        class dir { rename reparent rmdir };
        class chr_file { ioctl open read write };
}

#============= init_t ==============

#!!!! This avc is allowed in the current policy
allow init_t devpts_t:chr_file open;

#!!!! This avc is allowed in the current policy
allow init_t http_port_t:tcp_socket name_connect;

#!!!! This avc is allowed in the current policy
#!!!! This av rule may have been overridden by an extended permission av rule
allow init_t ptmx_t:chr_file { ioctl open read write };

#!!!! This avc is allowed in the current policy
allow init_t self:process { execmem setpgid };

#!!!! This avc is allowed in the current policy
allow init_t unreserved_port_t:tcp_socket name_connect;

#!!!! This avc is allowed in the current policy
allow init_t user_home_t:dir { rename reparent rmdir };
allow init_t user_home_t:file link;

#!!!! This avc is allowed in the current policy
allow init_t user_home_t:file { append create execute map open read rename setattr write };
#

teファイルがある場所で「make -f /usr/share/selinux/devel/Makefile」を実行すると、ppファイルが出力されます。

# make -f /usr/share/selinux/devel/
Makefile    example.if  html/       policy.dtd
example.fc  example.te  include/    policy.xml
# make -f /usr/share/selinux/devel/Makefile
Compiling targeted rstudio module
Creating targeted rstudio.pp policy package
rm tmp/rstudio.mod tmp/rstudio.mod.fc
# ls -l
合計 20
-rw-r--r--. 1 root root    0  8月  9 17:55 rstudio.fc
-rw-r--r--. 1 root root   23  8月  9 17:55 rstudio.if
-rw-r--r--. 1 root root 8589  8月  9 17:55 rstudio.pp
-rw-r--r--. 1 root root 1258  8月  9 17:54 rstudio.te
drwxr-xr-x. 2 root root   70  8月  9 17:55 tmp
#

こうしてできたppファイルを「semodule -i rstudio.pp」で読み込みます。


アレな実験

検証用ということで借りたサーバ実機がRHEL8でインストールされていたが、登録とくにされておらず、CodeReadyレポジトリなどが使えない状態となっていた。

なんかごまかせるかなーというのをチャレンジ

その1: BaseOSとAppStreamはISOファイルから取得する

BaseOSとAppStreamはrhel-8.6-x86_64-dvd.iso に含まれているため適当なディレクトリに置いてそれをレポジトリとする

参考URL:Oracle® Linux 8 Oracle Linuxでのソフトウェアの管理 1.8 ISOイメージを使用したローカルYumリポジトリの作成

ISOファイルを /var/isos/rhel-8.6-x86_64-dvd.iso に置いて、マウントポイントを /isos/rhel86 とし、/etc/fstabに下記を追加する

/var/isos/rhel-8.6-x86_64-dvd.iso       /isos/rhel86    iso9660 loop,ro 0 0

これでマウントすると下記の様になる。

# mount -a
# df -h
ファイルシス          サイズ  使用  残り 使用% マウント位置
devtmpfs                3.8G     0  3.8G    0% /dev
tmpfs                   3.8G     0  3.8G    0% /dev/shm
tmpfs                   3.8G  8.7M  3.8G    1% /run
tmpfs                   3.8G     0  3.8G    0% /sys/fs/cgroup
/dev/mapper/rhel-root    70G   14G   57G   20% /
/dev/sda2              1014M  206M  809M   21% /boot
/dev/sda1               599M  5.9M  594M    1% /boot/efi
/dev/mapper/rhel-home    41G  322M   41G    1% /home
tmpfs                   777M     0  777M    0% /run/user/0
/dev/loop0               11G   11G     0  100% /isos/rhel86
#

これをレポジトリとして登録するために /etc/yum.repos.d/media.repo として下記を作成する。

[media-baseos]
name=media-baseos
baseurl=file:///isos/rhel86/BaseOS/
gpgcheck=1
enabled=1

[media-appstream]
name=media-appstream
baseurl=file:///isos/rhel86/AppStream/
gpgcheck=0
enabled=1

(手動で入力することを想定しているため、入力が面倒くさい gpgkeyに関する記述を省略している)

その2: EPELとCodeReadyはAlmaLinuxから持ってくる

RHEL8からは持って来れないので、AlmaLinuxかRockyLinuxから持ってくる

今回は社内テストをAlmaLinuxで行っていたため、そこで登録されているレポジトリ設定を流用した。

また、RHEL側は8.6で固定したいので、 /etc/yum/vars/releasever を作成し、8.6 で固定する設定とした。

# cat /etc/yum/vars/releasever
8.6
#

EPELの内容 /etc/yum.repos.d/epel.repo

# cat /etc/yum.repos.d/epel.repo
[epel]
name=Extra Packages for Enterprise Linux 8 - $basearch
# It is much more secure to use the metalink, but if you wish to use a local mirror
# place its address here.
#baseurl=https://download.example/pub/epel/8/Everything/$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-8&arch=$basearch&infra=$infra&content=$contentdir
enabled=1
gpgcheck=0
countme=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
#

powertoolsの設定 /etc/yum.repos.d/powertools.repo

# cat /etc/yum.repos.d/powertools.repo
[powertools]
name=AlmaLinux $releasever - PowerTools
#mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/powertools
baseurl=https://repo.almalinux.org/almalinux/$releasever/PowerTools/$basearch/os/
enabled=1
gpgcheck=0
countme=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux
#

なお、今後8.7が出た場合でも8.6固定を維持したい場合は https://repo.almalinux.org/almalinux/を https://repo.almalinux.org/vault/ に書き換える。

とりあえず、これで、目的はひとまず達成できた。

RHEL/AlmaLinux/OracleLinux 9.0でIntel VROCを使うとreboot/shutdown時にハングアップする


Intelのサーバ向けチップセットC600/C220に搭載されているオンボードsSATA RAID機能のIntel® Virtual RAID on CPU(VROC)が使える。

資料は「Support for Intel® Virtual RAID on CPU (Intel® VROC)」からだいたいたどりつけるが重要なものは下記となる。

インテル® Virtual RAID on CPU・ユーザーガイド
 Windows, Linux, ESXiでの利用についてのpdfがある

Linuxの場合、kernelにドライバが組み込まれ、RAID管理はmdadmコマンドを利用して行うようになっている。

RHEL/CentOS 7.3ぐらい以降であれば問題は無い。

当然RHEL/AlmaLinux 9.0でも問題ないのであろうと思ってインストールしてみたところ、再起動/停止(reboot/shutdown)にて問題が発生した。

シャットダウン/再起動実行後、umountの途中で止まる。

上記で少しとまった後、1分ぐらいすると下記の追加出力がある。

そのあと、タイムアウトが終わると下記のdumpを出力して完全に止まる。

RHEL9, AlmaLinux 9, Oracle Linux 9 で試したところ、全て同じエラーで止まっている。

エラーメッセージの中で特徴的な「Unmounting /oldroot timed out」で検索したところ、「Bug 1956133 – System hangs in shutdown stage – mdmon killed by dracut shutdown script」から「Bug 1970610 – On shutdown, “mdadm -vv –wait-clean –scan” hangs, preventing a reboot or poweroff」に到達。

いわく、systemdとmdadmのバグで適切にunmountできないために発生、とのこと。

このBugはFedora 34についてのもので、Fedora 34はRHEL 9.0の元となるバージョンとなる。

RHEL9.0は systemd-250-6、mdadm-4.2-2 で、直っていてもよさそうなんですけど…

出力されているエラーメッセージはxfsに関わるものが多いので、使用するファイルシステムを標準のxfsではなく、ext4に変更すればうまくいくのではないか?と変更してみたところ

ext4でインストールしたRHEL9.0/OracleLinux 9.0は問題無く再起動/停止を行うことができました。

インテルサーバのオンボードRAID(VROC)を使う場合、systemd/mdadmが修正されるまではRHEL9系の導入を見合わせた方がよさそうですね。


2022/11/07追記 なお、この現象が発生したサーバを使わないことになったので、その後の状況については不明です


2023/03/06追記

Lenovoサイトに「RHEL 9.0 fails to reboot or shut down on systems with XFS file system and Intel software SATA/NVME RAID – Lenovo ThinkSystem」という記載を発見

Workaround

There are two workarounds for this issue:

  1. Use the ext4 file system instead of the default xfs.
  2. If the xfs file system must be used, use the following command to shut down or reboot:
    #reboot -f #For restart the machine
    #poweroff -f #For shutdown the machine

「xfsじゃなくてext4を使え」というのはこちらで調査した通りのもの

もう1つは「reboot -f」もしくは「poweroff -f」コマンドを使うと強制的に実行できる、というもの。

なるほど

「This behavior will be corrected in a future release scheduled for First Quarter 2023.」とあるので、そろそろ対処されたものがでるのか?

HPEからも「アドバイザリ: (改訂版) Red Hat Enterprise Linux - Red Hat Enterprise Linux 8.6またはRed Hat Enterprise Linux 9.0で、シャットダウンまたは再起動中にインテルVirtual RAID on CPU (インテルVROC) mdraidアレイがアンマウントされると、システムが応答を停止することがある」(英語版)というのが出てるのだが、「Red Hat Enterprise Linux 9.0については、systemdパッケージを250-6.el9_0.1 (またはそれ以降) にアップグレードします。」という内容。

それじゃ対処されてないはずなんだけどなぁ・・・


2023/05/11追記

どうなったかな?とLenovoとHPEの記述を確認してみたが、変更は無かった。

RedHat「Installing RHEL 9.0 GA on Intel VROC RAID (NVMe) get failed」にも記載がある模様