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/ に書き換える。

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

Commvault で NDMPバックアップするときのポート設定

CommvaultでNetAppをNDMPバックアップする設定をした時にエラーコード 39:424「テープサーバー に接続できませんでした」というエラーが出た

2023/05/10追記 commvault 2022E(11.28)環境でNDMPバックアップを行ったところエラーコード 39:501「テープサーバー に接続できませんでした」というエラーだった。

MediaAgent側のネットワークルート構成に対して「Configuring a Firewall Between a File Server and MediaAgent」にある追加ポートの設定をして解決した。

追加ポートは「50000-50010」とした。

また、インカミング接続で対象となるNetAppのエントリを「制限」として登録する

そして、MediaAgent側のWindows Firewall設定で、50000-50010 を許可する設定を追加する。

ちなみに、これとは別に重複排除DBにアクセスできないというエラーがでている場合は、Windows Firewall設定で、プログラムの「C:\Program Files\Commvault\ContentStore\Base\SID2.exe」を許可することで解決できる。


2023/11/10追記

Media Agentでのネットワークルート設定後、該当するMAの右クリックメニューから[すべてのタスク]-[ネットワーク構成のプッシュ]を選択して情報更新をしないと、指定した範囲でのポート設定でバックアップを行ってくれなかった。

Arcserve UDPで出来ないことのメモ 2025/02/27版

Arcserve UDPが使いたい、と言われて確認したけど、それはできないことだったんだけど、どこにもサポートしてない、という明示的な記述はなかったことをメモする。

「AWS EC2上のインスタンスをバックアップして、OSまるごとリストアする」ことはできない(エージェントなしでの話)

「Amazon S3などのブロックストレージに直接バックアップ保存はできない」

まず、公式資料について

ARCSERVE UNIFIED DATA PROTECTION 8.x ナレッジ センター
 ドキュメントについて調べる時の起点

UDP のクラウド機能の理解
 Arcserve UDPで使えるクラウド関連機能についての説明

2023/06/19追記:UDP 9.0が出ていたので「新機能および機能拡張」を確認したがこのページにかいてある項目に関連する変更は見当たらなかった

2024/04/23追記:UDP 9.2が出ていたので確認。
ARCSERVE UNIFIED DATA PROTECTION 9.x ナレッジ センター
UDP のクラウド機能の理解
Arcserve Unified Data Protection 9.x 動作要件
確認する限りでは、これまでと状況は変わっていない模様。

2025/02/27追記: UDP 10.0が出ていたので確認
ARCSERVE UNIFIED DATA PROTECTION 10.0 ナレッジ センター
クラウド機能のすべて / UDP のクラウド機能の理解
Arcserve Unified Data Protection 10.x 動作要件

変更履歴

2022/07/27 初版作成
2023/06/19 UDP 9.0について追記
2024/04/23 UDP 9.2について追記
2025/02/27 UDP 10.0について追記

AWS EC2上のインスタンスに対してできること

・EC2上のインスタンスにUDP Agentをインストールしてバックアップすること

arcserve Unified Data Protection Support with Amazon EC2 VMs」に「arcserve UDP agent for Windows and Linux supports working on Amazon EC2 VMs」とある

ただ、「Agent for Windows ユーザ ガイド」と「Agent for Linux ユーザ ガイド」を比較すると、Linux側は明示的に書かれているが、WindowsについてはAWS EC2対応について記載されていないためサポートしているのかが不明瞭である。

・EC2上のインスタンスをバックアップして、オンプレ側にある仮想環境にリストアする

Arcserve UDP8.xのマニュアル「Arcserve UDP エージェント(Linux) の使用」に「Amazon EC2 からローカルの Linux マシンに対してマイグレーション BMR を実行する方法」というサポートしている記述がある。

AWS EC2インスタンスでは実践していないがAzureのWindows/LinuxインスタンスでUDP agent経由でバックアップしたものをオンプレHyper-V上で起動させるという検証はしたことがあるので、おそらくEC2上のWindowsインスタンスも同様にいけると思われる。

