RHELでハマった際の対応や、調査コマンドのメモ
1 |
systemctl list-unit-files -t service |
下記のエラーがでてしまった、“/etc/fstab“の書き方を過ったため”/“が読み取り専用でマウントされた様子
E303: Unable to open swap file for ”/etc/fstab”, recovery impossible
1 2 |
#下記のコマンドでrwでボリュームを再マウントして"/etc/fstab"を書き換えることで復旧 mount -o remount,rw -t xfs UUID=[UUID] / |
RHEL5.3以降ではOS 起動時の/var/log/boot.logへのログ出力は initlog 機能の提供終了により行われなくなった。
RHEL6以降ではplymouthパッケージを追加することで/var/log/boot.logへのログ出力が可能となる。
1 2 3 4 5 6 7 8 |
#plymouthのインストール dnf install plymouth #initramfsを上書き更新するためのコマンド dracut -f #適用 reboot |
1 2 3 4 5 |
#ディレクトリパス配下のディレクトリを再帰的に755へ変更 find [ディレクトリパス] - type d - exec chmod 755 {} + #ディレクトリパス配下のファイルを再帰的に644へ変更 find [ディレクトリパス] - type f - exec chmod 644 {} + |
1 |
ls -lha |
1 |
stat -- format = "%a %F %U %G %n" * |
1 |
netstat | grep tcp | wc -l |
1 |
ss -ltunp |
1 |
grep [文字列] -ril [ディレクトリパス] |
1 |
find [ディレクトリパス] - type f -name "*[文字列]*" |
https://linuxjm.osdn.jp/html/util-linux/man1/logger.1.html
1 2 3 4 5 |
#local5.infoを出してみる logger -p local5.info -t test01 -- id =0 -- This is test . #リモートのsyslogサーバ宛に書き込んでみる。 logger "hello" -i -t "sample" -n 192.168.0.1 |