ONTAPで未接続のイーサポートを無効化する手法

NetApp ONTAPのWeb管理画面 ONTAP System Managerは、未使用でネットワークケーブルを接続していないポートがあると、オフラインになってるポートがあるよ、的な警告を表示する。

System Managerからだと簡単にネットワークポートの無効化が設定できる

無効化したいポートを選択して、「無効化」

続行します。

選択したポートのグラフィックが灰色に変化します。

さて、この操作、コマンドで行うにはどうすればいいのか?

まず、状況については「network port show」で確認出来ます。

fas8300::> network port show

Node: fas8300-01
                                                  Speed(Mbps) Health
Port      IPspace      Broadcast Domain Link MTU  Admin/Oper  Status
--------- ------------ ---------------- ---- ---- ----------- --------
a0a       Default      -                up   9000     -/-     healthy
a0a-1000  Default      Storage          up   9000     -/-     healthy
e0M       Default      Default          up   1500  auto/1000  healthy
e0c       Cluster      Cluster          up   9000 100000/100000 healthy
e0d       Cluster      Cluster          up   9000 100000/100000 healthy
e0e       Default      -                up   9000  auto/25000 healthy
e0f       Default      -                up   9000  auto/25000 healthy
e0g       Default      -                up   9000  auto/25000 healthy
e0h       Default      -                down 9000  auto/-     -

Node: fas8300-02
                                                  Speed(Mbps) Health
Port      IPspace      Broadcast Domain Link MTU  Admin/Oper  Status
--------- ------------ ---------------- ---- ---- ----------- --------
a0a       Default      -                up   9000     -/-     healthy
a0a-1000  Default      Storage          up   9000     -/-     healthy
e0M       Default      Default          up   1500  auto/1000  healthy
e0c       Cluster      Cluster          up   9000  auto/100000 healthy
e0d       Cluster      Cluster          up   9000  auto/100000 healthy
e0e       Default      -                up   9000  auto/25000 healthy
e0f       Default      -                up   9000  auto/25000 healthy
e0g       Default      -                up   9000  auto/25000 healthy
e0h       Default      -                up   9000  auto/25000 healthy
18 entries were displayed.

fas8300::>

しかし、network port modifyで指定できるオプションには、link up/downに関する設定がなさそう・・・

fas8300::> network port modify -node fas8300-01 -port e0h -?
  [ -mtu <integer> ]                                            MTU
  [ -autonegotiate-admin {true|false} ]                         Auto-Negotiation Administrative
  [ -duplex-admin {auto|half|full} ]                            Duplex Mode Administrative
  [ -speed-admin {auto|10|100|1000|10000|100000|40000|25000} ]  Speed Administrative
  [ -flowcontrol-admin {none|receive|send|full} ]               Flow Control Administrative
  [ -ipspace <IPspace> ]                                        IPspace Name

fas8300::>

マニュアルの「network port modify」を確認してみると下記の記述がある。

[-up-admin {true|false}] – Up Administrative (privilege: advanced)
The administrative state of the port. If set to true, the port is used if it is operational. If set to false, the port is configured down.

標準の管理CLIではなく、advanced以上の権限であれば実行できる、とのこと。

fas8300::> set advanced

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

fas8300::*>

advancedモードに切り替えてから、再度オプション一覧を確認

fas8300::*> network port modify -node fas8300-01 -port e0h -?
  [ -mtu <integer> ]                                            MTU
  [ -autonegotiate-admin {true|false} ]                         Auto-Negotiation Administrative
  [ -duplex-admin {auto|half|full} ]                            Duplex Mode Administrative
  [ -speed-admin {auto|10|100|1000|10000|100000|40000|25000} ]  Speed Administrative
  [ -flowcontrol-admin {none|receive|send|full} ]               Flow Control Administrative
  [ -up-admin {true|false} ]                                    *Up Administrative
  [ -ipspace <IPspace> ]                                        IPspace Name
  [ -ignore-health-status {true|false} ]                        *Ignore Port Health Status

fas8300::*>

設定出来る項目に現れました。

fas8300::*> network port modify -node fas8300-01 -port e0h -up-admin true

fas8300::*>

設定が反映されたかを確認します

fas8300::*> network port show

Node: fas8300-01
                                                                       Ignore
                                                  Speed(Mbps) Health   Health
Port      IPspace      Broadcast Domain Link MTU  Admin/Oper  Status   Status
--------- ------------ ---------------- ---- ---- ----------- -------- ------
a0a       Default      -                up   9000     -/-     healthy  false
a0a-1000  Default      Storage          up   9000     -/-     healthy  false
e0M       Default      Default          up   1500  auto/1000  healthy  false
e0c       Cluster      Cluster          up   9000 100000/100000 healthy false
e0d       Cluster      Cluster          up   9000 100000/100000 healthy false
e0e       Default      -                up   9000  auto/25000 healthy  false
e0f       Default      -                up   9000  auto/25000 healthy  false
e0g       Default      -                up   9000  auto/25000 healthy  false
e0h       Default      -                up   9000  auto/25000 healthy  false