・EC2上のLinuxインスタンスをBMRを使ってリストアすること

Arcserve UDP8.xのマニュアル「Arcserve UDP エージェント(Linux) の使用」に「AWS クラウドへの Arcserve UDP エージェント(Linux)のインストール」というサポートしている記述がある。

・バックアップしたデータからファイル/ディレクトリを抜き出してリストアすること

これは、UDP Agentとしてバックアップしているので、普通にファイルリストアができる、という話である。

・EC2上にEC2 APIを使って仮想スタンバイもしくはインスタント仮想マシンのインスタンスを作成する

Arcserve UDPでは災害発生時に即座に別の場所でサーバが復帰できるように「仮想スタンバイ(Windows用)」と「インスタント仮想マシン(Linux用)」という機能がある

これを使って、AWS EC2上に別のインスタンスを作成し、そこに対してデータをリストアし続ける、ということを行える。

Amazon EC2 のクラウド アカウントの追加」にあるようにEC2アカウントを登録することで、インスタンス作成を含めて勝手にやってくれる。

・EC2上に作成されたLinuxのインスタント仮想マシンを通常のインスタンスにする

マニュアルに「Linux インスタント仮想マシンを独立した仮想マシンに変換する」という項目があるのでできるのでしょう・・・

AWS EC2上のインスタンスに対して出来ないこと

・EC2のAPIを使って、インスタンスまるごとバックアップすること

EC2上のインスタンスを、EC2 API側からバックアップするような機能は搭載されていない。

・EC2のAPIを使って、インスタンスをまるごとリストアすること

仮想スタンバイもしくはインスタント仮想マシンのインスタンスを作成する機能があるくせに、連動しないで単独でインスタンスを作成しリストアする機能は搭載されていない。

・EC2上のWindowsインスタンスをBMRを使ってリストアすること

Arcserve UDP8.xのマニュアル側には「Arcserve UDP エージェント(Linux) の使用」側には「AWS クラウドへの Arcserve UDP エージェント(Linux)のインストール」というサポートしている記述がある。

しかし「Arcserve UDP エージェント(Windows)の使用」にはクラウド上にBMRでリストアできるような記述がない。

・Amazon S3などのブロックストレージに直接バックアップできない

マニュアルに「復旧ポイントのコピー、ファイル コピー、またはファイル アーカイブのタスクを作成するときに、このアカウントを使用できます。」と書いてある。

つまり、復旧ポイントを最初に作成するときのストレージとしては利用できない、ということになり、ローカルなどで作成した復旧ポイントのコピーをクラウド上に作成する、というイメージとなる。

Azure上のインスタンスに対して出来ること

基本的にはAmazon EC2インスタンスと同様。

・仮想スタンバイの注意点

Azure blobストレージを作成して、そこにディスクイメージをまるごと保管するので料金が掛かる。

仮想スタンバイを起動する場合、Azure blobストレージ上のデータを使って、新規のインスタンスを作成する。つまり、新規インスタンス+そのストレージ料金が新しく料金が掛かる。(Azure blobストレージは残り続ける)

・インスタント仮想マシンの注意点

インスタント仮想マシンを起動する場合、新規インスタンスを作成し、そのインスタンスに対して 同じネットワーク内にあるUDP Linuxサーバを経由してデータを送り込みリストアする。

仮想スタンバイと違ってAzure blobストレージは使わないが、起動時に全リストアをかけるので時間がかかる。

テープ装置連動の注意点

・Arcserve UDPサーバとArcserve Backupサーバの2種類が必要

UDPにはテープにアクセスする機能がなく、Arcseve Backupを利用するため2種類のバックアップソフトをインストールする必要がある。

それぞれ別のMicrosoft SQLインスタンスが稼働することになる。

Arcserve UDP側が ARCSERVE_APP で、Arcserve Backup側がARCSERVE_DB

・テープには毎回フルバックアップされる

Arcserve UDPから直接テープに対してバックアップすることはできない。

Arcserve Backupを別途インストールして、そこと連動してテープに保存する仕組みとなっている。

テープに保存できるのは「復旧ポイント」という塊でのもの

Arcserve UDP側は増分でバックアップしているのだが、Arcserve Backup側でテープにバックアップする際は、全22GBが毎回バックアップされている。

UDPで毎日バックアップしているけど、テープに落とすのは週1回でいい、という場合は、まず最初のUDPバックアップのスケジュールで毎日ではなく「毎週」でスケジュールを1つつくって、それをテープに落とす、という形になる

・ファイルシステムカタログを作成するとArcserve Backup側でファイルリストア可能

Arcserve UDPのプラン設定で、ファイル システム カタログ 生成すると、Arcserve Backup側のGUIでファイルリストアができる

Arcserve BackupのリストアUIを見るとファイルツリーが確認出来る

使用するバックアップ世代も選択できる

・vSphere仮想マシンのファイルリストア取り扱いの違い

Arcserve UDPでvSphere仮想マシンをバックアップした場合、Windows仮想マシンであればArcserve UDP側でファイルシステムカタログを作成しておけば、Arcserve Backup側でファイル単位のリストアが可能。

Linux仮想マシンの場合は、Arcserve UDP側でファイルシステムカタログを作成する、と設定してもファイルシステムカタログは作成されない。Arcserve Backup側でバックアップは取られるもののリストアツリーではWindowsに分類されており、ファイルツリーは見えない

これは、おそらくArcserve Backup側でLinux仮想マシンについてのファイル単位のリストアがサポートされていないためではないかと考えられる。

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」にも記載がある模様

Samba 4.16.x をOracle Linux 8環境でコンパイルする

Oracle Linux 8.6環境でSamba 4.16.3をコンパイルしようとしたら面倒だったのでメモ書き。

まず、「Package Dependencies Required to Build Samba」にあるVerified Package DependenciesのSamba master / CentOS 8 のリンクが使えない。

これは、CentOS8ではなく、CentOS8Streamにリンクが変わったためである。

ただ、Oracle Linux 8ではレポジトリ名が異なっているため、実行が失敗する。

Oracle Linux 8でのレポジトリ対応は下記となる。

RHEL 8CentOS 8Oracle Linux 8
BaseBaseol8_baseos_latest
AppStreamAppStreamol8_appstream
CodeReady Linux Builder*PowerToolsol8_codeready_builder
EPEL**EPEL**ol8_developer_EPEL

なので、Oracle Linux 8では下記を実行してレポジトリを有効化する

# yum config-manager --set-enabled ol8_codeready_builder
# yum config-manager --set-enabled ol8_developer_EPEL

次に、「Red Hat Enterprise Linux 8 / CentOS 8」に記載があるパッケージ群をインストール

# yum install docbook-style-xsl gcc gdb gnutls-devel gpgme-devel jansson-devel \
      keyutils-libs-devel krb5-workstation libacl-devel libaio-devel \
      libarchive-devel libattr-devel libblkid-devel libtasn1 libtasn1-tools \
      libxml2-devel libxslt lmdb-devel openldap-devel pam-devel perl \
      perl-ExtUtils-MakeMaker perl-Parse-Yapp popt-devel python3-cryptography \
      python3-dns python3-gpg python36-devel readline-devel rpcgen systemd-devel \
      tar zlib-devel

エラー対処1: dbus-devel

configure中にエラー発生

Checking for library nscd                                                                       : no
Checking for nscd_flush_cache                                                                   : not found
VFS_STATIC: vfs_default,vfs_not_implemented,vfs_posixacl,vfs_dfs_samba4
VFS_SHARED: vfs_recycle,vfs_audit,vfs_extd_audit,vfs_full_audit,vfs_fake_perms,vfs_default_quota,vfs_readonly,vfs_cap,vfs_expand_msdfs,vfs_shadow_copy,vfs_shadow_copy2,vfs_readahead,vfs_xattr_tdb,vfs_streams_xattr,vfs_streams_depot,vfs_acl_xattr,vfs_acl_tdb,vfs_preopen,vfs_catia,vfs_media_harmony,vfs_unityed_media,vfs_fruit,vfs_shell_snap,vfs_commit,vfs_worm,vfs_crossrename,vfs_linux_xfs_sgid,vfs_time_audit,vfs_offline,vfs_virusfilter,vfs_widelinks,vfs_snapper,vfs_posix_eadb,vfs_syncops,vfs_dirsort,vfs_fileid,vfs_aio_fork,vfs_aio_pthread,vfs_gpfs,vfs_btrfs,vfs_glusterfs_fuse
PDB_STATIC: pdb_smbpasswd,pdb_tdbsam,pdb_samba_dsdb,pdb_ldapsam
PDB_SHARED:
AUTH_STATIC: auth_builtin,auth_sam,auth_winbind,auth_unix,auth_samba4
AUTH_SHARED:
NSS_INFO_STATIC: nss_info_template
NSS_INFO_SHARED:
CHARSET_STATIC:
CHARSET_SHARED:
IDMAP_STATIC: idmap_tdb,idmap_passdb,idmap_nss,idmap_ldap
IDMAP_SHARED: idmap_ad,idmap_rfc2307,idmap_autorid,idmap_rid,idmap_hash,idmap_tdb2,idmap_script
GPEXT_STATIC:
GPEXT_SHARED:
PERFCOUNT_STATIC:
PERFCOUNT_SHARED:
Checking for dbus                                                                               : not found
vfs_snapper is enabled but prerequisite dbus-1 package not found. Use --with-shared-modules='!vfs_snapper' to disable vfs_snapper support.
(complete log in /root/samba-4.16.3/bin/config.log)
# 

これは「dnf install dbus-devel」のインストールで対応

# dnf install dbus-devel
メタデータの期限切れの最終確認: 0:08:21 時間前の 2022年07月19日 09時59分33秒 に 実施しました。
依存関係が解決しました。
================================================================================
 パッケージ      Arch        バージョン                リポジトリー       サイズ
================================================================================
インストール:
 dbus-devel      x86_64      1:1.12.8-18.0.1.el8       ol8_appstream       68 k

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

ダウンロードサイズの合計: 68 k
インストール後のサイズ: 127 k
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
dbus-devel-1.12.8-18.0.1.el8.x86_64.rpm          54 kB/s |  68 kB     00:01
--------------------------------------------------------------------------------
合計                                             54 kB/s |  68 kB     00:01
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備             :                                                        1/1
  インストール中   : dbus-devel-1:1.12.8-18.0.1.el8.x86_64                  1/1
  scriptletの実行中: dbus-devel-1:1.12.8-18.0.1.el8.x86_64                  1/1
  検証             : dbus-devel-1:1.12.8-18.0.1.el8.x86_64                  1/1

インストール済み:
  dbus-devel-1:1.12.8-18.0.1.el8.x86_64

完了しました!
#

エラー対処2: python3-markdown

configure中にエラー発生

Checking for openpty                                                                            : not found
Checking for library util                                                                       : yes
Checking for openpty in util                                                                    : ok
Checking for system installation of Python module markdown                                      : not found
        Unable to find Python module 'markdown'. Please install the system package: python3-markdown'.
#

これは書かれている通りにpython3-markdownをインストール

# dnf install python3-markdown
メタデータの期限切れの最終確認: 0:09:33 時間前の 2022年07月19日 09時59分33秒 に 実施しました。
依存関係が解決しました。
================================================================================
 パッケージ          Arch      バージョン        リポジトリー             サイズ
================================================================================
インストール:
 python3-markdown    noarch    2.6.11-2.el8      ol8_codeready_builder    133 k

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

