vague memory

うろ覚えを無くしていこうともがき苦しむ人の備忘録

Mackerel事始め agent-plugin EC2関連

agent-pluginを使ってEC2関連の監視設定を追加していきます。

IAM Policy設定

CloudWatch経由の取得のため GetMetricStatistics を IAMrole または IAMuser へ付与します。

  • cloudwatch:GetMetricStatistics
  • IAM role で設定されていれば access-key-id、secret-access-key の指定は不要

CPU credit

  • mackerel-plugin-aws-ec2-cpucredit

aws-ec2-cpucredit.conf

# mackerel-plugin-aws-ec2-cpucredit [-instance-id=<id>] [-region=<aws-region>] [-access-key-id=<id>] [-secret-access-key=<key>] [-tempfile=<tempfile>]

[plugin.metrics.aws-ec2_cpucredit]
command = "/usr/local/bin/mackerel-plugin-aws-ec2-cpucredit -access-key-id AWS_ACCESS_KEY_ID -secret-access-key AWS_SECRET_ACCESS_KEY"

f:id:htnosm:20160409180638p:plain

ダッシュボードへ反映

  • 置換文字列
__ORG__     = Organization  
__SERVICE__ = Service  
__ROLE___   = Role  
__PERIOD__  = Period {m(分), h(時間), d(日), w(週), mo(月), y(年)}  
[![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=custom.ec2.cpucredit.usage&amp;stacked=false&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=custom.ec2.cpucredit.usage)
[![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=custom.ec2.cpucredit.balance&amp;stacked=false&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=custom.ec2.cpucredit.balance)

f:id:htnosm:20160409180639p:plain

EBS

  • mackerel-plugin-aws-ec2-ebs

aws-ec2-ebs.conf

# mackerel-plugin-aws-ec2-ebs [-instance-id=<id>] [-region=<aws-region>] [-access-key-id=<id>] [-secret-access-key=<key>] [-tempfile=<tempfile>]

[plugin.metrics.aws-ec2_ebs]
command = "/usr/local/bin/mackerel-plugin-aws-ec2-ebs -access-key-id AWS_ACCESS_KEY_ID -secret-access-key AWS_SECRET_ACCESS_KEY"

f:id:htnosm:20160409180640p:plain

ダッシュボードへ反映

volume-id がメトリクス名として設定されてしまうため、同一グラフ上でまとめて表示させるには一手間掛かりそうです。
ホスト単位であれば複数ボリュームを纏めて表示できるようなので別途考えたいと思います。

mackerel-plugin-linux

  • type オプションのデフォルトはall
GLOBAL OPTIONS:
   --tempfile, -t "/tmp/mackerel-plugin-linux"  Set temporary file path. [$ENVVAR_TEMPFILE]
   --type, -p "all"             Select metrics: all, swap, netstat, diskstats, proc_stat, users [$ENVVAR_TYPE]
   --help, -h                   show help
   --version, -v                print the version

linux.conf

[plugin.metrics.linux]
command = "/usr/local/bin/mackerel-plugin-linux"
type = "metric"

f:id:htnosm:20160409180641p:plain

ダッシュボードへ反映

# process
|:---|:---|
| **# context_switches** | **# Login users** |
| [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=custom.linux.context_switches.context_switches&amp;stacked=false&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=custom.linux.context_switches.context_switches) | [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=custom.linux.users.users&amp;stacked=false&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=custom.linux.users.users) |
| **# forks** | **# interrupts(proc_stat)** |
| [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=custom.linux.forks.forks&amp;stacked=false&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=custom.linux.forks.forks) | [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=custom.linux.interrupts.interrupts&amp;stacked=false&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=custom.linux.interrupts.interrupts) |

# netstat
|:---|:---|
| **# ESTABLISHED** | **# FIN-WAIT-1** |
| [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=custom.linux.ss.ESTAB&amp;stacked=false&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=custom.linux.ss.ESTAB) | [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=custom.linux.ss.FIN-WAIT-1&amp;stacked=false&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=custom.linux.ss.FIN-WAIT-1) |
| **# LISTEN** | **# TIME-WAIT** |
| [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=custom.linux.ss.LISTEN&amp;stacked=false&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=custom.linux.ss.LISTEN) | [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=custom.linux.ss.TIME-WAIT&amp;stacked=false&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=custom.linux.ss.TIME-WAIT) |
| **# SYN-RECV** | **# SYN-SENT** |
| [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=custom.linux.ss.SYN-RECV&amp;stacked=false&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=custom.linux.ss.SYN-RECV) | [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=custom.linux.ss.SYN-SENT&amp;stacked=false&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=custom.linux.ss.SYN-SENT) |

# swap
|:---|:---|
| **# sw__ROLE__n** | **# swapout** |
| [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=custom.linux.swap.pswpin&amp;stacked=false&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=custom.linux.swap.pswpin) | [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=custom.linux.swap.pswpout&amp;stacked=false&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=custom.linux.swap.pswpout) |

f:id:htnosm:20160405195837p:plain

Mackerel事始め agent-plugin Apache

agent-pluginを使ってミドルウェアの監視設定を追加していきます。

confファイルのinclude設定

mackerel-agent.conf のコメント解除や直接追記も可能ですが、 監視対象それぞれで設定ファイルを分けたいので、 include設定を追加します。

$ cd /etc/mackerel-agent/mackerel-agent
$ sudo mkdir conf.d
$ sudo vi mackerel-agent.conf
# 以下を追記
include = "/etc/mackerel-agent/conf.d/*.conf"

プラグインの動作確認方法

共通して同じように使えると思います。

# パスの確認
$ which mackerel-plugin-XXX
/usr/local/bin/mackerel-plugin-XXX
# 値の取得確認(confに設定するcommand)
/usr/local/bin/mackerel-plugin-XXX
# オプションの確認
$ mackerel-plugin-XXX -h

mackerel-plugin-apache2

Apacheの監視設定を追加します。
Apacheのバージョンは2.2です。 mod_status が有効化されている事が前提です。

sudo vi /etc/mackerel-agent/conf.d/apache.conf
# 以下を追記
[plugin.metrics.apache2]
command = "/usr/local/bin/mackerel-plugin-apache2"
type = "metric"
  • command にはpluginのパスを指定します。
  • ポート等変更する場合はオプション指定します。
# パスの確認
$ which mackerel-plugin-apache2
/usr/local/bin/mackerel-plugin-apache2
# オプションの確認
$ mackerel-plugin-apache2 -h

取得状況の確認

mackerel-plugin-apache2 を実行することで値の取得を確認できます。

$ sudo /usr/local/bin/mackerel-plugin-apache2
apache2.workers.busy_workers    1.000000    1459133656
apache2.workers.idle_workers    230.000000  1459133656
apache2.bytes.bytes_sent    3.750000    1459133656
apache2.cpu.cpu_load    0.554053    1459133656
apache2.req.requests    3.750000    1459133656
apache2.scoreboard.score-_  230.000000  1459133656
apache2.scoreboard.score-.  793.000000  1459133656

有効化

mackerel-agent の再起動で有効化します。

# 設定確認
$ sudo service mackerel-agent configtestTesting configuration of mackerel-agent:                   [  OK  ]
# 再起動
$ sudo service mackerel-agent restart
Stopping mackerel-agent:                                   [  OK  ]
Starting mackerel-agent:
                                                           [  OK  ]

f:id:htnosm:20160405195836p:plain

ダッシュボードへ反映

  • 置換文字列
__ORG__     = Organization  
__SERVICE__ = Service  
__ROLE___   = Role  
__PERIOD__  = Period {m(分), h(時間), d(日), w(週), mo(月), y(年)}  
# Apache
|:---|:---|:---|
| **# requests** | **# cpu_load** | **# bytes_sent** |
| [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=custom.apache2.bytes.bytes_sent&amp;stacked=false&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=custom.apache2.bytes.bytes_sent) | [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=custom.apache2.req.requests&amp;stacked=false&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=custom.apache2.req.requests) | [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=custom.apache2.cpu.cpu_load&amp;stacked=false&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=custom.apache2.cpu.cpu_load) |
| **# busy_workers** | **# idle_workers** |  |
| [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=custom.apache2.scoreboard.score-.&amp;stacked=false&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=custom.apache2.scoreboard.score-.) | [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=custom.apache2.scoreboard.score-_&amp;stacked=false&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=custom.apache2.scoreboard.score-_) |  |
| **# score-** | **# score-_** |  |
| [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=custom.apache2.workers.busy_workers&amp;stacked=false&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=custom.apache2.workers.busy_workers) | [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=custom.apache2.workers.idle_workers&amp;stacked=false&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=custom.apache2.workers.idle_workers) |  |

f:id:htnosm:20160405195837p:plain

AWS RDS for PostgreSQL 拡張モニタリング

RDSの拡張モニタリング(Enhanced Monitoring)有効化組にPostgreSQLも仲間入りしたようです。

日本語にはまだ反映されていませんが、公式ドキュメントにも記載がありました。

Enhanced Monitoring is available for the following database engines: MySQL version 5.5 or later, Amazon Aurora, MariaDB, and PostgreSQL.

Dashboard

f:id:htnosm:20160329191301p:plain

Process List

f:id:htnosm:20160329191300p:plain

CloudWatch Logs

f:id:htnosm:20160329191259p:plain


標準で有効でも良いと思う機能です。
ダッシュボードのUIが洗練されると最高なんですが、今の所動作が不安定な気がします。(JST時間入れるとUTC表記になったり)
Logsに出力されるJSONもそのままでは見難いので、こちらも改善されるとうれしいです。

Mackerel事始め pluginインストール

Mackerel ヘルプ を読み進めながら実装中です。

f:id:htnosm:20160326004010j:plain

Mackerel の agent をインストールしただけの状態では、OSの基本メトリクスの収集のみですが、pluginを導入することで追加メトリクスの収集が可能になります。

mackerel-agent-plugins

ミドルウェア監視ができるようになります。 AWS ELB、RDS等の監視も agent-plugin を使用します。

公開されているコード mackerelio/mackerel-agent-plugins を見てみると、 メジャーなミドルウェアAWSサービスが含まれているようです。

mackerel-check-plugins

プロセスやログ、ポートの監視は check-plugin を使用します。

こちらもコードが公開されています。 mackerelio/go-check-plugins

インストール

yumもしくはapt-getでインストールするだけなので、Agentインストール時に併せてインストールしてしまって良いと思います。

mackerel-agent

Mackerelへログイン後の スタートガイド を参照すると手順がありますが、plugin導入の前提となるため一応記載します。

rpmパッケージ

# yumリポジトリ登録
$ curl -fsSL https://mackerel.io/assets/files/scripts/setup-yum.sh | sh
# インストール
$ sudo yum install -y mackerel-agent
# 設定ファイルへapikey登録
$ sudo sed -i.bak '1s:^:apikey = "*****"\'$'\n'':' /etc/mackerel-agent/mackerel-agent.conf
# 起動
$ sudo /etc/init.d/mackerel-agent start
# 自動起動設定確認
$ chkconfig --list mackerel-agent
mackerel-agent  0:off   1:off   2:on    3:on    4:on    5:on    6:off

debパッケージ

# aptリポジトリ登録
$ curl -fsSL https://mackerel.io/assets/files/scripts/setup-apt.sh | sh
# インストール
$ sudo apt-get install mackerel-agent
# 設定ファイルへapikey登録
$ sudo sed -i.bak '1s:^:apikey = "*****"\'$'\n'':' /etc/mackerel-agent/mackerel-agent.conf
# 起動
$ sudo /etc/init.d/mackerel-agent start

ログ確認

$ tail /var/log/mackerel-agent.log
2016/04/01 14:59:39 INFO <main> Starting mackerel-agent version:0.30.0, rev:7d278aa, apibase:https://mackerel.io
2016/04/01 14:59:39 INFO <command> Start: apibase = https://mackerel.io, hostName = *****, hostID = *****

plugins

rpmパッケージ

$ yum install mackerel-agent-plugins mackerel-check-plugins

debパッケージ

$ apt-get install mackerel-agent-plugins mackerel-check-plugins

Mackerel事始め ダッシュボードのテンプレート的なMarkdown

Mackerel を触り始めたのでメモ。

f:id:htnosm:20160324174329j:plain

Mackerel(マカレル): 新世代のサーバ管理・監視ツール では定義したサービス、ロール毎のグラフ表示が可能ですが、 標準機能だと切替表示のため一括で表示したい場合はカスタムダッシュボードを使用します。

  • Metricsを切り替えてグラフ表示を変更

f:id:htnosm:20160324174332p:plain

ダッシュボードを作成する公式手順は、各グラフから Markdown 用のコードを取得してくるということになっていますが、 毎回コピー&ペーストするのも面倒なので、 エージェント標準で取得できる項目のグラフを並べたテンプレート的な物を用意してみました。

テンプレート的なMarkdown

  • 置換文字列
__ORG__     = Organization
__SERVICE__ = Service
__ROLE___   = Role
__PERIOD__  = Period (m=分、h=時、d=日、w=週、y=年)
  • ダッシュボードテンプレート
    • 上記置換文字列を置き換え後、ダッシュボード編集欄に貼り付け
# CPU

| # loadavg5 | # CPU(user,iowait,system) |
|:-----------|:------|
| [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=loadavg5&amp;stacked=false&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=loadavg5) | [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=cpu.%7Buser%2Ciowait%2Csystem%7D&amp;stacked=true&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=cpu.%7Buser%2Ciowait%2Csystem%7D) |

---

# Memory

| # memory.used | # memory.cached |
|:-----------|:------|
| [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=memory.used&amp;stacked=false&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=memory.used) | [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=memory.cached&amp;stacked=false&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=memory.cached) |

---

# Disk I/O

| # disk.reads | # disk.writes |
|:-----------|:------|
| [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=disk.reads&amp;stacked=true&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=disk.reads) | [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=disk.writes&amp;stacked=true&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=disk.writes) |

---

# Network

| # rxBytes | # txBytes |
|:-----------|:------|
| [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=interface.rxBytes&amp;stacked=true&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=interface.rxBytes) | [![graph](https://mackerel.io/embed/orgs/__ORG__/services/__SERVICE__/__ROLE__.png?graph=interface.txBytes&amp;stacked=true&amp;simplified=false&amp;period=__PERIOD__)](https://mackerel.io/orgs/__ORG__/services/__SERVICE__/__ROLE__/-/graph?name=interface.txBytes) |

テンプレート的なダッシュボード作成

f:id:htnosm:20160324174328p:plain

作成したテンプレート的なダッシュボード

f:id:htnosm:20160324174331p:plainf:id:htnosm:20160324174330p:plain


APIでの操作まで行き着けていないですが、後々はAPIで行いたいと思います。

AWS CloudWatchでIOPS確認

AWSのディスクにはIOPS(1秒あたりの入出力操作)制限があります。

CloudWatchで確認する際EC2(EBS)とRDSでメトリクスの単位が異なるので注意が必要かと思います。

EC2 | EBS

EC2 : DiskReadOps、DiskWriteOps

指定された期間にインスタンスで利用できるすべてのエフェメラルディスクへの、完了した書き込み操作。
単位: Count

EBS : VolumeReadOps、VolumeWriteOps

指定期間内の I/O 操作の総数。
単位: Count

EC2 | EBS の IOPS

その期間の 1 秒あたりの I/O 操作回数(IOPS)の平均を算出するには、その期間の操作回数の合計をその期間の秒数で割ります。

とあるので、IOPSは以下のようになります。

  • 基本: Ops / 300秒(5分) ≒ IOPS
  • 詳細: Ops / 60秒(1分) ≒ IOPS

RDS

ReadIOPS、WriteIOPS

1 秒あたりのディスク I/O 操作の平均回数。
単位: Count/Second

  • CloudWatch 上の値 = IOPS

リクエスト数等もですが、CloudWatch上で秒単位で値表示できるようになると嬉しいです。

CentOS6 fsckを強制/抑止する

Linux起動時の自動ファイルシステムチェックを強制/抑止(スキップ)する方法です。

バージョン・ディストリビューションによっては shutdown コマンドのオプション付与や fastboot コマンドで可能なようですが、CentOS6の場合はオプションが存在しませんでした。

ファイルシステムチェックが動いた場合、通常よりOS起動時間が掛かることになります。 急いでいる時に限って実行されたりするので無効化手段の備忘録です。 尚、CentOS7の場合は、デフォルトのファイルシステムがXFSなので起動時のfsckは実行されません。

環境

次回起動時にfsckを強制

# 強制
$ sudo touch /forcefsck

次回起動時にfsckを抑止

# 抑止(スキップ)
$ sudo touch /fastboot

fsck無効化設定

設定上で起動時のファイルシステムチェックを無効化してしまえば実行されません。

# 回数(Maximum mount count)
$ sudo tune2fs -c 0 /dev/xvda1
# 期間(Check interval)
$ sudo tune2fs -i 0 /dev/xvda1

以上です。


検証

shutdown オプション

man shutdown に F、f オプションはありません。

man

OPTIONS
       -r     Requests that the system be rebooted after it has  been  brought
              down.

       -h     Requests  that  the system be either halted or powered off after
              it has been brought down, with the choice as to which left up to
              the system.

       -H     Requests  that  the  system  be halted after it has been brought
              down.

       -P     Requests that the system  be  powered  off  after  it  has  been
              brought down.

       -c     Cancels  a  running  shutdown.   TIME is not specified with this
              option, the first argument is MESSAGE.

       -k     Only send out the warning messages and disable  logins,  do  not
              actually bring the system down.

shutdown --help を見ても F、f オプションはありません。

help

Options:
  -r                          reboot after shutdown
  -h                          halt or power off after shutdown
  -H                          halt after shutdown (implies -h)
  -P                          power off after shutdown (implies -h)
  -c                          cancel a running shutdown
  -k                          only send warnings, don't shutdown
  -q, --quiet                 reduce output to errors only
  -v, --verbose               increase output to include informational
                                messages
      --help                  display this help and exit
      --version               output version information and exit

sysinitスクリプトに記述があります。

$ grep -n -e 'fastboot' -e 'forcefsck' /etc/rc.d/rc.sysinit
227:if [ -f /fastboot ] || strstr "$cmdline" fastboot ; then
228:    fastboot=yes
235:if [ -f /forcefsck ] || strstr "$cmdline" forcefsck ; then
421:if [ -z "$fastboot" -a "$READONLY" != "yes" ]; then
601:rm -f /fastboot /fsckoptions /forcefsck /.autofsck /forcequotacheck /halt \

抑止確認

再起動実行前状態

Maximum mount count を 2 に減らし、 fsck実行条件に合致する状態でOSを停止/起動して検証しました。 (Check interval の超過でも同様です。)

$ sudo tune2fs -c 2 /dev/xvda1
tune2fs 1.41.12 (17-May-2010)
Setting maximal mount count to 2
$ sudo tune2fs -l /dev/xvda1 | grep "[m|M]ount count"
Mount count:              4
Maximum mount count:      2

fsck有り

ファイルシステムチェックが実行され、Mount countがクリアされます。

$ sudo tune2fs -l /dev/xvda1 | grep "[m|M]ount count"
Mount count:              1
Maximum mount count:      2
$ cat /var/log/boot.log
・・・略・・・
ファイルシステムを検査中
すべてのファイルシステム検査します。
[/sbin/fsck.ext4 (1) -- /] fsck.ext4 -a /dev/xvda1
/: clean, 224589/6553600 files, 1663282/26213807 blocks (check in 2 mounts)
[  OK  ]
ルートファイルシステムを読み書きモードで再マウント中:  [  OK  ]
ローカルファイルシステムをマウント中:  [  OK  ]
/etc/fstab スワップスペースを有効化中:  [  OK  ]
・・・略・・・

fsck無し(fastboot)

Maximum Mount count を超えていますが、ファイルシステムチェックは実行されません。

$ sudo tune2fs -l /dev/xvda1 | grep "[m|M]ount count"
Mount count:              5
Maximum mount count:      2
$ cat /var/log/boot.log
・・・略・・・
ルートファイルシステムを読み書きモードで再マウント中:  [  OK  ]
ローカルファイルシステムをマウント中:  [  OK  ]
/etc/fstab スワップスペースを有効化中:  [  OK  ]
・・・略・・・