Node: fas8300-02
                                                                       Ignore
                                                  Speed(Mbps) Health   Health
Port      IPspace      Broadcast Domain Link MTU  Admin/Oper  Status   Status
--------- ------------ ---------------- ---- ---- ----------- -------- ------
a0a       Default      -                up   9000     -/-     healthy  false
a0a-1000  Default      Storage          up   9000     -/-     healthy  false
e0M       Default      Default          up   1500  auto/1000  healthy  false
e0c       Cluster      Cluster          up   9000  auto/100000 healthy false
e0d       Cluster      Cluster          up   9000  auto/100000 healthy false
e0e       Default      -                up   9000  auto/25000 healthy  false
e0f       Default      -                up   9000  auto/25000 healthy  false
e0g       Default      -                up   9000  auto/25000 healthy  false
e0h       Default      -                up   9000  auto/25000 healthy  false
18 entries were displayed.

fas8300::*>

全てのポートがupになりました。

System Managerの方でも表示がupに戻ったかを確認できました。

Web GUIだと簡単に設定変更できるものが、コマンドだとadvanced権限必要だった、というのは驚きでした。

NetAppで電源電圧を確認する方法

NetAppを稼働させていたら電源電圧の警告が出ていたので、その確認手法を調べた。

ONTAP OS側からだと「system node environment sensors show」で現在値のみが確認出来た。

ただ、上記だと各部センサーの情報が全て含まれてしまうので、電源電圧だけを見るのであれば「system node environment sensors show -name *VIN*」と指定することで入力電圧のみを見ることが出来る。

fas8300::> system node environment sensors show -name *VIN*
Node Sensor                 State Value/Units Crit-Low Warn-Low Warn-Hi Crit-Hi
---- --------------------- ------ ----------- -------- -------- ------- -------
fas8300-01
     PSU1 VIN              normal
                                    99840 mV     90480    93600  261040  263120
     PSU2 VIN              normal
                                    94640 mV     90480    93600  261040  263120
fas8300-02
     PSU1 VIN              normal
                                    99840 mV     90480    93600  261040  263120
     PSU2 VIN              normal
                                    94640 mV     90480    93600  261040  263120
4 entries were displayed.

fas8300::>

「Value/Units」が現在値で、それ以外が注意/警告を発令する電圧設定となる。

これまでに電源電圧警報が発令された時に何Vだったのかを確認するには、Service Processor/BMC側にログインして調べる必要があった。

「system log sel」で表示されるIPMIログを見て確認する。

BMC fas8300-01> system log sel
   1 | 11/09/2021 | 09:38:39 | System Firmware Progress | Secondary CPU Initialization | Asserted
   2 | 11/09/2021 | 09:38:39 | System Firmware Progress | USB resource configuration | Asserted
   3 | 11/09/2021 | 09:38:41 | System Firmware Progress | PCI resource configuration | Asserted
   4 | 11/09/2021 | 09:38:41 | System Firmware Progress | Video initialization | Asserted
   5 | 11/09/2021 | 09:38:41 | System Firmware Progress | Keyboard controller initialization | Asserted
   6 | 11/09/2021 | 09:38:42 | System Firmware Progress | Hard-disk initialization | Asserted
   7 | 11/09/2021 | 09:38:50 | System Firmware Progress | Hard-disk initialization | Asserted
   8 | 11/09/2021 | 09:39:01 | System Event |  | Asserted
   9 | 11/09/2021 | 09:39:20 | Voltage #0x50 | Lower Non-critical going low
   a | 11/09/2021 | 09:39:24 | Voltage #0x5a | Lower Non-critical going low
   b | 11/09/2021 | 09:40:29 | Voltage #0x50 | Lower Non-critical going low
   c | 11/09/2021 | 09:40:29 | Voltage #0x5a | Lower Non-critical going low
   d | 11/09/2021 | 09:41:02 | System Event #0xff | Timestamp Clock Sync | Asserted
   e | 11/09/2021 | 09:41:02 | System Event #0xff | Timestamp Clock Sync | Asserted
   f | 11/09/2021 | 10:41:48 | Voltage #0x50 | Lower Non-critical going low
<略>
 b97 | 11/30/2021 | 23:45:25 | Voltage #0x5a | Lower Non-critical going low
 b98 | 11/30/2021 | 23:46:33 | Voltage #0x5a | Lower Non-critical going low
 b99 | 11/30/2021 | 23:46:46 | Voltage #0x5a | Lower Non-critical going low

BMC fas8300-01>

上記の「Voltage #0x50 | Lower Non-critical going low」というのが16進数表記の電圧となる。

0x50=80V、0x5a=90Vとなる。

さすがにAC 80Vは低すぎでしょ!!というわけで、電源経路確認が実施されましたとさ

ADAPTEX R90を使って他社用コントローラでPS4を動かす

PS4 Proを使って原神をやっているのだが、1年もやっているとDualshockの動作が怪しくなってきた。

そこで新しいコントローラを探してみたのだが、PS4用とうたって販売しているやつが怪しいものばかりなのに嫌気がさした。

1年前にPS5風のPS4コントローラなんてものを買ってみたりもしたのだが、1ヶ月ぐらいでボタンがおかしくなり使用不可に。それを考えると似たような価格帯のPS4用は期待できないな、というのもあった。

さて、そんな探している中で、BIGBIG WON RAINBOWという商品を発見した。

説明書きを読むと別売りの変換アダプター ADAPEX R90とセットにするとPS4でも使えるとのこと

なお、このメーカでは他にBluetooth接続の変換アダプターADAPEX R100ADAPTEX R100 Proというのも扱っている。

有線のR90にするか、無線のR100/R100 Proにするか悩んだのだが、無線だと他の機種につなげるつなげなおす時にペアリングをやりなおさないとならないのが面倒だなぁ、というのがあったので、今回はR90とRAINBOWコントローラをセットで購入してみた。

大阪の倉庫から1日で東京までお届け完了

中身はこんな感じでした。

長いmicroUSBケーブルが添付されていました。

さて、PS4に繋いで見ます。

PS4上のボタン動作は、純正DualShockのボタン配置に相当する場所にあるものがその動作をする、という感じでした。

ちなみに初期設定ではこんな感じで光ります。

光り方は背面中央にある「Fn」ボタンを2連続で押すとモードが変更され、何回かモード変更すると消灯モードに切り替わります。

しばらく原神で遊んで見ましたが、ちょっと重く感じる、というのと、コントローラにオーディオ出力っぽい端子があるけど動かない、という点以外は特に問題無く使用できています。

背面にあるマクロ登録可能なボタンについてはまだ使って見ていません。

さて、変換アダプターADAPTEX R90の対応表を見ると任天堂スイッチのProコンがサポート対象に入っています。

そんなわけで、PS4 ProにR90経由でProコンを接続してみました。

こちらもトクに問題なく動作していました。

ホームボタンはPSボタンとして動作していました。

なお、任天堂純正ではないスイッチ用コントローラやWindows汎用コントローラをつなげてみましたが、それらは無反応でした。

R90 firmwareのバージョンアップとかできないのかなぁ?

RAINBOWコントローラ自体はBluetooth接続が可能です。

専用アプリBIGBIG WONからfirmwareアップデートや光り方の制御が行えます。

Bluetooth接続するとアプリ内に「Rainbow」コントローラが登録されます。

「新築配置」から設定可能です。

まずは光り方の制御設定

ボタン感度や振動の強さ制御

また、ゲーム内設定でアナログジョイスティックの操作反転ができない場合にコントローラ側で対応できるような設定もあります。

また、firmwareアップデートに関する項目もあります。

今回届いたRAINBOWコントローラのfirmwareは4257のようです。

過去のバージョン一覧を見てみると2021/11/15付け3843から2週間で4257ってめっちゃバージョンアップしすぎでは?

まあ、更新をしっかりやってくれそうなのは安心な点ですね。

さて、しばらく使って見ますかね

Ubuntu 20.04でインストールされるdrbdは8.4なのか9.11なのか?

Ubuntu 20.04でdrbdを使おうとしたら、drbd-utilsのバージョンは9.11.0だが、drbd自体は8.4.11 といういまいちわけがわからない状態になっていた。

2022/04/22追記:Ubuntu 22.04 LTSでも状況はほぼ同じだった。詳しくは最後尾
2023/02/20: 本文を現状にあわせて若干修正

どういうことなのか調査してみた。

なお、drbd 8.4.11として使った場合にいくつか問題点があったが、それについては別記事「Ubuntu 20.04で標準のdrbd 8.4.11を使う場合の注意点」に記載している。


ubuntuのサイトに掲載されている「Ubuntu HA – DRBD」ではバージョンに関する話は特に書いておらず「sudo apt install drbd-utils」だけでインストールは完了し、あとは/etc/drbd.confの編集、という手順になっている。

次にdrbdの開発元であるlinbitが公開している「drbd 8ドキュメント」と「drbd 9ドキュメント」を見るとそれぞれ手順が異なっている。

drbd8では標準レポジトリだけでインストールできる、という趣旨だったものが、drbd9では明示的にPPAレポジトリを使え、と変更されている。

とりあえずは「apt install drbd-utils」でインストールかな?と実行してみると普通に実行できる。

$ sudo -i
# apt install drbd-utils
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  guile-2.2-libs libgc1c2 libgsasl7 libidn11 libkyotocabinet16v5 libmailutils6
  libmysqlclient21 libntlm0 mailutils mailutils-common mysql-common postfix
  ssl-cert
Suggested packages:
  heartbeat mailutils-mh mailutils-doc procmail postfix-mysql postfix-pgsql
  postfix-ldap postfix-pcre postfix-lmdb postfix-sqlite sasl2-bin
  | dovecot-common resolvconf postfix-cdb postfix-doc openssl-blacklist
The following NEW packages will be installed:
  drbd-utils guile-2.2-libs libgc1c2 libgsasl7 libidn11 libkyotocabinet16v5
  libmailutils6 libmysqlclient21 libntlm0 mailutils mailutils-common
  mysql-common postfix ssl-cert
0 upgraded, 14 newly installed, 0 to remove and 0 not upgraded.
Need to get 9,579 kB of archives.
After this operation, 66.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
<略>

postfixとdovecotもインストールされるため下記のダイアログも開くので注意が必要。

インストール後、パッケージを調べて見ると、drbd-utilsは9.11.0だけど、drbd-docは8.4というちぐはぐな状態であることに気がつく。

root@ubuntu143:~# apt search drbd
Sorting... Done
Full Text Search... Done
collectd-core/focal 5.9.2.g-1ubuntu5 amd64
  statistics collection and monitoring daemon (core system)

drbd-doc/focal 8.4~20151102-1 all
  RAID 1 over TCP/IP for Linux (user documentation)

drbd-utils/focal,now 9.11.0-1build1 amd64 [installed]
  RAID 1 over TCP/IP for Linux (user utilities)

nagios-plugins-contrib/focal 25.20191015+1ubuntu1 amd64
  Plugins for nagios compatible monitoring systems

prometheus-hacluster-exporter/focal 0.4.0-2 amd64
  Prometheus exporter for HA cluster services

root@ubuntu143:~#

動作させてみると /proc/drbd が返すバージョンは 「version: 8.4.11 (api:1/proto:86-101)」だった。

root@ubuntu143:~# cat /proc/drbd
version: 8.4.11 (api:1/proto:86-101)
srcversion: FC3433D849E3B88C1E7B55C
 0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-----
    ns:6276 nr:0 dw:42864576 dr:5041 al:328 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0
root@ubuntu143:~#

drbdは9.0からauto promoteという機能が追加されたので、それを使いたい場合に、8.4だと困る、ということになる。

このauto promoteは、両ノードが再起動した際に最初にdrbdデバイスにアクセスしてきたノードを自動的にprimaryに設定してくれる、という機能である。(8.xまでは両方ともSecondaryのままで、手動でprimaryに設定する必要があった)

というわけで、drbd9を使いたい場合は、PPAレポジトリを追加してlinbitが提供するdrbd9をインストールする必要がある。

ドキュメントに書かれているPPAレポジトリ情報は誤りがあり、正しくは「https://launchpad.net/~linbit/+archive/ubuntu/linbit-drbd9-stack」だった。

ここにあるように「add-apt-repository ppa:linbit/linbit-drbd9-stack」を実行してPPAレポジトリを追加する。

root@ubuntu143:~# add-apt-repository ppa:linbit/linbit-drbd9-stack
 This PPA contains DRBD9, drbd-utils, LINSTOR (client, python API, server).

This differs from official, production grade LINBIT repositories in several ways, including:
- We push RCs immediately to the PPA
- We don't push hotfixes, these usually have to wait until the next RC/release
- We only keep 2 LTS versions up to date (Bionic and Focal, but not Xenial)

For support and access to official repositories see:
https://www.linbit.com or write an email to: sales AT linbit.com
 More info: https://launchpad.net/~linbit/+archive/ubuntu/linbit-drbd9-stack
Press [ENTER] to continue or Ctrl-c to cancel adding it.

Hit:1 http://jp.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://jp.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://jp.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Get:4 http://jp.archive.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:5 http://ppa.launchpad.net/linbit/linbit-drbd9-stack/ubuntu focal InRelease [24.4 kB]
Get:6 http://ppa.launchpad.net/linbit/linbit-drbd9-stack/ubuntu focal/main amd64 Packages [2,344 B]
Get:7 http://ppa.launchpad.net/linbit/linbit-drbd9-stack/ubuntu focal/main Translation-en [1,308 B]
Fetched 356 kB in 3s (137 kB/s)
Reading package lists... Done
root@ubuntu143:~#

で・・・linbit提供のdrbdはdkmsモジュールとして提供されるため「apt install drbd-utils drbd-dkms」を実行してインストールすることになる。

今回のテスト環境ではdrbd8が既にインストールされていたので、最初に「apt update;apt upgrade」を実行してapt-utilsのバージョンアップを行った。

