3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

RHEL(CentOS)7系でサービス(デーモン)一覧のエビデンスを取得する時はページャを外す

Posted at

6系のノリでやると後悔する

OSの単体試験でサービス(デーモン)の一覧を取得する時、Teratermからサーバにssh接続してコマンド実行ログをエビデンスにするのが一般的(だと思っている)。

6系までは
# chkconfig --list
の一発で問題なかった。

しかし、7系からはsystemctlコマンドになっており、
# systemctl -t service list-unit-files
と実行すると自動的に結果がページャに引き渡される。
その結果、chkconfigと同じノリで「実行して結果が返ってきたからOK」と思って調子に乗っていると、後でエビデンスを確認した時に先頭の数十行しかログに出力されておらず、エビデンスを取り直すはめになる。

コマンド実行結果をページャに引き渡さないようにするには
# systemctl -t service list-unit-files --no-pager
というように"--no-pager"オプションをつければOK。
これでページャを介さずにでサービス(デーモン)一覧が表示される。

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?