我が家の自宅サーバをシャットダウンや再起動する際に、中々電源が落ちないことがありました。
原因が分からなかったので、HDDのアクセスランプが光っていない事を確認し、電源ボタン長押しで落としていました。
この時にコンソールの設定をしておいたので、今回シャットダウンの様子を見ていた所、途中で以下のログが出ていて、時間が掛かっている事が分かりました。
A start job is running for man-db-cache-update.service (**min **s / 15min)
このログは、man-dbの更新をしているようで、更新が終わるまで待たされます。直前にパッケージのインストールをしていると起こるようです。
回避策
回避策として以下を実施しました。
cron.dailyで実行
# dnf install man-db-cron メタデータの期限切れの最終確認: 1:12:13 時間前の 2021年04月24日 19時35分45秒 に実施しました。 依存関係が解決しました。 ================================================================================ パッケージ Arch バージョン リポジトリー サイズ ================================================================================ インストール: man-db-cron noarch 2.7.6.1-17.el8 baseos 19 k トランザクションの概要 ================================================================================ インストール 1 パッケージ ダウンロードサイズの合計: 19 k インストール済みのサイズ: 618 これでよろしいですか? [y/N]: y
# cat /etc/cron.daily/man-db.cron
#!/bin/bash
if [ -e /etc/sysconfig/man-db ]; then
. /etc/sysconfig/man-db
fi
if [ "$CRON" = "no" ]; then
exit 0
fi
renice +19 -p $$ >/dev/null 2>&1
ionice -c3 -p $$ >/dev/null 2>&1
LOCKFILE=/var/lock/man-db.lock
# the lockfile is not meant to be perfect, it's just in case the
# two man-db cron scripts get run close to each other to keep
# them from stepping on each other's toes. The worst that will
# happen is that they will temporarily corrupt the database
[[ -f $LOCKFILE ]] && exit 0
trap "{ rm -f $LOCKFILE ; exit 0; }" EXIT
touch $LOCKFILE
# create/update the mandb database
mandb $OPTS
exit 0
man-dbのSERVICEをnoに
# vi /etc/sysconfig/man-db
# Set this to "no" to disable man-db update triggered by installation # of any package containing manual pages SERVICE="no" ←"yes"から"no"に変更 # Set this to "no" to disable daily man-db update run by # /etc/cron.daily/man-db.cron CRON="yes" # Options used by mandb, we use "-q" as default, too much noise without it OPTS="-q"