root@ubuntu143:~# apt update
Hit:1 http://jp.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://jp.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://jp.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Get:4 http://jp.archive.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:5 http://ppa.launchpad.net/linbit/linbit-drbd9-stack/ubuntu focal InRelease
Fetched 328 kB in 1s (538 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.
root@ubuntu143:~# apt list --upgradable
Listing... Done
drbd-utils/focal 9.19.1-1ppa1~focal1 amd64 [upgradable from: 9.11.0-1build1]
N: There is 1 additional version. Please use the '-a' switch to see it
root@ubuntu143:~# apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  drbd-utils
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 720 kB of archives.
After this operation, 75.8 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ppa.launchpad.net/linbit/linbit-drbd9-stack/ubuntu focal/main amd64 drbd-utils amd64 9.19.1-1ppa1~focal1 [720 kB]
Fetched 720 kB in 3s (214 kB/s)
Preconfiguring packages ...
(Reading database ... 72754 files and directories currently installed.)
Preparing to unpack .../drbd-utils_9.19.1-1ppa1~focal1_amd64.deb ...
Unpacking drbd-utils (9.19.1-1ppa1~focal1) over (9.11.0-1build1) ...
Setting up drbd-utils (9.19.1-1ppa1~focal1) ...

Configuration file '/etc/drbd.d/global_common.conf'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** global_common.conf (Y/I/N/O/D/Z) [default=N] ? y
Installing new version of config file /etc/drbd.d/global_common.conf ...
Installing new version of config file /etc/init.d/drbd ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3.13) ...
root@ubuntu143:~#

次に、「apt install drbd-dkms」でdrbd本体をインストールした。

root@ubuntu143:~# apt install drbd-dkms
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  autoconf automake autopoint autotools-dev binutils binutils-common
  binutils-x86-64-linux-gnu build-essential cpp cpp-9 dctrl-tools debhelper
  dh-autoreconf dh-strip-nondeterminism dkms dpkg-dev dwz fakeroot g++ g++-9
  gcc gcc-9 gcc-9-base gettext intltool-debian libalgorithm-diff-perl
  libalgorithm-diff-xs-perl libalgorithm-merge-perl libarchive-cpio-perl
  libarchive-zip-perl libasan5 libatomic1 libbinutils libc-dev-bin libc6-dev
  libcc1-0 libcroco3 libcrypt-dev libctf-nobfd0 libctf0 libdebhelper-perl
  libdpkg-perl libfakeroot libfile-fcntllock-perl
  libfile-stripnondeterminism-perl libgcc-9-dev libgomp1 libisl22 libitm1
  liblsan0 libltdl-dev libmail-sendmail-perl libmpc3 libquadmath0
  libstdc++-9-dev libsub-override-perl libsys-hostname-long-perl libtool
  libtsan0 libubsan1 linux-libc-dev m4 make manpages-dev po-debconf
Suggested packages:
  autoconf-archive gnu-standards autoconf-doc binutils-doc cpp-doc
  gcc-9-locales debtags dh-make menu debian-keyring g++-multilib
  g++-9-multilib gcc-9-doc gcc-multilib flex bison gdb gcc-doc gcc-9-multilib
  gettext-doc libasprintf-dev libgettextpo-dev glibc-doc bzr libtool-doc
  libstdc++-9-doc gfortran | fortran95-compiler gcj-jdk m4-doc make-doc
  libmail-box-perl
The following NEW packages will be installed:
  autoconf automake autopoint autotools-dev binutils binutils-common
  binutils-x86-64-linux-gnu build-essential cpp cpp-9 dctrl-tools debhelper
  dh-autoreconf dh-strip-nondeterminism dkms dpkg-dev drbd-dkms dwz fakeroot
  g++ g++-9 gcc gcc-9 gcc-9-base gettext intltool-debian
  libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl
  libarchive-cpio-perl libarchive-zip-perl libasan5 libatomic1 libbinutils
  libc-dev-bin libc6-dev libcc1-0 libcroco3 libcrypt-dev libctf-nobfd0 libctf0
  libdebhelper-perl libdpkg-perl libfakeroot libfile-fcntllock-perl
  libfile-stripnondeterminism-perl libgcc-9-dev libgomp1 libisl22 libitm1
  liblsan0 libltdl-dev libmail-sendmail-perl libmpc3 libquadmath0
  libstdc++-9-dev libsub-override-perl libsys-hostname-long-perl libtool
  libtsan0 libubsan1 linux-libc-dev m4 make manpages-dev po-debconf
0 upgraded, 66 newly installed, 0 to remove and 0 not upgraded.
Need to get 47.8 MB of archives.
After this operation, 208 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
<略>
drbd.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.4.0-90-generic/updates/dkms/

drbd_transport_tcp.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.4.0-90-generic/updates/dkms/

depmod..........

DKMS: install completed.
Processing triggers for install-info (6.7.0.dfsg.2-5) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Processing triggers for man-db (2.9.1-1) ...
root@ubuntu143:~#

これで再起動

すると下記の様にdrbdのバージョンが「version: 9.1.4 (api:2/proto:110-121)」となった。

