HPEサーバのSmart Storage Administratorで「After completing the configuration – reboot the system.」と表示された時の対処

Intelligent Provisioning 3.90 を久方ぶりにさわって戸惑ったのでメモ書き。

BIOS(UEFI)起動中にF10キーを押してIntelligent Provisioning(IP)を起動、メニューからSR Storage Administratorを選択してSmart Storage Administrator (SSA)を起動しました。
RAID設定をちょこちょこっと変更して終了(再起動)しようとしたところ下記メッセージに遭遇。

After completing the configuration – reboot the system.

変更が終わったら勝手に再起動してくれそうなメッセージですが、実は待っていても再起動してくれません・・・。対処としては、RAID構成が絶対書き込まれているだろう30分ぐらい放置して、電源リセットとなります。

普通のIPだと右上とかに [×] ボタンがあったりするんですが、SSAのメニューでは表示されないようです。バグっぽい気もしますが、最近はHPE MegaRAID MRコントローラーに移行していて MR Storage Administrator で管理する感じだから、このまんまですかね。

Office 展開ツールで「Couldn’t install – Error Code: 0-2054 (0)」が出た時の対処

Office 展開ツール (ODT)で凡ミスを行ったのでメモ書き。

Office 2021をインストールするためにOffice Deployment Toolをダウンロードしてsetup.exeに引数を渡して実行しました。そうするとエラーが発生。

Couldn’t install
The configuration file wasn’t specified.
Error Code: 0-2054 (0)

初めは混乱して、ネットワーク疎通を確認したり、ウイルス対策除外を行ったりいろいろしていましたが、普通にメッセージにエラー内容が書いてありました。
原因は 引数の設定もれ です・・・。残念。

実行しようとしたコマンドは
setup.exe PerpetualVL2021.xml
なんですが、正しくは下記でした。
setup.exe /configure PerpetualVL2021.xml

引数が漏れて実行していたという単純ミスです。もし私みたいに慌てて調べた方は、コマンドを再度ご確認ください。

Amazon Linux 2023でlogrotateが動作しない場合の原因と対処

普段Windowsしか知らない人間がLinuxを使ってみて躓いたので、その原因と対処を書いておきます。
ログローテーションの対象ログが、複数の設定ファイルで同じものが重複していると動作しません。

Linuxでは、ログファイルを毎日・毎週などで新しいファイルにして、ログ調査などを行いやすくすることが一般的です。そのやり方として、logrotateというデーモンで、指定したタイミングでログファイルを新しくしたり圧縮したりできます。

昔のLinuxでlogrotateは、cronで実行するものでしたが、最近はsystemdのタイマーで実行するようです。今回ローテーションさせるため、/etc/logrotate.d/rsyslogにローテーションさせたいファイルを書いて、1日放置してみたところ動作せずログがそのままでした。

タイマーが正しく動いていないのかと下記コマンドを実行。

$ sudo systemctl enable logrotate.timer

そのあとに有効なタイマーを確認するために下記を実行したところ、logrotatedがありませんでした。

$ sudo systemctl list-timers
NEXT LEFT LAST PASSED UNIT ACTIVATES
Mon 2025-02-17 10:06:28 JST 24s left Mon 2025-02-17 10:05:26 JST 38s ago refresh-policy-routes@enX0.timer refresh-policy-routes@enX0.service
Mon 2025-02-17 13:47:26 JST 3h 41min left Sun 2025-02-16 13:47:26 JST 20h ago systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
Mon 2025-02-17 20:10:44 JST 10h left Mon 2025-02-17 00:31:26 JST 9h ago update-motd.timer update-motd.service
Mon 2025-02-24 00:47:48 JST 6 days left Mon 2025-02-17 00:43:26 JST 9h ago fstrim.timer fstrim.service

4 timers listed.
Pass –all to see loaded but inactive timers, too.

ステータスを確認しても、Activeとなっていませんでした。

有効にならない理由が分からないため、logrotateの設定が正しいか検証コマンドを実行してみることに。

$ sudo logrotate -dv /etc/logrotate.conf
WARNING: logrotate in debug mode does nothing except printing debug messages! Consider using verbose mode (-v) instead if this is not what you want.

reading config file /etc/logrotate.conf
including /etc/logrotate.d
reading config file btmp
reading config file chrony
reading config file dnf
reading config file rsyslog
reading config file squid
error: squid:1 duplicate log entry for /var/log/squid/access.log
error: found error in file squid, skipping
reading config file wtmp
reading config file zabbix-agent
Reading state from file: /var/lib/logrotate/logrotate.status
Allocating hash table for state file, size 64 entries
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state

Handling 7 logs
(以下略)

そうすると、エラーとして「error: squid:1 duplicate log entry for /var/log/squid/access.log」が出ており、squidのログファイルを複数書いてしまっているのが原因でした。なんという凡ミス。

logrotateの設定ファイルを編集して、logrotateのstartとstatusをもう一度確認します。「Active: active」と表示されて正常に動作しました。

$ sudo systemctl start logrotate.timer
$ sudo systemctl status logrotate.timer
● logrotate.timer – Daily rotation of log files
Loaded: loaded (/usr/lib/systemd/system/logrotate.timer; enabled; preset: enabled)
Active: active (waiting) since Mon 2025-02-17 11:12:17 JST; 2s ago
Trigger: Tue 2025-02-18 00:00:00 JST; 12h left
Triggers: ● logrotate.service
Docs: man:logrotate(8)
man:logrotate.conf(5)

Feb 17 11:12:17 al2023sv systemd[1]: Started logrotate.timer – Daily rotation of log files.

タイマーが開始されたので、ログローテーションされたかをlsで確認します。

$ sudo ls -al /var/log
total 4716
drwxr-xr-x 8 root root 4096 Feb 17 10:19 .
drwxr-xr-x. 19 root root 269 Feb 13 10:49 ..
lrwxrwxrwx. 1 root root 39 Dec 19 16:08 README -> ../../usr/share/doc/systemd/README.logs
drwx——. 9 root root 23 Feb 13 10:21 audit
-rw-rw—-. 1 root utmp 384 Feb 14 13:14 btmp
drwxr-x—. 9 chrony chrony 108 Feb 17 10:19 chrony
-rw-r—–. 1 root adm 11403 Feb 14 13:45 cloud-init-output.log
-rw-r—–. 1 root adm 467265 Feb 14 13:45 cloud-init.log
-rw-r–r–. 1 root root 598495 Feb 17 00:45 dnf.librepo.log
-rw-r–r–. 1 root root 276279 Feb 17 00:45 dnf.log
-rw-r–r–. 1 root root 60566 Feb 17 00:45 dnf.rpm.log
-rw-r–r–. 1 root root 3859 Feb 17 00:45 hawkey.log
drwxr-sr-x+ 3 root systemd-journal 46 Feb 13 10:21 journal
-rw-rw-r–. 1 root utmp 292299 Feb 14 15:58 lastlog
-rw——- 1 root root 0 Feb 17 10:19 maillog
-rw——- 1 root root 0 Feb 13 10:49 maillog-20250217
-rw——- 1 root root 4624 Feb 17 10:19 messages
-rw——- 1 root root 3290421 Feb 17 10:11 messages-20250217
drwx——. 9 root root 6 Dec 19 16:08 private
-rw——- 1 root root 850 Feb 17 10:19 secure
-rw——- 1 root root 41075 Feb 17 10:11 secure-20250217
-rw——- 1 root root 0 Feb 17 10:19 spooler
-rw——- 1 root root 0 Feb 13 10:49 spooler-20250217
drwxrwx— 9 squid root 94 Feb 17 10:19 squid
-rw——-. 1 root root 0 Dec 19 16:08 tallylog
-rw-rw-r–. 1 root utmp 18439 Feb 14 15:58 wtmp
drwxr-xr-x 9 zabbix zabbix 65 Feb 17 10:19 zabbix

日付が入ったフィルが出来ており、問題なさそう。

念のため、タイマーのリストも再度確認。こちらも問題なく追加されていました。

$ sudo systemctl enable logrotate.timer
$
$ sudo systemctl list-timers
NEXT LEFT LAST PASSED UNIT ACTIVATES
Mon 2025-02-17 10:15:26 JST 7s left Mon 2025-02-17 10:14:26 JST 52s ago refresh-policy-routes@enX0.timer refresh-policy-routes@enX0.service
Mon 2025-02-17 13:47:26 JST 2h 32min left Sun 2025-02-16 13:47:26 JST 21h ago systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
Mon 2025-02-17 20:10:44 JST 8h left Mon 2025-02-17 00:45:26 JST 10h ago update-motd.timer update-motd.service
Tue 2025-02-18 00:00:00 JST 12h left Mon 2025-02-17 10:12:17 JST 3min 1s ago logrotate.timer logrotate.service
Mon 2025-02-24 01:15:09 JST 6 days left Mon 2025-02-17 00:43:26 JST 10h ago fstrim.timer fstrim.service