ダウンロードサイズの合計: 133 k
インストール後のサイズ: 418 k
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
python3-markdown-2.6.11-2.el8.noarch.rpm        108 kB/s | 133 kB     00:01
--------------------------------------------------------------------------------
合計                                            108 kB/s | 133 kB     00:01
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備             :                                                        1/1
  インストール中   : python3-markdown-2.6.11-2.el8.noarch                   1/1
  scriptletの実行中: python3-markdown-2.6.11-2.el8.noarch                   1/1
  検証             : python3-markdown-2.6.11-2.el8.noarch                   1/1

インストール済み:
  python3-markdown-2.6.11-2.el8.noarch

完了しました!
#

エラー対処3: perl-JSON

make中にエラー発生

third_party/heimdal/lib/asn1/der_free.c third_party/heimdal/lib/asn1/der_format.c third_party/heimdal/lib/asn1/der_length.c third_party/heimdal/lib/asn1/der_copy.c third_party/heimdal/lib/asn1/der_cmp.c third_party/heimdal/lib/asn1/der_print.c third_party/heimdal/lib/asn1/extra.c third_party/heimdal/lib/asn1/timegm.c third_party/heimdal/lib/asn1/template.c third_party/heimdal/lib/asn1/oid_resolution.c -> bin/default/third_party/heimdal/lib/asn1/der-protos.h
Can't locate JSON.pm in @INC (you may need to install the JSON module) (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /root/samba-4.16.3/third_party/heimdal/cf/make-proto.pl line 7.
BEGIN failed--compilation aborted at /root/samba-4.16.3/third_party/heimdal/cf/make-proto.pl line 7.

Waf: Leaving directory `/root/samba-4.16.3/bin/default'
Build failed
 -> task in '../heimdal/lib/asn1/der-protos.h' failed with exit status 2 (run with -v to display more information)
make: *** [Makefile:7: all] エラー 1
PYTHONHASHSEED=1 WAF_MAKE=1  ./buildtools/bin/waf install
Waf: Entering directory `/root/samba-4.16.3/bin/default'
        Selected embedded Heimdal build