root@ubuntu143:~# cat /proc/drbd
version: 9.1.4 (api:2/proto:110-121)
GIT-hash: e4de25c3a65811b0fa4733b1c2a000ee322f5cfa build by root@ubuntu143, 2021-11-24 07:10:11
Transports (api:17): tcp (9.1.4)
root@ubuntu143:~#

この状態でdrbd関連パッケージの状態を確認する下記の様になっていた。

root@ubuntu143:~# apt search drbd
Sorting... Done
Full Text Search... Done
collectd-core/focal 5.9.2.g-1ubuntu5 amd64
  statistics collection and monitoring daemon (core system)

drbd-dkms/focal,now 9.1.4-1ppa1~focal1 all [installed]
  RAID 1 over TCP/IP for Linux module source

drbd-doc/focal 8.4~20151102-1 all
  RAID 1 over TCP/IP for Linux (user documentation)

drbd-module-source/focal 9.1.4-1ppa1~focal1 all
  RAID 1 over TCP/IP for Linux module source

drbd-reactor/focal 0.5.0-1ppa1~focal1 amd64
  Monitors DRBD resources via plugins.

drbd-utils/focal,now 9.19.1-1ppa1~focal1 amd64 [installed]
  RAID 1 over TCP/IP for Linux (user utilities)

drbd8-utils/focal 2:9.19.1-1ppa1~focal1 amd64
  transitional dummy package

linstor-common/focal 1.16.0-1ppa1~focal1 all
  DRBD distributed resource management utility

linstor-controller/focal 1.16.0-1ppa1~focal1 all
  DRBD distributed resource management utility

linstor-satellite/focal 1.16.0-1ppa1~focal1 all
  DRBD distributed resource management utility

nagios-plugins-contrib/focal 25.20191015+1ubuntu1 amd64
  Plugins for nagios compatible monitoring systems

prometheus-hacluster-exporter/focal 0.4.0-2 amd64
  Prometheus exporter for HA cluster services

root@ubuntu143:~#

2022/04/22追記

Ubuntu 22.04 LTSが出たので状況を確認してみた。

user$ apt search drbd
Sorting... Done
Full Text Search... Done
drbd-doc/jammy 8.4~20220106-1 all
  RAID 1 over TCP/IP for Linux (user documentation)

drbd-utils/jammy 9.15.0-1build2 amd64
  RAID 1 over TCP/IP for Linux (user utilities)

monitoring-plugins-contrib/jammy 37.20211217ubuntu1 amd64
  Plugins for nagios compatible monitoring systems

prometheus-hacluster-exporter/jammy 1.2.3-2 amd64
  Prometheus exporter for HA cluster services

user@ubuntu2204:~$ modinfo drbd
filename:       /lib/modules/5.15.0-25-generic/kernel/drivers/block/drbd/drbd.ko
alias:          block-major-147-*
license:        GPL
version:        8.4.11
description:    drbd - Distributed Replicated Block Device v8.4.11
author:         Philipp Reisner <phil@linbit.com>, Lars Ellenberg <lars@linbit.com>
srcversion:     C369F58AE19642816B00C81
depends:        lru_cache,libcrc32c
retpoline:      Y
intree:         Y
name:           drbd
vermagic:       5.15.0-25-generic SMP mod_unload modversions
sig_id:         PKCS#7
signer:         Build time autogenerated kernel key
sig_key:        43:DE:0B:33:F7:CF:5A:CE:F6:19:E2:2A:DD:DD:1D:BD:4D:ED:8E:ED
sig_hashalgo:   sha512
signature:      72:7A:0C:A3:E5:31:68:E8:FC:55:61:6F:FF:E1:11:B1:90:9F:8D:DF:
                29:E0:16:9D:C5:6D:0A:D4:A6:48:88:87:E0:5B:46:73:96:24:8A:1D:
                51:1E:39:4B:A4:20:65:42:2F:A7:2B:6A:ED:AE:8B:4E:FD:0F:E5:94:
                7C:03:0D:53:1F:21:C4:09:AF:7A:91:32:23:0E:E2:3A:32:79:FF:0B:
                36:E7:BC:7A:5E:72:A0:6E:05:2C:04:B6:4B:01:77:65:5A:43:EA:AB:
                F0:BE:B0:97:2E:65:81:7B:90:67:76:E5:64:2D:EF:8A:9A:3F:21:DD:
                CF:A6:C8:3B:87:4D:C1:1C:6C:F8:AD:F2:01:C2:DC:BD:CA:3F:85:4C:
                A8:A6:B3:C5:83:C8:13:76:31:77:51:8C:37:3D:D4:77:00:29:8F:BE:
                1A:E3:C4:1F:EE:96:1E:24:24:9A:77:BE:F4:7C:40:4D:BD:34:83:69:
                8D:0C:E6:DA:FC:F0:65:74:52:86:EA:8F:26:2B:71:5B:BB:79:73:0C:
                26:D1:66:4D:FC:71:B2:E4:B3:0B:4D:85:EC:CF:98:CB:E6:83:C6:79:
                28:F1:BF:23:CC:30:68:0E:F4:50:85:04:D1:AF:87:31:E0:4E:A5:1D:
                5B:F7:6F:18:34:17:E9:8D:84:6C:B5:2C:9F:6F:38:DA:4D:9D:4B:3F:
                38:6D:38:5E:02:56:23:DB:B3:F4:06:6E:EE:52:F1:09:62:59:1A:BA:
                57:1E:E7:10:0F:61:E1:86:5C:3E:ED:67:D6:AF:9F:CE:69:F3:38:D4:
                EA:91:30:72:7F:B3:02:08:82:0F:C4:4B:8C:85:86:6E:4A:9F:E3:51:
                78:A7:4D:C2:E1:E2:7D:20:F5:42:F6:A7:6F:76:76:04:B9:93:E7:99:
                53:9A:3F:6D:61:AA:31:B2:04:59:BE:E4:16:E3:8C:4E:D0:58:0A:FE:
                FF:1C:79:D6:5E:72:72:3D:A0:41:47:DC:04:8C:04:04:C6:E7:6A:55:
                5A:E7:FC:B1:C5:B5:CD:C3:D3:03:3A:B8:3E:C1:24:87:93:DD:34:1A:
                4B:97:3B:61:7C:CB:E9:34:90:C2:C5:C5:2A:79:74:D1:49:E6:50:A1:
                9F:35:AA:14:38:1B:0F:01:27:4E:44:F5:0F:7C:28:41:77:0A:AB:A9:
                0A:43:0C:CB:69:27:B8:E4:CA:FA:E9:01:12:A3:57:D2:7B:9F:9F:8E:
                4D:A1:F9:5B:12:AD:F8:87:FA:49:F2:E3:72:D4:2A:A4:6F:EF:C7:13:
                2D:96:BF:E9:7C:3F:63:5B:60:C7:33:7B:5C:FA:9A:3A:66:83:41:63:
                B6:67:18:DC:D4:5F:D6:4B:5F:DA:F2:74
