#navi(../)

* systemdでunit一覧を確認する方法 [#t58d4d9c]
systemdでunit一覧および起動しているunit一覧を表示するコマンドを以下に記します。~
使用したディストリビューションはCentOS 7になります。

#contents
#htmlinsertpcsp(linux_ads_top.html,linux-sp.html)

* 関連記事 [#oddf46fe]
-[[CentOS7でランレベルを変更する方法>CentOS/CentOS7でランレベルを変更する方法]]
-[[chkconfigはsystemctlに変更>CentOS/chkconfigはsystemctlに変更]]
-[[systemdでunit一覧を確認する方法>CentOS/systemdでunit一覧を確認する方法]]
-[[systemdのランレベル対応表>systemd/systemdのランレベル対応表]]
-[[systemdのserviceタイプ一覧を表示する方法>systemd/systemdのserviceタイプ一覧を表示する方法]]
-[[systemdのサービスログを確認する方法・journalctl>systemd/systemdのサービスログを確認する方法・journalctl]]

* systemdのunit一覧を表示する [#f87f448d]
以下のコマンドでsystemdのunit一覧を表示することができます。
 systemctl list-unit-files
以下、実行例です。
 $ systemctl list-unit-files
 UNIT FILE                                   STATE
 proc-sys-fs-binfmt_misc.automount           static
 dev-hugepages.mount                         static
 dev-mqueue.mount                            static
 proc-fs-nfsd.mount                          static
 proc-sys-fs-binfmt_misc.mount               static
 sys-fs-fuse-connections.mount               static
 sys-kernel-config.mount                     static
 sys-kernel-debug.mount                      static
 tmp.mount                                   disabled
 var-lib-nfs-rpc_pipefs.mount                static
 brandbot.path                               disabled
 cups.path                                   enabled
 systemd-ask-password-console.path           static
 systemd-ask-password-plymouth.path          static
 systemd-ask-password-wall.path              static
 session-1.scope                             static
 session-c1.scope                            static
 abrt-ccpp.service                           enabled
 abrt-oops.service                           enabled
 abrt-pstoreoops.service                     disabled
 abrt-vmcore.service                         enabled
 abrt-xorg.service                           enabled

* 起動しているunit一覧を表示する方法 [#bf36b4f8]
以下のコマンドで起動しているunit一覧を表示することができます。
 systemctl list-units
以下、実行例です。
 $ systemctl list-units
 UNIT                                                           LOAD   ACTIVE SUB       DESCRIPTION
 proc-sys-fs-binfmt_misc.automount                              loaded active waiting   Arbitrary Executable File Formats File System Automount Point
 sys-devices-pci0000:...t1-target1:0:0-1:0:0:0-block-sr0.device loaded active plugged   VBOX_CD-ROM
 sys-devices-pci0000:00-0000:00:03.0-net-enp0s3.device          loaded active plugged   PRO/1000 MT Desktop Adapter
 sys-devices-pci0000:00-0000:00:08.0-net-enp0s8.device          loaded active plugged   PRO/1000 MT Desktop Adapter
 sys-devices-pci0000:...rget2:0:0-2:0:0:0-block-sda-sda1.device loaded active plugged   VBOX_HARDDISK
 sys-devices-pci0000:...rget2:0:0-2:0:0:0-block-sda-sda2.device loaded active plugged   LVM PV 718M1V-7Mee-AlpT-muEN-5bFf-P0jY-N0qC3s on /dev/sda2
 sys-devices-pci0000:...t2-target2:0:0-2:0:0:0-block-sda.device loaded active plugged   VBOX_HARDDISK
 sys-devices-platform-serial8250-tty-ttyS0.device               loaded active plugged   /sys/devices/platform/serial8250/tty/ttyS0
 sys-devices-platform-serial8250-tty-ttyS1.device               loaded active plugged   /sys/devices/platform/serial8250/tty/ttyS1
 sys-devices-platform-serial8250-tty-ttyS2.device               loaded active plugged   /sys/devices/platform/serial8250/tty/ttyS2
 sys-devices-platform-serial8250-tty-ttyS3.device               loaded active plugged   /sys/devices/platform/serial8250/tty/ttyS3
 sys-devices-virtual-block-dm\x2d0.device                       loaded active plugged   /sys/devices/virtual/block/dm-0
 sys-devices-virtual-block-dm\x2d1.device                       loaded active plugged   /sys/devices/virtual/block/dm-1
 sys-module-configfs.device                                     loaded active plugged   /sys/module/configfs
 sys-subsystem-net-devices-enp0s3.device                        loaded active plugged   PRO/1000 MT Desktop Adapter
 sys-subsystem-net-devices-enp0s8.device                        loaded active plugged   PRO/1000 MT Desktop Adapter
 -.mount                                                        loaded active mounted   /
 boot.mount                                                     loaded active mounted   /boot

以上、systemdのsystemctlコマンドを使ってunit一覧に関する情報を表示する方法でした。


#htmlinsertpcsp(linux_ads_btm.html,linux-sp.html)

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS