変奏現実

パソコンやMMORPGのことなどを思いつくまま・・・記載されている会社名・製品名・システム名などは、各社の商標、または登録商標です。

この画面は、簡易表示です

Linux

【SSL】期限切れ→仕様変更→SSL✕のコンボ

また電子証明書の期限切れ

cronで自動化してあったハズなのに?

# /usr/bin/certbot renew
# systemctl restart httpd

ブログにログインすらできない。

再起動してもダメ

でもしばらく経ったらOKだった。

手動でdnf updateするとAppStreamが見えないとか言い出す

ググってみるとURLが変わったらしい

/etc/yum.repos.dをバックアップし

sed -i -e 's/mirrorlist=/#mirrorlist=/g' -e 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

※元ネタ

CentOS8 で dnf update が失敗する件

dnf updateしたら、1826個もあった。変わったのは相当前だったのかもしれない(笑

2021/11/04にcerbot-auto newしていたからその後らしいけど。

  廃止              : centos-release-8.2-2.2004.0.1.el8.x86_64        1821/1826
  廃止              : centos-repos-8.2-2.2004.0.1.el8.x86_64          1822/1826
警告: /etc/yum.repos.d/CentOS-fasttrack.repo は /etc/yum.repos.d/CentOS-fasttrack.repo.rpmsave として保存されました。
警告: /etc/yum.repos.d/CentOS-centosplus.repo は /etc/yum.repos.d/CentOS-centosplus.repo.rpmsave として保存されました。
警告: /etc/yum.repos.d/CentOS-Sources.repo は /etc/yum.repos.d/CentOS-Sources.repo.rpmsave として保存されました。
警告: /etc/yum.repos.d/CentOS-PowerTools.repo は /etc/yum.repos.d/CentOS-PowerTools.repo.rpmsave として保存されました。
警告: /etc/yum.repos.d/CentOS-HA.repo は /etc/yum.repos.d/CentOS-HA.repo.rpmsave として保存されました。
警告: /etc/yum.repos.d/CentOS-Extras.repo は /etc/yum.repos.d/CentOS-Extras.repo.rpmsave として保存されました。
警告: /etc/yum.repos.d/CentOS-Devel.repo は /etc/yum.repos.d/CentOS-Devel.repo.rpmsave として保存されました。
警告: /etc/yum.repos.d/CentOS-CR.repo は /etc/yum.repos.d/CentOS-CR.repo.rpmsave として保存されました。
警告: /etc/yum.repos.d/CentOS-Base.repo は /etc/yum.repos.d/CentOS-Base.repo.rpmsave として保存されました。
警告: /etc/yum.repos.d/CentOS-AppStream.repo は /etc/yum.repos.d/CentOS-AppStream.repo.rpmsave として保存されました

URLの変更が巻き戻されとる!

もう1回

# sed -i -e 's/mirrorlist=/#mirrorlist=/g' -e 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
# dnf update
CentOS Linux 8 - AppStream                                4.8 MB/s | 8.4 MB     00:01
CentOS Linux 8 - BaseOS                                   4.7 MB/s | 4.6 MB     00:00
CentOS Linux 8 - Extras                                   6.3 kB/s | 1.5 kB     00:00
Remi's Modular repository for Enterprise Linux 8 - x86_64 3.0 MB/s | 3.1 kB     00:00
GPG 鍵 0x5F11735A をインポート中:
 Userid     : "Remi's RPM repository <remi@remirepo.net>"
 Fingerprint: 6B38 FEA7 231F 87F5 2B9C A9D8 5550 9759 5F11 735A
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-remi.el8
これでよろしいですか? [y/N]: y
Remi's Modular repository for Enterprise Linux 8 - x86_64 153 kB/s | 973 kB     00:06
Safe Remi's RPM repository for Enterprise Linux 8 - x86_6 2.3 MB/s | 3.1 kB     00:00
GPG 鍵 0x5F11735A をインポート中:
 Userid     : "Remi's RPM repository <remi@remirepo.net>"
 Fingerprint: 6B38 FEA7 231F 87F5 2B9C A9D8 5550 9759 5F11 735A
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-remi.el8
これでよろしいですか? [y/N]: y
Safe Remi's RPM repository for Enterprise Linux 8 - x86_6 474 kB/s | 2.1 MB     00:04
依存関係が解決しました。
行うべきことはありません。
完了しました!
#

しかも1826はMAX値なのか1826番目の関連パッケージが多すぎるのか?

以後、1826/1826表示が延々続く・・・(汗

更にcronが消えていたことも判明

# /etc/rc.d/init.d/crond status
-bash: /etc/rc.d/init.d/crond: そのようなファイルやディレクトリはありません

CentOS7以降はcronからcronie-noanacronに変わったので、

CentOS7以降はcronからcronie-anacronに変わったので、

自動 ndf updateで削除されてしまったのかな?

cronie-noanacronをインストしcronie-anacronをアンスコしてみた。

# sudo dnf install cronie-noanacron
メタデータの期限切れの最終確認: 0:01:41 時間前の 2022年03月19日 22時30分50秒 に実施しまし た。
依存関係が解決しました。
==========================================================================================
 パッケージ                 アーキテクチャー バージョン            リポジトリー     サイズ
==========================================================================================
インストール:
 cronie-noanacron           x86_64           1.5.2-4.el8           baseos            19 k

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

ダウンロードサイズの合計: 19 k
インストール後のサイズ: 396
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
cronie-noanacron-1.5.2-4.el8.x86_64.rpm                    20 kB/s |  19 kB     00:00
------------------------------------------------------------------------------------------
合計                                                       20 kB/s |  19 kB     00:00
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備             :                                                                  1/1
  インストール中   : cronie-noanacron-1.5.2-4.el8.x86_64                              1/1
  検証             : cronie-noanacron-1.5.2-4.el8.x86_64                              1/1
インストール済みの製品が更新されています。

インストール済み:
  cronie-noanacron-1.5.2-4.el8.x86_64

完了しました!
# dnf remove cronie-anacron
依存関係が解決しました。
==========================================================================================
 パッケージ              Arch            バージョン              リポジトリー       サイズ
==========================================================================================
削除中:
 cronie-anacron          x86_64          1.5.2-4.el8             @anaconda           49 k

トランザクションの概要
==========================================================================================
削除  1 パッケージ

解放された容量: 49 k
これでよろしいですか? [y/N]: y
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備             :                                                                  1/1
  削除             : cronie-anacron-1.5.2-4.el8.x86_64                                1/1
  scriptletの実行中: cronie-anacron-1.5.2-4.el8.x86_64                                1/1
  検証             : cronie-anacron-1.5.2-4.el8.x86_64                                1/1
インストール済みの製品が更新されています。

削除しました:
  cronie-anacron-1.5.2-4.el8.x86_64

完了しました!
# systemctl restart crond
# systemctl status crond
● crond.service - Command Scheduler
   Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2022-03-19 22:42:46 JST; 4s ago
 Main PID: 120900 (crond)
    Tasks: 1 (limit: 23826)
   Memory: 1.2M
   CGroup: /system.slice/crond.service
           mq120900 /usr/sbin/crond -n
(push q)

※元ネタ

【CentOS7】Cron(cronie-noanacron)をインストール

CentOS8でファイルを定期的にバックアップするcronの設定

statusこまんどがqキー押下するまで待ちになっているのも謎だけど

ここまで書いて【更新】したら

サーバがオフラインらしいよぉ?と泣き言

あ、消したssl.confが復活しとる。

パッケージのssl.confは手元のSSL化したバーチャルホスト設定ファイルとうまくかみ合わないので

# NameVirtualHost *:80

# SSL
Listen 443 https

SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog
SSLSessionCache         shmcb:/run/httpd/sslcache(512000)
SSLSessionCacheTimeout  300
SSLRandomSeed startup file:/dev/random  256
SSLRandomSeed connect builtin
SSLCryptoDevice builtin

Include vhost/*.conf

な内容のvhost.confで代用している。

Include vhost/*.conf

だけ追記してもいいけどね。

なかなか面倒だなぁ

ps.2022/06/17

再びhttps期限切れ。

クローン化したのにどうしたのかな?

# systemctl status crond
● crond.service - Command Scheduler
   Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled; vendor prese>
   Active: active (running) since Sat 2022-03-19 22:42:46 JST; 2 months 29 days>
 Main PID: 120900 (crond)
    Tasks: 1 (limit: 23826)
   Memory: 13.1M
   CGroup: /system.slice/crond.service
           mq120900 /usr/sbin/crond -n

 6月 17 17:01:01 **********.*********.***** CROND[1338801]: (root) CMD (run-par>
・・・
 6月 17 21:05:01 **********.*********.***** crond[120900]: (curl) ERROR (getpwn>
・・・
# systemctl restart crond
# systemctl status crond
● crond.service - Command Scheduler
   Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2022-06-17 21:45:51 JST; 11s ago
 Main PID: 1350619 (crond)
    Tasks: 1 (limit: 23826)
   Memory: 1.2M
   CGroup: /system.slice/crond.service
           mq1350619 /usr/sbin/crond -n

 6月 17 21:45:51 **********.*********.***** systemd[1]: Started Command Scheduler.
 6月 17 21:45:51 **********.*********.***** crond[1350619]: (CRON) STARTUP (1.5.2)
 6月 17 21:45:51 **********.*********.***** crond[1350619]: (CRON) INFO (Syslog will be used instead of sendmail.)
 6月 17 21:45:51 **********.*********.***** crond[1350619]: (CRON) INFO (RANDOM_DELAY will be scaled with factor >
 6月 17 21:45:51 **********.*********.***** crond[1350619]: (CRON) INFO (running with inotify support)
 6月 17 21:45:51 **********.*********.***** crond[1350619]: (CRON) INFO (@reboot jobs will be run at computer's s>

何やらエラってたのでリスタート。

# /usr/bin/certbot renew
# systemctl restart httpd

で修復完了。

クローンのログを見ると

Jun 12 18:05:01 *********** crond[120900]: (curl) ERROR (getpwnam() failed - user unknown)

curlってユーザが無いということらしい。

wp-cron.phpを起動するトコで使っていたので、apacheに変えてみる。

certbotはログになかった???

時間が被って変になったのかもしれない毎月1日の04:03に変えてみる。

ps.2023/3/23

# dnf update
トランザクションの概要
================================================================================
インストール      6 パッケージ
アップグレード  561 パッケージ
削除              3 パッケージ

ダウンロードサイズの合計: 1.0 G
これでよろしいですか? [y/N]: y
・・・

ps.2023/08/31

なぜか証明書が更新されなかったのでコマンドラインから更新してみた。

# /usr/bin/certbot renew
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/****************.***
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Renewing an existing certificate for ssiscirine.iobb.net

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations, all renewals succeeded: 
  /etc/letsencrypt/********************.*** (success)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
※ここまでを見ると証明書の更新は成功したようだ・・・
Hook 'post-hook' reported error code 5
Hook 'post-hook' ran with error output:
 Invalid unit name "httpd
 " was escaped as "httpd\x0d" (maybe you should use systemd-escape?)
 Failed to reload httpd\x0d.service: Unit httpd\x0d.service not found.
※cronで指定したオプションがなぜか動き(ゴミファイルかな?)、しかも内容がマズかったらしい。ググってみるとapacheを起動しようとして失敗したようなので手動で再起動。
#  systemctl restart httpd

8/1のletsencryptのログを見ると

–post-hook “systemctl reload httpd”

が直後のCR(\x0d)を誤って

–post-hook “systemctl reload httpd\x0d”

に観えたらしい。

このpost-hookで失敗したので

ヤバイと思ったのか、ちゃんと更新できた証明書も巻き戻したらしい。

/etc/cron.d/letsencryptの改行をCRLFからLFに治す。

動作テストには –force-renew –dry-run オプションを付ければいいはず。



[git]コマンド

多分、こんな感じかな

  1. 参照系
    1. git clone ${リポジトリィ}
      • カレント・ディレクトリィにドコかのリポジトリィをコピる。
    1. git pull
      • リモートリポジトリの最新状態に更新
  2. 更新系
    1. とりあえずクローンする
    2. git checkout ${ブランチ}
      • 新たなブランチで履歴を作る時は、-b ${新しいブランチ} を使う
      • 既存のブランチでも、初回は git fetch ${ブランチ} で情報の取得が必要
    3. git add ${ファイル名}
      • コミット対象ファイルに追加
    4. git rm ${ファイル名}
      • コミット対象ファイルから削除
    5. git mv ${ファイル名}
      • コミット対象ファイル名の変更
    6. git commit -m ${メッセージ}
    7. git push origin ${ブランチ}
  3. 管理
    1. git init
      • カレント・ディレクトリィにリポジトリィを作る。
    2. git branch ${ブランチ}
      • ブランチを作る
      • ブランチを削除する時は -d ${ブランチ}

な感じで使えばいいかな



【CentOS8】え!

最近知ったけど、ホストOSの7は2024年までサポート期間が残ってるけど、ゲストOSで使ってる8は今年(2021)中にサポート終了だって!

Red Hat Developer Programに参加してRHELを最大16個をサブスク登録して使う?

CentOS Streamに移行する?

ん-めんどくさいけど、CentOSからCentOS Streamにコンバートできるらしいからコレで済ませてしまうかもしれない。

root@centos-linux# dnf install centos-release-stream
root@centos-linux# dnf swap centos-{linux,stream}-repos
root@centos-linux# dnf distro-sync
root@centos-stream# cat /etc/centos-release
CentOS Stream release 8

Windows 8と同じく短命なのか。(南無南無

CentOS-Xとかにすればいいのに。



【CentOS】USB ON/OFF

OctoPrintでWEBカメラのタイムラプスが照明の反射で見にくいので、USBライトをつけようと思うけど、スイッチでON・OFFが面倒なので、コマンドでON/OFFできないか?
調べてみました。

WindowsのUSBデバイスの取り外しっぽいコマンドの記事があった。

  1. lsusbコマンドでデバイス検索
    • デバイスに対応する {Bus}-{port}. … .{port} をメモメモ。
  2. デバイスのUSBポートを解放
    • echo -n {Bus}-{port}. … .{port} >/sys/bus/usb/drivers/usb/unbind
  3. デバイスのUSBポートを接続。
    • echo -n {Bus}-{port}. … .{port} >/sys/bus/usb/drivers/usb/bind

{Bus}-{port}. … .{port} の部分はlsusbの結果次第なので、1-1.2-3.4 と長かったり、1-2.3と短かったりするので、難しい。

これでUSBライトをON、OFFできたらいいな。

あ、OctoPrintのタイムラプスのソースをチョット書換えが必要かな・・・

SUDO問題どうしよう?

wget http://localhost;8089/ON とか wget http://localhost;8089/OFF すればいいのかな?

てか?USBライトでも装置名が出てくるのかな?



保護されない通信、再び

また、3か月が経ちました。ブラウザがエラるので、

# /usr/local/bin/certbot-auto renew
Upgrading certbot-auto 1.9.0 to 1.11.0...
Replacing certbot-auto...
Your system is not supported by certbot-auto anymore.
Certbot will no longer receive updates.
Please visit https://certbot.eff.org/ to check for other alternatives.
Saving debug log to /var/log/*****/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /***/*****/*****/*****.***.***.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert is due for renewal, auto-renewing...
Plugins selected: Authenticator webroot, Installer None
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for ssiscirine.moe.hm
Using the webroot path /***/***/***** for all unmatched domains.
Waiting for verification...
Cleaning up challenges

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
new certificate deployed without reload, fullchain is
/***/*****/***/*****.***.***/*****.pem
- - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - -

- - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - -
Congratulations, all renewals succeeded. The following certs have been renewed:
  /***/*****/***/*****.**.**/*****.pem (success)
- - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - -

certbot-autoはサポート対象外になって、certbot-apacheが使えるらしい

# dnf list available | grep certbot-apache
python3-certbot-apache.noarch        1.11.0-1.el8              epel

インストしてみる

# dnf install certbot-apache
メタデータの期限切れの最終確認: 2:41:13 時間前の 2021年01月30日 23時48分00秒 に 実施しました。
依存関係が解決しました。
================================================================================
 パッケージ                Arch   バージョン                    Repo      サイズ
================================================================================
インストール中:
 python3-certbot-apache    noarch 1.11.0-1.el8                  epel      143 k
依存関係のインストール中:
 python3-acme              noarch 1.11.0-1.el8                  epel       88 k
 python3-augeas            noarch 0.5.0-12.el8                  AppStream  31 k
 python3-certbot           noarch 1.11.0-1.el8                  epel      388 k
 python3-configargparse    noarch 0.14.0-6.el8                  epel       36 k
 python3-distro            noarch 1.4.0-2.module_el8.3.0+562+e162826a
                                                                AppStream  37 k
 python3-josepy            noarch 1.2.0-5.el8                   epel       95 k
 python3-ndg_httpsclient   noarch 0.5.1-4.el8                   epel       53 k
 python3-parsedatetime     noarch 2.5-1.el8                     epel       79 k
 python3-pyasn1            noarch 0.3.7-6.el8                   AppStream 126 k
 python3-pyrfc3339         noarch 1.1-1.el8                     epel       19 k
 python3-requests-toolbelt noarch 0.9.1-4.el8                   epel       91 k
 python3-zope-component    noarch 4.3.0-8.el8                   epel      313 k
 python3-zope-event        noarch 4.2.0-12.el8                  epel      210 k
 python3-zope-interface    x86_64 4.6.0-1.el8                   epel      158 k
弱い依存関係のインストール中:
 certbot                   noarch 1.11.0-1.el8                  epel       49 k
 python-josepy-doc         noarch 1.2.0-5.el8                   epel       21 k

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

ダウンロードサイズの合計: 1.9 M
インストール済みのサイズ: 7.2 M
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
(1/17): python3-distro-1.4.0-2.module_el8.3.0+5 234 kB/s |  37 kB     00:00
(2/17): python3-augeas-0.5.0-12.el8.noarch.rpm  189 kB/s |  31 kB     00:00
(3/17): python-josepy-doc-1.2.0-5.el8.noarch.rp 186 kB/s |  21 kB     00:00
(4/17): python3-pyasn1-0.3.7-6.el8.noarch.rpm   439 kB/s | 126 kB     00:00
(5/17): certbot-1.11.0-1.el8.noarch.rpm         329 kB/s |  49 kB     00:00
(6/17): python3-acme-1.11.0-1.el8.noarch.rpm    1.2 MB/s |  88 kB     00:00
(7/17): python3-certbot-apache-1.11.0-1.el8.noa 2.0 MB/s | 143 kB     00:00
(8/17): python3-configargparse-0.14.0-6.el8.noa 1.0 MB/s |  36 kB     00:00
(9/17): python3-josepy-1.2.0-5.el8.noarch.rpm   2.6 MB/s |  95 kB     00:00
(10/17): python3-ndg_httpsclient-0.5.1-4.el8.no 1.6 MB/s |  53 kB     00:00
(11/17): python3-pyrfc3339-1.1-1.el8.noarch.rpm 689 kB/s |  19 kB     00:00
(12/17): python3-parsedatetime-2.5-1.el8.noarch 2.1 MB/s |  79 kB     00:00
(13/17): python3-certbot-1.11.0-1.el8.noarch.rp 2.0 MB/s | 388 kB     00:00
(14/17): python3-requests-toolbelt-0.9.1-4.el8. 2.9 MB/s |  91 kB     00:00
(15/17): python3-zope-event-4.2.0-12.el8.noarch 4.5 MB/s | 210 kB     00:00
(16/17): python3-zope-interface-4.6.0-1.el8.x86 3.6 MB/s | 158 kB     00:00
(17/17): python3-zope-component-4.3.0-8.el8.noa 4.0 MB/s | 313 kB     00:00
--------------------------------------------------------------------------------
合計                                            947 kB/s | 1.9 MB     00:02
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備              :                                                       1/1
  インストール中    : python3-zope-event-4.2.0-12.el8.noarch               1/17
  インストール中    : python3-zope-interface-4.6.0-1.el8.x86_64            2/17
  インストール中    : python3-zope-component-4.3.0-8.el8.noarch            3/17
  インストール中    : python3-pyrfc3339-1.1-1.el8.noarch                   4/17
  インストール中    : python3-requests-toolbelt-0.9.1-4.el8.noarch         5/17
  インストール中    : python3-parsedatetime-2.5-1.el8.noarch               6/17
  インストール中    : python3-ndg_httpsclient-0.5.1-4.el8.noarch           7/17
  インストール中    : python3-configargparse-0.14.0-6.el8.noarch           8/17
  インストール中    : python-josepy-doc-1.2.0-5.el8.noarch                 9/17
  インストール中    : python3-josepy-1.2.0-5.el8.noarch                   10/17
  インストール中    : python3-pyasn1-0.3.7-6.el8.noarch                   11/17
  インストール中    : python3-acme-1.11.0-1.el8.noarch                    12/17
  インストール中    : python3-distro-1.4.0-2.module_el8.3.0+562+e162826   13/17
  インストール中    : python3-certbot-1.11.0-1.el8.noarch                 14/17
  インストール中    : certbot-1.11.0-1.el8.noarch                         15/17
  scriptlet の実行中: certbot-1.11.0-1.el8.noarch                         15/17
  インストール中    : python3-augeas-0.5.0-12.el8.noarch                  16/17
  インストール中    : python3-certbot-apache-1.11.0-1.el8.noarch          17/17
  scriptlet の実行中: python3-certbot-apache-1.11.0-1.el8.noarch          17/17
  検証              : python3-augeas-0.5.0-12.el8.noarch                   1/17
  検証              : python3-distro-1.4.0-2.module_el8.3.0+562+e162826    2/17
  検証              : python3-pyasn1-0.3.7-6.el8.noarch                    3/17
  検証              : certbot-1.11.0-1.el8.noarch                          4/17
  検証              : python-josepy-doc-1.2.0-5.el8.noarch                 5/17
  検証              : python3-acme-1.11.0-1.el8.noarch                     6/17
  検証              : python3-certbot-1.11.0-1.el8.noarch                  7/17
  検証              : python3-certbot-apache-1.11.0-1.el8.noarch           8/17
  検証              : python3-configargparse-0.14.0-6.el8.noarch           9/17
  検証              : python3-josepy-1.2.0-5.el8.noarch                   10/17
  検証              : python3-ndg_httpsclient-0.5.1-4.el8.noarch          11/17
  検証              : python3-parsedatetime-2.5-1.el8.noarch              12/17
  検証              : python3-pyrfc3339-1.1-1.el8.noarch                  13/17
  検証              : python3-requests-toolbelt-0.9.1-4.el8.noarch        14/17
  検証              : python3-zope-component-4.3.0-8.el8.noarch           15/17
  検証              : python3-zope-event-4.2.0-12.el8.noarch              16/17
  検証              : python3-zope-interface-4.6.0-1.el8.x86_64           17/17
Installed products updated.

インストール済み:
  certbot-1.11.0-1.el8.noarch
  python-josepy-doc-1.2.0-5.el8.noarch
  python3-acme-1.11.0-1.el8.noarch
  python3-augeas-0.5.0-12.el8.noarch
  python3-certbot-1.11.0-1.el8.noarch
  python3-certbot-apache-1.11.0-1.el8.noarch
  python3-configargparse-0.14.0-6.el8.noarch
  python3-distro-1.4.0-2.module_el8.3.0+562+e162826a.noarch
  python3-josepy-1.2.0-5.el8.noarch
  python3-ndg_httpsclient-0.5.1-4.el8.noarch
  python3-parsedatetime-2.5-1.el8.noarch
  python3-pyasn1-0.3.7-6.el8.noarch
  python3-pyrfc3339-1.1-1.el8.noarch
  python3-requests-toolbelt-0.9.1-4.el8.noarch
  python3-zope-component-4.3.0-8.el8.noarch
  python3-zope-event-4.2.0-12.el8.noarch
  python3-zope-interface-4.6.0-1.el8.x86_64

完了しました!

更新済みだけど、SSL証明書を取得してみよう。

# certbot --apache
Saving debug log to /var/log/*****/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache

Which names would you like to activate HTTPS for?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: ssiscirine.moe.hm
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel):
Cert not yet due for renewal

You have an existing certificate that has exactly the same domains or certificate name you requested and isn't close to expiry.
(ref: /***/*****/*****/*****.conf)

What would you like to do?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: Attempt to reinstall this existing certificate
2: Renew &amp; replace the certificate (may be subject to CA rate limits)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 1 ※面倒なんで1にした。
Keeping the existing certificate
Deploying Certificate to VirtualHost /***/ssl_virtualhost-***.conf
Redirecting vhost in /***/virtualhost-***.conf to ssl vhost in /***/ssl_virtualhost-***.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://ssiscirine.moe.hm
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

なんとapacheに追加した仮想ホスト設定ファイルも書き直されたらしい。

証明書の有効期限を確認する

# certbot certificates
Saving debug log to /var/log/*****/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Found the following certs:
  Certificate Name: ssiscirine.moe.hm
    Serial Number: **************************************
    Key Type: RSA
    Domains: ssiscirine.moe.hm
    Expiry Date: 2021-04-30 16:19:26+00:00 (VALID: 89 days)
    Certificate Path: /***/*****/***/***/*****.pem
    Private Key Path: /***/*****/***/***/*******.pem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

SSL証明書の自動更新もしておく。

# vi /etc/crontab
10 3 *  *  * root /usr/bin/certbot renew を追記

ps.2021.12.15

ブログをブラウザで見てると、期限切れマークになっていた。

# certbot certificates
Saving debug log to /var/log/*******/*******.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Found the following certs:
  Certificate Name: ssiscirine.iobb.net
    Serial Number: **************************************
    Key Type: RSA
    Domains: ssiscirine.iobb.net
    Expiry Date: 2021-12-02 11:41:03+00:00 (INVALID: EXPIRED)
    Certificate Path: /***/*****/***/***/*******.pem
    Private Key Path: /***/*****/***/***/*******.pem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

みごとにエクスファイヤしてたので、更新。


# /usr/bin/certbot renew
Saving debug log to /var/log/*******/*******.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/ssiscirine.iobb.net.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Renewing an existing certificate for ssiscirine.iobb.net

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations, all renewals succeeded:
  /***/*****/***/***/*******..pem (success)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# certbot certificates
Saving debug log to /var/log/*******/*******.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Found the following certs:
  Certificate Name: ssiscirine.iobb.net
    Serial Number: **************************************
    Key Type: RSA
    Domains: ssiscirine.iobb.net
    Expiry Date: 2022-03-15 05:50:07+00:00 (VALID: 89 days)
    Certificate Path: /***/*****/***/***/*******.pem
    Private Key Path: /***/*****/***/***/*******.pem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

最後に

# systemctl restart httpd


保護されていない通信

更新を忘れていたらしい。

# /usr/local/bin/certbot-auto renew
Upgrading certbot-auto 1.6.0 to 1.9.0...
Replacing certbot-auto...
Creating virtual environment...
Installing Python packages...
Installation succeeded.
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/ssiscirine.moe.hm.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert is due for renewal, auto-renewing...
Plugins selected: Authenticator webroot, Installer None
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for ssiscirine.moe.hm
Using the webroot path /****/****/******** for all unmatched domains.
Waiting for verification...
Cleaning up challenges

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
new certificate deployed without reload, fullchain is
/etc/letsencrypt/live/ssiscirine.moe.hm/fullchain.pem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Congratulations, all renewals succeeded. The following certs have been renewed:
  /etc/letsencrypt/live/ssiscirine.moe.hm/fullchain.pem (success)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#

これだけでは配信しているhttpsの電子証明書が古いまま(2020/10/29迄)なので、

# systemctl restart httpd

証明書の有効期間は、2021年1月30日まで。



[WordPress]5.5

またアップグレードの催促があったので、【アップグレード】ボタンを押した。

なぜ、自動アップグレードしない。?

$nslookup  {このサーバーのお名前}

するとグローバルなIPアドレスしか出てこない。

そりゃ無理です。

そのせいか?
編集画面・左上のW印の「記事一覧を表示」をクリックすると、WordPressの案内ページにジャンプするのでとても使いにくい。

ルータにループバックさせればいいけど、ルータ調整中に無限ループするとかなり面倒な事になるので、

127.0.0.1   {このサーバーのお名前}

にした。

これで自動的にアップグレードやバックアップが動くはず。

ついでに、dnf updateしたら、Listen 443 設定が被っているので停止になった。

あれこれ調べたら、/etc/conf.d/ssl.conf を消して、vhost.confの名前でVirtualHostの設定をしていたから、Updateで自動的に/etc/conf.d/ssl.confが復元されていたせいだった。消したのでOK。

$ httpd -t
Syntax OK

ついでにSELINUXもtargetedになっていたので、disableに直した。

まだ変だな?

AM/PM表記を、24時間表記に変更。

カレンダーの週の初めが月曜になっているので日曜に変更。

php 7.2 では古いらしい。

# dnf -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
# # dnf module list php
最速のミラーを確定しています (41 hosts).. done. ---  B/s |   0  B     --:-- ETA
Remi's Modular repository for Enterprise Linux  182 kB/s | 576 kB     00:03
Safe Remi's RPM repository for Enterprise Linux 1.5 MB/s | 1.5 MB     00:01
CentOS-8 - AppStream
Name     Stream         Profiles                       Summary
php      7.2 [d][e]     common [d], devel, minimal     PHP scripting language
php      7.3            common [d], devel, minimal     PHP scripting language

Remi's Modular repository for Enterprise Linux 8 - x86_64
Name     Stream         Profiles                       Summary
php      remi-7.2       common [d], devel, minimal     PHP scripting language
php      remi-7.3       common [d], devel, minimal     PHP scripting language
php      remi-7.4       common [d], devel, minimal     PHP scripting language

ヒント: [d]efault, [e]nabled, [x]disabled, [i]nstalled
# dnf module reset php
# dnf module install php:remi-7.4
# php -v
PHP 7.4.9 (cli) (built: Aug  4 2020 08:28:13) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.9, Copyright (c), by Zend Technologies

tarコマンドが使えない?

# dnf install tar

警告 オプションのモジュール imagick がインストールされていないか、無効化されています。

警告 オプションのモジュール zip がインストールされていないか、無効化されています。

# dnf install php-imagick
ImageMagick-libs-6.9.10.86-1.el8.x86_64
php-pecl-imagick-3.4.4-10.el8.remi.7.4.x86_64
他多数。
# dnf install php-zip
libzip-1.7.3-1.el8.remi.x86_64 php-pecl-zip-1.19.0-1.el8.remi.7.4.x86_64

残るはあと2つ

停止中のテーマを削除してください セキュリティ

テーマはサイトのデザインを決定します。ブランドの一貫性とサイトの安全性の維持のため、常に更新することが重要です。

サイトのインストール済みテーマ5個はすべて最新版です。

サイトには WordPress のデフォルトテーマ Twenty Twenty と現在有効なテーマ Enough を除いて、3個の停止中のテーマがあります。 サイトのセキュリティ向上のため未使用のテーマは削除することをおすすめします。

※無視。パス!

予約したイベントの実行に失敗しました

予約したイベント inpsyde_phone-home_checkin の実行に失敗しました。サイトは動作しますが、予約した投稿や自動更新は正しく動作しないかもしれません。

5.4.1の頃から原因不明らしい。



XRDPとWindows10の間でクリップボードが使えない等

ことがあったので調べてみた。まだ試してはいない。

3通りあった

まずはリモート接続の設定画面のローカルリソースでクリップボードを使える様にチェックが入っているか?

意外と忘れていることが多い。

ローカルコンピュータポリシーで
「コンピューターの構成」
 「管理用テンプレート」
   「Windowsコンポーネント」
   「リモートデスクトップサービス」
    「リモートデスクトップセッションホスト」
      「デバイスとリソースのリダイレクト」のトコで
「クリップボードのリダイレクトを許可しない」が「無効」になっている?
無効になっていなかったら「無効」にしてリモート接続しなおし。

メモリがギリギリだとDRP経由でクリップボードをやり取りするタスクがエラって仮死してる場合もあるらしい。

接続先のタスクマネージャの
「プロセス」タブに「RDPクリップボードモニタ」があったら、
※もしWindows7だったら「詳細」タブに「rdpclip.exe」が見当たるらしい。
「タスクを終了」し
「ファイル」
 「新しいタスクの実行」で
rdpclip.exe を起動する。

接続先がCentOSなら接続先には無いので、接続元を試すといいのかもしれない。

あと、XRDPは接続するPCに応じてセッションを増やすらしいので、接続を切る時はログアウトした方が良いかもしれない。

できれば、XRDPを再起動するといいだろう。

sudo systemctl restart xrdp
はできる様だが、
sudo service xrdp restart 2013年頃の記事
は無理らしい。
つまり古いバージョンはダメなんだろうね。

CentOSで「半角/全角」キーや「Windows+スペース」キーでかな漢字変換が動かないことがある。そんな場合は

画面右上のステータス・バーの右端で入力を切り替える。

アプリケーション
 システムツール
  設定で
言語と地域を選択し、入力ソースに、「日本語(xxx)」とかをメモって
再登録する。

とかショック療法が効くらしい。



[CentOS8]Node.jsとか

パッケージ管理がdnfに変わったので

# dnf info nodejs
利用可能なパッケージ
名前         : nodejs
エポック     : 1
バージョン   : 10.19.0
リリース     : 1.module_el8.1.0+277+2bccb1a9
Arch         : x86_64
サイズ       : 9.0 M
ソース       : nodejs-10.19.0-1.module_el8.1.0+277+2bccb1a9.src.rpm
リポジトリー : AppStream
概要         : JavaScript runtime
URL          : http://nodejs.org/
ライセンス   : MIT and ASL 2.0 and ISC and BSD
説明         : Node.js is a platform built on Chrome's JavaScript runtime
             : for easily building fast, scalable network applications.
             : Node.js uses an event-driven, non-blocking I/O model that
             : makes it lightweight and efficient, perfect for data-intensive
             : real-time applications that run across distributed devices.
# dnf info python36
インストール済みパッケージ
名前         : python36
バージョン   : 3.6.8
リリース     : 2.module_el8.1.0+245+c39af44f
Arch         : x86_64
サイズ       : 13 k
ソース       : python36-3.6.8-2.module_el8.1.0+245+c39af44f.src.rpm
リポジトリー : @System
repo から    : AppStream
概要         : Interpreter of the Python programming language
URL          : https://www.python.org/
ライセンス   : Python
説明         : Python is an accessible, high-level, dynamically typed,
             : interpreted programming language, designed with an emphasis on
             : code readibility. It includes an extensive standard library, and
             : has a vast ecosystem of third-party libraries.
             :
             : The python36 package provides the "python3.6" executable: the
             : reference interpreter for the Python language, version 3.
             : The package also installs the "python3" executable which is user
             : configurable using the "alternatives --config python3" command.
             : For the unversioned "python" command, see manual page
             : "unversioned-python".
             :
             : The python36-devel package contains files for dovelopment of
             : Python application and the python36-debug is helpful for
             : debugging.
             :
             : Packages containing additional libraries for Python 3.6 are
             : generally named with the "python3-" prefix.
# dnf info openssl
インストール済みパッケージ
名前         : openssl
エポック     : 1
バージョン   : 1.1.1c
リリース     : 2.el8
Arch         : x86_64
サイズ       : 1.2 M
ソース       : openssl-1.1.1c-2.el8.src.rpm
リポジトリー : @System
repo から    : anaconda
概要         : Utilities from the general purpose cryptography library with TLS
             : implementation
URL          : http://www.openssl.org/
ライセンス   : OpenSSL
説明         : The OpenSSL toolkit provides support for secure communications
             : between machines. OpenSSL includes a certificate management tool
             : and shared libraries which provide various cryptographic
             : algorithms and protocols.

おっとupdateしてなかった。

# dnf update
================================================================================
 パッケージ           Arch   バージョン                         Repo      サイズ
================================================================================
インストール:
 kernel               x86_64 4.18.0-147.5.1.el8_1               BaseOS    1.5 M
 kernel-core          x86_64 4.18.0-147.5.1.el8_1               BaseOS     25 M
 kernel-modules       x86_64 4.18.0-147.5.1.el8_1               BaseOS     22 M
アップグレード:
 qemu-guest-agent     x86_64 15:2.12.0-88.module_el8.1.0+266+ba744077.2
                                                                AppStream 206 k
 NetworkManager       x86_64 1:1.20.0-5.el8_1                   BaseOS    2.1 M
 NetworkManager-libnm x86_64 1:1.20.0-5.el8_1                   BaseOS    1.7 M
 NetworkManager-team  x86_64 1:1.20.0-5.el8_1                   BaseOS    133 k
 NetworkManager-tui   x86_64 1:1.20.0-5.el8_1                   BaseOS    308 k
 glibc                x86_64 2.28-72.el8_1.1                    BaseOS    3.7 M
 glibc-common         x86_64 2.28-72.el8_1.1                    BaseOS    836 k
 glibc-devel          x86_64 2.28-72.el8_1.1                    BaseOS    1.0 M
 glibc-headers        x86_64 2.28-72.el8_1.1                    BaseOS    469 k
 glibc-langpack-ja    x86_64 2.28-72.el8_1.1                    BaseOS    323 k
 grub2-common         noarch 1:2.02-78.el8_1.1                  BaseOS    882 k
 grub2-pc             x86_64 1:2.02-78.el8_1.1                  BaseOS     36 k
 grub2-pc-modules     noarch 1:2.02-78.el8_1.1                  BaseOS    859 k
 grub2-tools          x86_64 1:2.02-78.el8_1.1                  BaseOS    2.0 M
 grub2-tools-extra    x86_64 1:2.02-78.el8_1.1                  BaseOS    1.1 M
 grub2-tools-minimal  x86_64 1:2.02-78.el8_1.1                  BaseOS    201 k
 kernel-tools         x86_64 4.18.0-147.5.1.el8_1               BaseOS    1.7 M
 kernel-tools-libs    x86_64 4.18.0-147.5.1.el8_1               BaseOS    1.5 M
 libarchive           x86_64 3.3.2-8.el8_1                      BaseOS    359 k
 openldap             x86_64 2.4.46-11.el8_1                    BaseOS    352 k
 openldap-devel       x86_64 2.4.46-11.el8_1                    BaseOS    811 k
 openssh              x86_64 8.0p1-4.el8_1                      BaseOS    496 k
 openssh-clients      x86_64 8.0p1-4.el8_1                      BaseOS    704 k
 openssh-server       x86_64 8.0p1-4.el8_1                      BaseOS    485 k
 policycoreutils      x86_64 2.9-3.el8_1.1                      BaseOS    377 k
 python3-perf         x86_64 4.18.0-147.5.1.el8_1               BaseOS    1.6 M
 sqlite-libs          x86_64 3.26.0-4.el8_1                     BaseOS    579 k
 systemd              x86_64 239-18.el8_1.4                     BaseOS    3.5 M
 systemd-libs         x86_64 239-18.el8_1.4                     BaseOS    562 k
 systemd-pam          x86_64 239-18.el8_1.4                     BaseOS    232 k
 systemd-udev         x86_64 239-18.el8_1.4                     BaseOS    1.3 M
 tuned                noarch 2.12.0-3.el8_1.1                   BaseOS    275 k
 cacti                noarch 1.2.9-1.el8                        epel       20 M
 epel-release         noarch 8-8.el8                            epel       22 k
依存関係のインストール:
 grub2-tools-efi      x86_64 1:2.02-78.el8_1.1                  BaseOS    465 k

トランザクションの概要
================================================================================
インストール     4 パッケージ
アップグレード  34 パッケージ

ダウンロードサイズの合計: 100 M
これでよろしいですか? [y/N]: y
(中略)
アップグレード済み:
  qemu-guest-agent-15:2.12.0-88.module_el8.1.0+266+ba744077.2.x86_64
  NetworkManager-1:1.20.0-5.el8_1.x86_64
  NetworkManager-libnm-1:1.20.0-5.el8_1.x86_64
  NetworkManager-team-1:1.20.0-5.el8_1.x86_64
  NetworkManager-tui-1:1.20.0-5.el8_1.x86_64
  glibc-2.28-72.el8_1.1.x86_64
  glibc-common-2.28-72.el8_1.1.x86_64
  glibc-devel-2.28-72.el8_1.1.x86_64
  glibc-headers-2.28-72.el8_1.1.x86_64
  glibc-langpack-ja-2.28-72.el8_1.1.x86_64
  grub2-common-1:2.02-78.el8_1.1.noarch
  grub2-pc-1:2.02-78.el8_1.1.x86_64
  grub2-pc-modules-1:2.02-78.el8_1.1.noarch
  grub2-tools-1:2.02-78.el8_1.1.x86_64
  grub2-tools-extra-1:2.02-78.el8_1.1.x86_64
  grub2-tools-minimal-1:2.02-78.el8_1.1.x86_64
  kernel-tools-4.18.0-147.5.1.el8_1.x86_64
  kernel-tools-libs-4.18.0-147.5.1.el8_1.x86_64
  libarchive-3.3.2-8.el8_1.x86_64
  openldap-2.4.46-11.el8_1.x86_64
  openldap-devel-2.4.46-11.el8_1.x86_64
  openssh-8.0p1-4.el8_1.x86_64
  openssh-clients-8.0p1-4.el8_1.x86_64
  openssh-server-8.0p1-4.el8_1.x86_64
  policycoreutils-2.9-3.el8_1.1.x86_64
  python3-perf-4.18.0-147.5.1.el8_1.x86_64
  sqlite-libs-3.26.0-4.el8_1.x86_64
  systemd-239-18.el8_1.4.x86_64
  systemd-libs-239-18.el8_1.4.x86_64
  systemd-pam-239-18.el8_1.4.x86_64
  systemd-udev-239-18.el8_1.4.x86_64
  tuned-2.12.0-3.el8_1.1.noarch
  cacti-1.2.9-1.el8.noarch
  epel-release-8-8.el8.noarch

インストール済み:
  kernel-4.18.0-147.5.1.el8_1.x86_64
  kernel-core-4.18.0-147.5.1.el8_1.x86_64
  kernel-modules-4.18.0-147.5.1.el8_1.x86_64
  grub2-tools-efi-1:2.02-78.el8_1.1.x86_64

完了しました!

自動アップデートの方法が変わったらしい。

# dnf install dnf-automatic
メタデータの期限切れの最終確認: 0:07:14 時間前の 2020年05月01日 10時03分10秒 に 実施しました。
依存関係が解決しました。
================================================================================
 パッケージ           Arch          バージョン              リポジトリー  サイズ
================================================================================
インストール:
 dnf-automatic        noarch        4.2.7-7.el8_1           BaseOS        136 k

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

ダウンロードサイズの合計: 136 k
インストール済みのサイズ: 46 k
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
dnf-automatic-4.2.7-7.el8_1.noarch.rpm          482 kB/s | 136 kB     00:00
--------------------------------------------------------------------------------
合計                                            105 kB/s | 136 kB     00:01
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備             :                                                        1/1
  インストール中   : dnf-automatic-4.2.7-7.el8_1.noarch                     1/1
  scriptletの実行中: dnf-automatic-4.2.7-7.el8_1.noarch                     1/1
  検証             : dnf-automatic-4.2.7-7.el8_1.noarch                     1/1

インストール済み:
  dnf-automatic-4.2.7-7.el8_1.noarch

完了しました!
※ /etc/dnf/dnf-automatic.comfのapply_updates = no ⇒ yes に変える
# systemctl enable dnf-automatic
The unit files have no installation config (WantedBy, RequiredBy, Also, Alias
settings in the [Install] section, and DefaultInstance for template units).
This means they are not meant to be enabled using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
   .wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
   a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
   D-Bus, udev, scripted systemctl call, ...).
4) In case of template units, the unit is meant to be enabled with some
   instance name specified.
# systemctl start dnf-automatic

でも、systemctl status dnf-automaticで調べると
inactiveなんだけど?

yum同様にミラーリポジトリィを使う

fastestmirror=true ※ 追記する


cacti

MRTGより簡単らしいので。

参考:【CentOS7】cactiのインストール手順
CentOS7 Cactiのインストールと基本設定

dnfで epel-release とcactiをインスト
バージョンは1.2.8だった。

MySQLではなくMariaDBを使うので、
設定は/etc/my.cnf.d/mariadb-server.cnfに書くらしい。
このMariaDBのcollation_serve設定がキニイラナイらしい。

# mysql -u root -p
MariaDB [(none)]> show variables like 'coll%';
 +----------------------+--------------------+
 | Variable_name        | Value              |
 +----------------------+--------------------+
 | collation_connection | utf8mb4_general_ci |
 | collation_database   | utf8mb4_general_ci |
 | collation_server     | utf8mb4_general_ci |
 +----------------------+--------------------+

なので、collation-serverの設定を追加

[mariadb]
character-set-server=utf8mb4
collation-server = utf8mb4_unicode_ci

systemctl restart mariadb

MariaDB [(none)]> show variables like 'coll%';
 +----------------------+--------------------+
 | Variable_name        | Value              |
 +----------------------+--------------------+
 | collation_connection | utf8mb4_general_ci |
 | collation_database   | utf8mb4_unicode_ci |
 | collation_server     | utf8mb4_unicode_ci |
 +----------------------+--------------------+

以下、同様に追記

max_heap_table_size=60M
tmp_table_size=60M
join_buffer_size=119M
innodb_file_format=Barracuda
innodb_large_prefix=1
innodb_buffer_pool_size=924M
innodb_flush_log_at_timeout=4
innodb_read_io_threads=33
innodb_write_io_threads=17
innodb_buffer_pool_instances=16
innodb_io_capacity=5001
innodb_io_capacity_max=10001

cactiuserはcactiデータベースの他にmysqlデータベースへのselect権限も追加。

phpは

max_execution_time = 60
memory_limit = 400M
date.timezone 	Asia/Tokyo

それでも、
PHP – Recommendations (web)で
date.timezone>= エラーA valid timezone that matches MySQL and the system

どうやらApacheがphp-frmを使っているので
# systemctl restart php-fpm
しないとphp.iniの設定が反映されないらしい。

最後に
innodb_buffer_pool_instances=16 が1になってしまう問題が残ったが・・・

このオプションは、innodb_buffer_pool_size を 1G バイト以上のサイズに設定した場合にのみ有効になります。

引用:MySQL5.6リファレンス  14.13.1.4 複数のバッファープールインスタンスの使用

というのを見つけたので
innodb_buffer_pool_si =1024M
で解決。

LocalHostは設定済みっぽいがKVMホストの情報も見たい。

New Deviceで作成。
説明にホスト名 。(笑)
ホスト名 にIPアドレス。(大笑)
Device Template でLocal Linux Machineを選択して【保存】
新規グラフで作成。
デバイスで、先のホスト名を選択し、テンプレはLinuxを選択して【保存】

ここまではいいがレスポンスが無い様だ。snmpのコマンドで調べてみる。

# snmpwalk -v 1 192.168.XXX.XXX -c public
Timeout: No Response from 192.168.XX.XXX

何か忘れてる。否、何も設定してないじゃんか。

# yum install lm_sensors
# sensors-detec ←とりあえず全部Yesする。
# yum -y install net-snmp net-snmp-utils
# systemctl start snmpd
# systemctl enable snmpd
# firewall-cmd --add-port=161/udp --permanent
# firewall-cmd --reload

今度はsnmpwalk -v 1 192.168.XXX.XXX -c publicで色々読める。

やはり通信負荷とかCPU温度も知りたいけどテンプレには無い様だ。

ps.

# sensors
acpitz-virtual-0
Adapter: Virtual device
temp1:        +26.8°C  (crit = +90.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Core 0:       +40.0°C  (high = +105.0°C, crit = +105.0°C)
Core 1:       +40.0°C  (high = +105.0°C, crit = +105.0°C)
Core 2:       +43.0°C  (high = +105.0°C, crit = +105.0°C)
Core 3:       +43.0°C  (high = +105.0°C, crit = +105.0°C)

nct6776-isa-0290
Adapter: ISA adapter
Vcore:          +0.70 V  (min =  +0.00 V, max =  +1.74 V)
in1:            +1.85 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
AVCC:           +3.36 V  (min =  +2.98 V, max =  +3.63 V)
+3.3V:          +3.36 V  (min =  +2.98 V, max =  +3.63 V)
in4:            +0.95 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in5:            +1.72 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in6:            +0.89 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
3VSB:           +3.28 V  (min =  +2.98 V, max =  +3.63 V)
Vbat:           +3.15 V  (min =  +2.70 V, max =  +3.63 V)
fan1:           931 RPM  (min =    0 RPM)
fan2:             0 RPM  (min =    0 RPM)
fan3:             0 RPM  (min =    0 RPM)
SYSTIN:         +43.0°C  (high =  +0.0°C, hyst =  +0.0°C)  ALARM  sensor = thermistor
CPUTIN:         +40.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = thermistor
AUXTIN:         +33.5°C  (high = +80.0°C, hyst = +75.0°C)  sensor = thermistor
PCH_CHIP_TEMP:   +0.0°C
PCH_CPU_TEMP:    +0.0°C
PCH_MCH_TEMP:    +0.0°C
cpu0_vid:      +0.000 V
intrusion0:    ALARM
intrusion1:    ALARM

で、温度は判る。
OIDの表から

# snmptranslate -Tp
+--iso(1)
   |
   +--org(3)
      |
      +--dod(6)
         |
         +--internet(1)
            +--private(4)
            |  +--enterprises(1)
            |     +--ucdavis(2021)
            |     |  +--prTable(2)
            |     |  +--ucdExperimental(13)
            |     |  |  +--lmSensors(16)

ここから、CPU温度を得るにはOID 1.3.6.1.4.1.2021.13.16.2.1.3
private側なのでターゲット側のsnmp.confの設定を変更して調べてみる。

snmpwalk -v 2c -c public 192.168.***.*** .1.3.6.1.4.1.2021.13.16.2.1.3
LM-SENSORS-MIB::lmTempSensorsValue.1 = Gauge32: 26800
LM-SENSORS-MIB::lmTempSensorsValue.2 = Gauge32: 40000
LM-SENSORS-MIB::lmTempSensorsValue.3 = Gauge32: 40000
LM-SENSORS-MIB::lmTempSensorsValue.4 = Gauge32: 43000
LM-SENSORS-MIB::lmTempSensorsValue.5 = Gauge32: 43000
LM-SENSORS-MIB::lmTempSensorsValue.18 = Gauge32: 43000
LM-SENSORS-MIB::lmTempSensorsValue.19 = Gauge32: 40000
LM-SENSORS-MIB::lmTempSensorsValue.20 = Gauge32: 33500
LM-SENSORS-MIB::lmTempSensorsValue.21 = Gauge32: 0
LM-SENSORS-MIB::lmTempSensorsValue.22 = Gauge32: 0
LM-SENSORS-MIB::lmTempSensorsValue.23 = Gauge32: 0

cactiのテンプレートで
SNMP OID .1.3.6.1.4.1.2021.13.16.2.1.3 を取得するデータソースを作成する。

グラフ(CPU Temperature)を作り、デバイス(Local Linux Machine)にグラフを追加する。

しかし、テンプレに追加しただけではグラフはできないので
マネージメントのデバイスの *Create Graphs for this Device で
CPU Tempertureを追加し、グラフで確認。

しかし、

ERROR: is not a vname nor a number

ps.2023/09/09

AlmaLinuxになっているので現状を確認。

cactiのchronは5分置きに発生中。

Apacheの設定ファイルのセグメントが古かったので修正。

phpの設定が古かったみたいなので修正。

memory_limit = 512M         ; 修正 400M
max_execution_style = 60    ; 追記

https://*****/cacti から再度オンラインでセットアップ。

MariaDBのinnodb_doublewriteがONなのでOFFに変える様に指示が出たので追記した。

innodb_doublewrite=0
# systemctl restart mariadb

https://*****/cacti から再度オンラインでセットアップ。

今回は赤表示が無く、そのまま進め、アップグレードも進める。

グラフが表示されるようになった。

テンプレもアップデートしてしまったので

CPU温度の設定が消えた様だ。

ログを見ると、ずーーとエラーが連発していたらしい。

アップデートで治ったかどうか?

暫く様子見するしかなさそう。

でも、とりあえず、アンスコ。




top