parm:           allow_oos:DONT USE! (bool)
parm:           disable_sendpage:bool
parm:           proc_details:int
parm:           minor_count:Approximate number of drbd devices (1-255) (uint)
parm:           usermode_helper:string
user@ubuntu2204:$

drbd-utilsのバージョンが 9.15.0 にアップデートしているが、kernelに含まれているdrbd は8.4.11 のままとなっていた。

Oracle Linux 8でphp 7.4.19-1にアップデート後からphp-fpmが起動しなくなった

Oracle Cloud上にARMインスタンスをたててOracle Linux 8をインストールしてwordpressサーバの運用を開始した。

ところが今日の朝実行された dnf automaticによる自動更新後、wordpressが「Service Unavailable」となり表示出来ない。

sshログインして確認するとphp-fpmが起動していない。

[root@retoge ~]# systemctl status php-fpm|cat
● php-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2021-11-18 09:25:41 JST; 16s ago
  Process: 482320 ExecStart=/usr/sbin/php-fpm --nodaemonize (code=exited, status=127)
 Main PID: 482320 (code=exited, status=127)

Nov 18 09:25:41 retoge systemd[1]: Starting The PHP FastCGI Process Manager...
Nov 18 09:25:41 retoge php-fpm[482320]: /usr/sbin/php-fpm: error while loading shared libraries: cannot restore segment prot after reloc: Permission denied
Nov 18 09:25:41 retoge systemd[1]: php-fpm.service: Main process exited, code=exited, status=127/n/a
Nov 18 09:25:41 retoge systemd[1]: php-fpm.service: Failed with result 'exit-code'.
Nov 18 09:25:41 retoge systemd[1]: Failed to start The PHP FastCGI Process Manager.
[root@retoge ~]#

SELinuxの問題で起動していなさそうなので/var/log/audit/audit.log を確認してみると下記の出力があった。

type=AVC msg=audit(1637195141.234:5827): avc:  denied  { execmod } for  pid=482320 comm="php-fpm" path="/usr/sbin/php-fpm" dev="dm-0" ino=369761 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_exec_t:s0 tclass=file permissive=0

type=SERVICE_START msg=audit(1637195141.238:5828): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=php-fpm comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'^]UID="root" AUID="unset"

関連していそうなファイルのセキュリティコンテキストを確認

[root@retoge ~]# ls -lZ /usr/sbin/php-fpm
-rwxr-xr-x. 1 root root system_u:object_r:httpd_exec_t:s0 4656056 Oct 12 18:47 /usr/sbin/php-fpm
[root@retoge ~]# restorecon -R -v /usr/sbin
[root@retoge ~]# ls -lZ /usr/sbin/php-fpm
-rwxr-xr-x. 1 root root system_u:object_r:httpd_exec_t:s0 4656056 Oct 12 18:47 /usr/sbin/php-fpm
[root@retoge ~]# ls -lZ /usr/lib/systemd/systemd
-rwxr-xr-x. 1 root root system_u:object_r:init_exec_t:s0 1528680 Nov 11 09:41 /usr/lib/systemd/systemd
[root@retoge ~]# restorecon -R -v /usr/lib
[root@retoge ~]# ls -lZ /usr/lib/systemd/systemd
-rwxr-xr-x. 1 root root system_u:object_r:init_exec_t:s0 1528680 Nov 11 09:41 /usr/lib/systemd/systemd
[root@retoge ~]#