Checking project rules ...
Project rules pass
[1/1] Compiling VERSION
+ install /usr/local/samba/lib/pkgconfig/samba-hostconfig.pc (from bin/default/lib/param/samba-hostconfig.pc)
+ install /usr/local/samba/lib/pkgconfig/dcerpc_samr.pc (from bin/default/source4/librpc/dcerpc_samr.pc)
+ install /usr/local/samba/lib/pkgconfig/dcerpc.pc (from bin/default/source4/librpc/dcerpc.pc)
+ install /usr/local/samba/lib/pkgconfig/samdb.pc (from bin/default/source4/dsdb/samdb.pc)
+ install /usr/local/samba/lib/pkgconfig/samba-credentials.pc (from bin/default/auth/credentials/samba-credentials.pc)
+ install /usr/local/samba/lib/pkgconfig/wbclient.pc (from bin/default/nsswitch/libwbclient/wbclient.pc)
+ install /usr/local/samba/lib/pkgconfig/samba-util.pc (from bin/default/lib/util/samba-util.pc)
+ install /usr/local/samba/lib/pkgconfig/dcerpc_server.pc (from bin/default/source4/rpc_server/dcerpc_server.pc)
+ install /usr/local/samba/lib/pkgconfig/ndr_krb5pac.pc (from bin/default/librpc/ndr_krb5pac.pc)
+ install /usr/local/samba/lib/pkgconfig/ndr_standard.pc (from bin/default/librpc/ndr_standard.pc)
+ install /usr/local/samba/lib/pkgconfig/ndr_nbt.pc (from bin/default/librpc/ndr_nbt.pc)
+ install /usr/local/samba/lib/pkgconfig/ndr.pc (from bin/default/librpc/ndr.pc)
+ install /usr/local/samba/lib/pkgconfig/samba-policy.cpython-36m-x86_64-linux-gnu.pc (from bin/default/source4/lib/policy/samba-policy.cpython-36m-x86_64-linux-gnu.pc)
+ install /usr/local/samba/sbin/samba_downgrade_db (from bin/default/source4/scripting/bin/samba_downgrade_db.inst)
+ install /usr/local/samba/sbin/samba_dnsupdate (from bin/default/source4/scripting/bin/samba_dnsupdate.inst)
+ install /usr/local/samba/sbin/samba_spnupdate (from bin/default/source4/scripting/bin/samba_spnupdate.inst)
+ install /usr/local/samba/sbin/samba_upgradedns (from bin/default/source4/scripting/bin/samba_upgradedns.inst)
+ install /usr/local/samba/sbin/samba_kcc (from bin/default/source4/scripting/bin/samba_kcc.inst)
+ install /usr/local/samba/sbin/samba-gpupdate (from bin/default/source4/scripting/bin/samba-gpupdate.inst)
+ install /usr/local/samba/bin/samba-tool (from bin/default/source4/scripting/bin/samba-tool.inst)
+ install /usr/local/samba/lib/pkgconfig/netapi.pc (from bin/default/source3/libnet/netapi.pc)
+ install /usr/local/samba/lib/pkgconfig/smbclient.pc (from bin/default/source3/libsmb/smbclient.pc)
[306/306] Linking bin/default/third_party/heimdal_build/compile_et.inst
[317/322] Processing ../heimdal/lib/asn1/der-protos.h: third_party/heimdal/lib/asn1/der_get.c third_party/heimdal/lib/asn1/der_put.c third_party/heimdal/lib/asn1/der_free.c third_party/heimdal/lib/asn1/der_format.c third_party/heimdal/lib/asn1/der_length.c third_party/heimdal/lib/asn1/der_copy.c third_party/heimdal/lib/asn1/der_cmp.c third_party/heimdal/lib/asn1/der_print.c third_party/heimdal/lib/asn1/extra.c third_party/heimdal/lib/asn1/timegm.c third_party/heimdal/lib/asn1/template.c third_party/heimdal/lib/asn1/oid_resolution.c -> bin/default/third_party/heimdal/lib/asn1/der-protos.h
Can't locate JSON.pm in @INC (you may need to install the JSON module) (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /root/samba-4.16.3/third_party/heimdal/cf/make-proto.pl line 7.
BEGIN failed--compilation aborted at /root/samba-4.16.3/third_party/heimdal/cf/make-proto.pl line 7.

Waf: Leaving directory `/root/samba-4.16.3/bin/default'
Build failed
 -> task in '../heimdal/lib/asn1/der-protos.h' failed with exit status 2 (run with -v to display more information)
make: *** [Makefile:10: install] エラー 1
#

「dnf install perl-JSON」で対処

# dnf install perl-JSON
メタデータの期限切れの最終確認: 0:24:56 時間前の 2022年07月19日 09時59分33秒 に 実施しました。
依存関係が解決しました。
================================================================================
 パッケージ      Arch         バージョン              リポジトリー        サイズ
================================================================================
インストール:
 perl-JSON       noarch       2.97.001-2.el8          ol8_appstream        96 k

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

ダウンロードサイズの合計: 96 k
インストール後のサイズ: 245 k
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
perl-JSON-2.97.001-2.el8.noarch.rpm              70 kB/s |  96 kB     00:01
--------------------------------------------------------------------------------
合計                                             70 kB/s |  96 kB     00:01
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備             :                                                        1/1
  インストール中   : perl-JSON-2.97.001-2.el8.noarch                        1/1
  scriptletの実行中: perl-JSON-2.97.001-2.el8.noarch                        1/1
  検証             : perl-JSON-2.97.001-2.el8.noarch                        1/1

インストール済み:
  perl-JSON-2.97.001-2.el8.noarch

完了しました!
#

以上でsamba-4.16.3のコンパイルが正常に終了した。