5 timers listed.
Pass –all to see loaded but inactive timers, too.

logrotateさせるファイルを複数書くと、そもそもlogrotateが動作しないんですね。有効なところまで動作してくれてもいいのにとは思いますが、重複しているどちらが優先かシステム的には分からないのでこういった動作になるんでしょうか。
何はともあれ、単純にヒューマンエラーなので、設定のチェックなどが重要ですね。

PowerShell ISEで実行環境をWindows PowerShell 5からPowerShell 7に変更する方法

Windows標準で導入されていて、ちょっと検証するだけなら便利なPowerShell ISEですが、実行するバージョンが標準ではWindows PowerShell 5までとなっています。これをPowerShell 7でする方法が紹介されていたので試してみました。

Using PowerShell 7 in the Windows PowerShell ISE
https://blog.ironmansoftware.com/using-powershell-7-in-the-windows-powershell-ise/

まず、端末にPowerShell 7をインストールしていない場合、MSIパッケージなどで新規導入します。ダウンロードサイトは下記となり、今回は「PowerShell-7.5.0-win-x64.msi」をインストールしました。

Windows への PowerShell のインストール

ダウンロードしたファイルを実行して、そのまま進めていけば導入は完了します。途中のOptional Actionsの下二つに、必要があればチェックを入れてください。
「Add ‘Open here’ context menus to Explorer」にチェックw入れると右クリックのコンテキストメニューに「PowerShell 7」を追加され、「Add ‘Run with PowerShell 7’ context menu for PowerShell files」にチェックを入れると右クリックのメニューに「PowerShellで実行」が追加されます。

導入が完了したら、スタートメニューを押して「PowerShell ISE」と入力、PowerShell ISEを実行します。初期状態ではプロファイルがないため、下記で紹介されているコマンドを実行します。
Windows PowerShell ISE でプロファイルを使用する方法

if (!(Test-Path -Path $PROFILE )) { New-Item -Type File -Path $PROFILE -Force }

次に作成したプロファイルを編集するため、「psEdit $PROFILE」と入力して実行します。するとプロファイルが自動的に開かれて編集可能となります。

psEdit $PROFILE

開かれたプロファイルに、サイトで紹介されていた下記を貼り付けて保存すれば完成です。

$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Clear()
$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add("Switch to PowerShell 7", { 
        function New-OutOfProcRunspace {
            param($ProcessId)

            $ci = New-Object -TypeName System.Management.Automation.Runspaces.NamedPipeConnectionInfo -ArgumentList @($ProcessId)
            $tt = [System.Management.Automation.Runspaces.TypeTable]::LoadDefaultTypeFiles()

            $Runspace = [System.Management.Automation.Runspaces.RunspaceFactory]::CreateRunspace($ci, $Host, $tt)

            $Runspace.Open()
            $Runspace
        }

        $PowerShell = Start-Process PWSH -ArgumentList @("-NoExit") -PassThru -WindowStyle Hidden
        $Runspace = New-OutOfProcRunspace -ProcessId $PowerShell.Id
        $Host.PushRunspace($Runspace)
}, "ALT+F5") | Out-Null

$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add("Switch to Windows PowerShell", { 
    $Host.PopRunspace()

    $Child = Get-CimInstance -ClassName win32_process | where {$_.ParentProcessId -eq $Pid}
    $Child | ForEach-Object { Stop-Process -Id $_.ProcessId }

}, "ALT+F6") | Out-Null

一度PowerShell ISEを終了させて、もう一度PowerShell ISEを実行すると、上部メニューのアドオンの所に“Switch to PowerShell 7”が追加されており、そちらをクリックすることでWindows PowerShell 5からPowerShell 7に切り替えることが出来るようになります。

PowerShell 7の方が、対応している.NETバージョンが新しいため、色々なことを試せるかと思います。本格的に作るまでもないようなものは、OS標準のISEで実行するのはアリですね。