特に問題はなさそう?

ぐぐった時に出てきた「Bug 1670386 – AVC denied httpd_execmem for php-fpm when php-opcache is installed」が近いかな?と httpdのhttpd_execmemをonに変えてみたけど、これだけではダメな模様(後述のaudit2allowの結果を見ると、これ自体は必要そうでした)

[root@retoge ~]# getsebool httpd_execmem
httpd_execmem --> off
[root@retoge ~]# setsebool -P httpd_execmem on
[root@retoge ~]# getsebool httpd_execmem
httpd_execmem --> on
[root@retoge ~]# 
[root@retoge ~]# systemctl start php-fpm
Job for php-fpm.service failed because the control process exited with error code.
See "systemctl status php-fpm.service" and "journalctl -xe" for details.
[root@retoge ~]# systemctl restart httpd
[root@retoge ~]# systemctl start php-fpm
Job for php-fpm.service failed because the control process exited with error code.
See "systemctl status php-fpm.service" and "journalctl -xe" for details.
[root@retoge ~]#

今回はとりあえずphp-fpmが動けばいいか、ということで、問題となっているものを無視して起動できるようにしてしまうことにした。

まず、ausearchコマンドで関係するものをピックアップして、audit2allowで作成される予定のルールを確認する。

[root@retoge ~]# ausearch -m AVC |grep php| audit2allow


#============= httpd_t ==============

#!!!! This avc is allowed in the current policy
allow httpd_t http_port_t:tcp_socket name_connect;
allow httpd_t httpd_exec_t:file execmod;

#!!!! This avc can be allowed using the boolean 'httpd_unified'
allow httpd_t httpd_sys_content_t:dir write;

#!!!! This avc can be allowed using the boolean 'httpd_unified'
allow httpd_t httpd_sys_content_t:file write;
[root@retoge ~]#

これをモジュール化して組み込みます。

[root@retoge ~]# ausearch -m AVC |grep php| audit2allow -M php-fpm
******************** IMPORTANT ***********************
To make this policy package active, execute:

semodule -i php-fpm.pp

[root@retoge ~]# ls -l php-fpm*
-rw-r--r--. 1 root root 1594 Nov 18 09:51 php-fpm.pp
-rw-r--r--. 1 root root  597 Nov 18 09:51 php-fpm.te
[root@retoge ~]#

[root@retoge ~]# semodule -l |grep php
[root@retoge ~]# semodule -i php-fpm.pp
[root@retoge ~]# semodule -l |grep php
php-fpm
[root@retoge ~]#

php-fpmを起動してみます。

[root@retoge ~]# systemctl start php-fpm
[root@retoge ~]# systemctl status php-fpm
● php-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2021-11-18 09:53:45 JST; 5s ago
 Main PID: 489019 (php-fpm)
   Status: "Ready to handle connections"
    Tasks: 6 (limit: 36876)
   Memory: 24.1M
   CGroup: /system.slice/php-fpm.service
           tq489019 php-fpm: master process (/etc/php-fpm.conf)
           tq489020 php-fpm: pool www
           tq489021 php-fpm: pool www
           tq489022 php-fpm: pool www
           tq489023 php-fpm: pool www
           mq489024 php-fpm: pool www

Nov 18 09:53:45 retoge systemd[1]: Starting The PHP FastCGI Process Manager...
Nov 18 09:53:45 retoge systemd[1]: Started The PHP FastCGI Process Manager.
[root@retoge ~]#

正常に起動が成功し、wordpressの動作も正常となりました。


2022/01/20追記

放置していたサーバでも発生していたので対処したところ、httpd_execmem有効化とselinuxモジュール追加で動き出しました

[root@retoge ~]# getsebool httpd_execmem
httpd_execmem --> off
[root@retoge ~]# setsebool -P httpd_execmem on
[root@retoge ~]# getsebool httpd_execmem
httpd_execmem --> on
[root@retoge ~]# ausearch -m AVC |grep php |audit2allow


#============= httpd_t ==============
allow httpd_t httpd_exec_t:file execmod;
[root@retoge ~]# ausearch -m AVC |grep php |audit2allow -M php-fpm
******************** IMPORTANT ***********************
To make this policy package active, execute:

semodule -i php-fpm.pp
[root@retoge ~]# semodule -i php-fpm.pp
[root@retoge ~]# systemctl start php-fpm
[root@retoge ~]#