Angstrom systemd - kinneko/BBBB GitHub Wiki
Angstromでは、システム・サービスマネージャーとして、sysvinitと互換性のあるsystemdを採用しています。
組み込みLinux環境では、旧来のsysvinitが使われていることが多いのですが、UbuntuのUpstart採用など、システム・サービスマネージャーとしてのsysvinitは、機能が不足しており次世代に変わりつつあります。OpenEmbeddedでは、まだsysvinitベースでの実装が行われていますが、Angstromでは最新のsystemd環境が採用されています。
systemdは、起動時のサービス起動や設定を並列化して拘束に起動するだけでなく、動作中のサービスの動的管理も行います。syslog等、旧来のUNIXシステムで管理されていた一部の機能も代替することができます。cgroups によるプロセス管理も行うことができます。いまのところ、sysvinitとの互換性もあります。
ここでは、サービスの死活管理を中心に説明します。
起動時には、initに替わって、systemdが起動されます。Angstromでは、/sbin/initは、/lib/systemd/systemdへのシンボリックリンクになっています。
root@beaglebone:~# ls -l /sbin/init
lrwxrwxrwx 1 root root 20 Mar 18 2013 /sbin/init -> /lib/systemd/systemd
動作のルールはユニットと呼ばれる単位で管理されます。主なユニットは、service, target, mount, swap, device, socketに大別されます。それぞれ設定ファルによって管理されています。依存関係や、動作順序の定義も可能です。ユニットのうち、mount, swapはfstabから、deviceはudevによって自動生成されます。
systemdは、はじめに、設定を調べて、依存関係と起動順序をもとに、ユニットを起動してゆきします。このとき、順序や依存関係のないものは、極力同時に実行することにより、起動時間の短縮を行っています。
依存関係の調査は、/lib/systemd/system/default.targetに書かれたユニットから開始します。一般に、default.targetは、シンボリックリンクになっていて、従来のsysvinitのrunlevelによる制御はこのシンボリックリンクの変更によって行います。
sysvinit相当の設定は、runlevel.targetとしてシンボリックリンクに残されています。
/lib/systemd/system/runlevel0.target -> poweroff.target
/lib/systemd/system/runlevel2.target -> multi-user.target
/lib/systemd/system/runlevel3.target -> multi-user.target
/lib/systemd/system/runlevel4.target -> multi-user.target
/lib/systemd/system/runlevel5.target -> graphical.target
/lib/systemd/system/runlevel6.target -> reboot.target
BeagleBone Blackのdefault.targetは、graphical.targetに設定されています。
root@beaglebone:~# ls -l /lib/systemd/system/default.target
lrwxrwxrwx 1 root root 16 Mar 18 2013 /lib/systemd/system/default.target -> graphical.target
ユニットの設定ファイルは、/etc/systemd/system/に置かれます。デフォルト設定は、/lib/systemd/system/, /usr/lib/systemd/system/にあります。同名のファイルがある場合は、/etcの配下が優先されるので、デフォルト設定がある場合は、/etc配下にコピーして改変するのがいいでしょう。
Angstromでは、/usr/lib/systemd/system/は使用していないようです。
root@beaglebone:~# ls /usr/lib/systemd/system/
ls: cannot access /usr/lib/systemd/system/: No such file or directory
/lib/systemd/system/にデフォルト設定がありました。
root@beaglebone:~# find /lib/systemd/system/
/lib/systemd/system/
/lib/systemd/system/systemd-readahead-drop.service
/lib/systemd/system/[email protected]
/lib/systemd/system/console-getty.service
/lib/systemd/system/bonescript-autorun.service
/lib/systemd/system/[email protected]
/lib/systemd/system/systemd-update-utmp-shutdown.service
/lib/systemd/system/systemd-readahead-done.timer
/lib/systemd/system/runlevel1.target
/lib/systemd/system/emergency.service
/lib/systemd/system/ctrl-alt-del.target
/lib/systemd/system/systemd-readahead-collect.service
/lib/systemd/system/sigpwr.target
/lib/systemd/system/debug-shell.service
/lib/systemd/system/dbus-org.freedesktop.hostname1.service
/lib/systemd/system/systemd-fsck-root.service
/lib/systemd/system/cloud9.service
/lib/systemd/system/systemd-journald.service
/lib/systemd/system/umount.target
/lib/systemd/system/[email protected]
/lib/systemd/system/systemd-journal-flush.service
/lib/systemd/system/[email protected]
/lib/systemd/system/runlevel4.target.wants
/lib/systemd/system/runlevel4.target.wants/systemd-update-utmp-runlevel.service
/lib/systemd/system/proc-sys-fs-binfmt_misc.automount
/lib/systemd/system/runlevel5.target.wants
/lib/systemd/system/runlevel5.target.wants/systemd-update-utmp-runlevel.service
/lib/systemd/system/basic.target
/lib/systemd/system/systemd-udevd-kernel.socket
/lib/systemd/system/syslog.socket
/lib/systemd/system/systemd-shutdownd.service
/lib/systemd/system/systemd-binfmt.service
/lib/systemd/system/systemd-initctl.socket
/lib/systemd/system/halt.target
/lib/systemd/system/time-sync.target
/lib/systemd/system/runlevel0.target
/lib/systemd/system/getty.target
/lib/systemd/system/gdm.service
/lib/systemd/system/systemd-readahead-done.service
/lib/systemd/system/sys-kernel-debug.mount
/lib/systemd/system/gateone.service
/lib/systemd/system/syslog.service
/lib/systemd/system/mpd.service
/lib/systemd/system/hibernate.target
/lib/systemd/system/[email protected]
/lib/systemd/system/shutdown.target
/lib/systemd/system/proc-sys-fs-binfmt_misc.mount
/lib/systemd/system/dropbearkey.service
/lib/systemd/system/dbus-1.service
/lib/systemd/system/syslog.target
/lib/systemd/system/hybrid-sleep.target
/lib/systemd/system/storage-gadget-init.service
/lib/systemd/system/reboot.target
/lib/systemd/system/graphical.target
/lib/systemd/system/local-fs-pre.target
/lib/systemd/system/dbus.service
/lib/systemd/system/systemd-tmpfiles-clean.service
/lib/systemd/system/console-shell.service
/lib/systemd/system/rescue.service
/lib/systemd/system/sys-kernel-config.mount
/lib/systemd/system/systemd-update-utmp-runlevel.service
/lib/systemd/system/sysinit.target
/lib/systemd/system/systemd-remount-fs.service
/lib/systemd/system/smartcard.target
/lib/systemd/system/ntpdate.service
/lib/systemd/system/sockets.target.wants
/lib/systemd/system/sockets.target.wants/systemd-udevd-kernel.socket
/lib/systemd/system/sockets.target.wants/systemd-initctl.socket
/lib/systemd/system/sockets.target.wants/systemd-udevd-control.socket
/lib/systemd/system/sockets.target.wants/systemd-journald.socket
/lib/systemd/system/sockets.target.wants/dbus.socket
/lib/systemd/system/sockets.target.wants/systemd-shutdownd.socket
/lib/systemd/system/runlevel2.target
/lib/systemd/system/systemd-hibernate.service
/lib/systemd/system/systemd-kexec.service
/lib/systemd/system/xinput-calibrator.service
/lib/systemd/system/runlevel6.target
/lib/systemd/system/avahi-daemon.socket
/lib/systemd/system/bonescript.service
/lib/systemd/system/runlevel1.target.wants
/lib/systemd/system/runlevel1.target.wants/systemd-update-utmp-runlevel.service
/lib/systemd/system/systemd-reboot.service
/lib/systemd/system/poweroff.target
/lib/systemd/system/systemd-tmpfiles-clean.timer
/lib/systemd/system/systemd-timedated.service
/lib/systemd/system/systemd-readahead-replay.service
/lib/systemd/system/runlevel4.target
/lib/systemd/system/systemd-ask-password-wall.service
/lib/systemd/system/systemd-sysctl.service
/lib/systemd/system/leds.service
/lib/systemd/system/final.target
/lib/systemd/system/runlevel5.target
/lib/systemd/system/systemd-random-seed-load.service
/lib/systemd/system/systemd-quotacheck.service
/lib/systemd/system/basic.target.wants
/lib/systemd/system/basic.target.wants/systemd-tmpfiles-clean.timer
/lib/systemd/system/basic.target.wants/alsa-restore.service
/lib/systemd/system/basic.target.wants/machineid.service
/lib/systemd/system/basic.target.wants/run-postinsts.service
/lib/systemd/system/basic.target.wants/console-kit-log-system-start.service
/lib/systemd/system/systemd-modules-load.service
/lib/systemd/system/bonescript.socket
/lib/systemd/system/tmp.mount
/lib/systemd/system/systemd-udevd.service
/lib/systemd/system/suspend.target
/lib/systemd/system/dropbear.socket
/lib/systemd/system/systemd-ask-password-wall.path
/lib/systemd/system/cpu-ondemand.timer
/lib/systemd/system/systemd-udev-trigger.service
/lib/systemd/system/dev-mqueue.mount
/lib/systemd/system/default.target
/lib/systemd/system/systemd-localed.service
/lib/systemd/system/runlevel3.target
/lib/systemd/system/quotaon.service
/lib/systemd/system/systemd-initctl.service
/lib/systemd/system/reboot.target.wants
/lib/systemd/system/reboot.target.wants/console-kit-log-system-restart.service
/lib/systemd/system/console-kit-log-system-restart.service
/lib/systemd/system/console-kit-daemon.service
/lib/systemd/system/systemd-hostnamed.service
/lib/systemd/system/remote-fs.target
/lib/systemd/system/[email protected]
/lib/systemd/system/busybox-syslog.service
/lib/systemd/system/dropbear.service
/lib/systemd/system/printer.target
/lib/systemd/system/dbus-org.freedesktop.login1.service
/lib/systemd/system/sound.target
/lib/systemd/system/rescue.target
/lib/systemd/system/bluetooth.target
/lib/systemd/system/udhcpd.service
/lib/systemd/system/systemd-user-sessions.service
/lib/systemd/system/sysinit.target.wants
/lib/systemd/system/sysinit.target.wants/systemd-journald.service
/lib/systemd/system/sysinit.target.wants/systemd-journal-flush.service
/lib/systemd/system/sysinit.target.wants/proc-sys-fs-binfmt_misc.automount
/lib/systemd/system/sysinit.target.wants/systemd-binfmt.service
/lib/systemd/system/sysinit.target.wants/sys-kernel-debug.mount
/lib/systemd/system/sysinit.target.wants/sys-kernel-config.mount
/lib/systemd/system/sysinit.target.wants/systemd-sysctl.service
/lib/systemd/system/sysinit.target.wants/systemd-random-seed-load.service
/lib/systemd/system/sysinit.target.wants/systemd-modules-load.service
/lib/systemd/system/sysinit.target.wants/systemd-udevd.service
/lib/systemd/system/sysinit.target.wants/systemd-udev-trigger.service
/lib/systemd/system/sysinit.target.wants/dev-mqueue.mount
/lib/systemd/system/sysinit.target.wants/dev-hugepages.mount
/lib/systemd/system/sysinit.target.wants/machineid.service
/lib/systemd/system/sysinit.target.wants/sys-fs-fuse-connections.mount
/lib/systemd/system/sysinit.target.wants/run-postinsts.service
/lib/systemd/system/sysinit.target.wants/systemd-ask-password-console.path
/lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup.service
/lib/systemd/system/mail-transfer-agent.target
/lib/systemd/system/crond.service
/lib/systemd/system/console-kit-log-system-stop.service
/lib/systemd/system/[email protected]
/lib/systemd/system/systemd-udev-settle.service
/lib/systemd/system/dev-hugepages.mount
/lib/systemd/system/sleep.target
/lib/systemd/system/bluetooth.service
/lib/systemd/system/shutdown.target.wants
/lib/systemd/system/shutdown.target.wants/systemd-update-utmp-shutdown.service
/lib/systemd/system/shutdown.target.wants/systemd-random-seed-save.service
/lib/systemd/system/shutdown.target.wants/alsa-store.service
/lib/systemd/system/local-fs.target.wants
/lib/systemd/system/local-fs.target.wants/systemd-fsck-root.service
/lib/systemd/system/local-fs.target.wants/systemd-remount-fs.service
/lib/systemd/system/local-fs.target.wants/tmp.mount
/lib/systemd/system/systemd-udevd-control.socket
/lib/systemd/system/multi-user.target.wants
/lib/systemd/system/multi-user.target.wants/getty.target
/lib/systemd/system/multi-user.target.wants/dbus.service
/lib/systemd/system/multi-user.target.wants/systemd-ask-password-wall.path
/lib/systemd/system/multi-user.target.wants/systemd-user-sessions.service
/lib/systemd/system/multi-user.target.wants/bone-tester.service
/lib/systemd/system/multi-user.target.wants/systemd-logind.service
/lib/systemd/system/alsa-restore.service
/lib/systemd/system/systemd-hybrid-sleep.service
/lib/systemd/system/avahi-daemon.service
/lib/systemd/system/poweroff.target.wants
/lib/systemd/system/poweroff.target.wants/console-kit-log-system-stop.service
/lib/systemd/system/dbus-org.freedesktop.timedate1.service
/lib/systemd/system/multi-user.target
/lib/systemd/system/avahi-dnsconfd.service
/lib/systemd/system/nss-user-lookup.target
/lib/systemd/system/runlevel3.target.wants
/lib/systemd/system/runlevel3.target.wants/systemd-update-utmp-runlevel.service
/lib/systemd/system/bone-tester.service
/lib/systemd/system/systemd-logind.service
/lib/systemd/system/halt.target.wants
/lib/systemd/system/halt.target.wants/console-kit-log-system-stop.service
/lib/systemd/system/swap.target
/lib/systemd/system/network.target
/lib/systemd/system/systemd-random-seed-save.service
/lib/systemd/system/runlevel2.target.wants
/lib/systemd/system/runlevel2.target.wants/systemd-update-utmp-runlevel.service
/lib/systemd/system/local-fs.target
/lib/systemd/system/ofono.service
/lib/systemd/system/nss-lookup.target
/lib/systemd/system/systemd-poweroff.service
/lib/systemd/system/alsa-store.service
/lib/systemd/system/rpcbind.target
/lib/systemd/system/udisks-daemon.service
/lib/systemd/system/systemd-journald.socket
/lib/systemd/system/machineid.service
/lib/systemd/system/sys-fs-fuse-connections.mount
/lib/systemd/system/graphical.target.wants
/lib/systemd/system/cpu-ondemand.service
/lib/systemd/system/[email protected]
/lib/systemd/system/systemd-ask-password-console.service
/lib/systemd/system/dbus.socket
/lib/systemd/system/systemd-halt.service
/lib/systemd/system/dbus.target.wants
/lib/systemd/system/dbus.target.wants/dbus.socket
/lib/systemd/system/sockets.target
/lib/systemd/system/run-postinsts.service
/lib/systemd/system/connman.service
/lib/systemd/system/emergency.target
/lib/systemd/system/systemd-suspend.service
/lib/systemd/system/[email protected]
/lib/systemd/system/system-update.target
/lib/systemd/system/remote-fs-pre.target
/lib/systemd/system/wpa_supplicant.service
/lib/systemd/system/busybox-klogd.service
/lib/systemd/system/systemd-ask-password-console.path
/lib/systemd/system/dbus-org.freedesktop.locale1.service
/lib/systemd/system/kexec.target.wants
/lib/systemd/system/kexec.target.wants/console-kit-log-system-restart.service
/lib/systemd/system/systemd-shutdownd.socket
/lib/systemd/system/systemd-tmpfiles-setup.service
/lib/systemd/system/console-kit-log-system-start.service
/lib/systemd/system/kexec.target
いくつかのデフォルト設定は、/usr/lib/systemd/の下にもありました。
root@beaglebone:~# find /usr/lib/systemd/
/usr/lib/systemd/
/usr/lib/systemd/ntp-units.d
/usr/lib/systemd/user-generators
/usr/lib/systemd/user
/usr/lib/systemd/user/shutdown.target
/usr/lib/systemd/user/default.target
/usr/lib/systemd/user/printer.target
/usr/lib/systemd/user/sound.target
/usr/lib/systemd/user/bluetooth.target
/usr/lib/systemd/user/systemd-exit.service
/usr/lib/systemd/user/exit.target
/usr/lib/systemd/user/sockets.target
/usr/lib/systemd/catalog
/usr/lib/systemd/catalog/systemd.catalog
BeagleBone BlackのAngstrom環境では、ローカル環境でのデフォルト設定は以下がありました。
root@beaglebone:~# find /etc/systemd/system/
/etc/systemd/system/
/etc/systemd/system/dnsmasq.service
/etc/systemd/system/syslog.service
/etc/systemd/system/syslog.busybox.service
/etc/systemd/system/sockets.target.wants
/etc/systemd/system/sockets.target.wants/avahi-daemon.socket
/etc/systemd/system/sockets.target.wants/bonescript.socket
/etc/systemd/system/sockets.target.wants/dropbear.socket
/etc/systemd/system/xinetd.service
/etc/systemd/system/networking.service
/etc/systemd/system/display-manager.service
/etc/systemd/system/basic.target.wants
/etc/systemd/system/basic.target.wants/storage-gadget-init.service
/etc/systemd/system/basic.target.wants/leds.service
/etc/systemd/system/hwclock.service
/etc/systemd/system/busybox-udhcpc.service
/etc/systemd/system/sysinit.target.wants
/etc/systemd/system/getty.target.wants
/etc/systemd/system/getty.target.wants/[email protected]
/etc/systemd/system/getty.target.wants/[email protected]
/etc/systemd/system/getty.target.wants/[email protected]
/etc/systemd/system/local-fs.target.wants
/etc/systemd/system/multi-user.target.wants
/etc/systemd/system/multi-user.target.wants/bonescript-autorun.service
/etc/systemd/system/multi-user.target.wants/cloud9.service
/etc/systemd/system/multi-user.target.wants/gateone.service
/etc/systemd/system/multi-user.target.wants/mpd.service
/etc/systemd/system/multi-user.target.wants/dropbearkey.service
/etc/systemd/system/multi-user.target.wants/ntpdate.service
/etc/systemd/system/multi-user.target.wants/cpu-ondemand.timer
/etc/systemd/system/multi-user.target.wants/remote-fs.target
/etc/systemd/system/multi-user.target.wants/crond.service
/etc/systemd/system/multi-user.target.wants/avahi-daemon.service
/etc/systemd/system/multi-user.target.wants/connman.service
/etc/systemd/system/dbus-org.freedesktop.Avahi.service
設定ファイルのドットより前が、そのまま制御用のユニット名になります。ドットより後は、ユニットの種別を表します。
graphical.targetの内容を見てみましょう。
root@beaglebone:~# cat /lib/systemd/system/graphical.target
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Graphical Interface
Documentation=man:systemd.special(7)
Requires=multi-user.target
After=multi-user.target
Conflicts=rescue.target
Wants=display-manager.service
AllowIsolate=yes
[Install]
Alias=default.target
Requires, After, Conflicts, Wants, AllowIsolateなどで、起動順序や前提条件(排他含む)が定義されているのがわかります。
serviceユニットは、デーモンの死活管理に関わるものです。単純な例として、LEDサービスの設定についてファイルの中を見てみましょう。
root@beaglebone:~# cat /etc/systemd/system/basic.target.wants/leds.service
[Unit]
Description=Angstrom LED config
ConditionPathExists=|/sys/class/leds
After=remount-rootfs.service
[Service]
RemainAfterExit=yes
ExecStart=/usr/bin/led-config start
ExecStop=/usr/bin/led-config stop
[Install]
WantedBy=basic.target
内容は、Unit, Service, Installに分かれています。WantedByで依存関係を、Afterで起動順序が定義されています。
ユニットの起動管理は、systemctlコマンドで行います。サービスもユニットとして管理されます。
systemctlコマンドは以下のように使用します。
- 現在有効なユニットを表示: $ systemctl list-units
- 定義済みユニットと状態の一覧: $ systemctl list-unit-files
- 特定のタイプの定義済みユニットと状態の一覧: $ systemctl list-unit-files --type
- 状態を表示: $ systemctl status
- ユニットを実行: # systemctl start
- ユニットを停止: # systemctl stop
- ユニットを再始動: # systemctl restart
- 設定を再読み込み: # systemctl reload
- 起動時に自動で実行: $ systemctl is-enabled
- 起動時に自動実行: # systemctl enable
- 自動実行の無効化: # systemctl disable
- systemd をリロード: # systemctl daemon-reload
- 依存するユニットの表示: $ systemctl list-dependencies
- 全ての起動ユニットの依存ユニットの表示:$ systemctl list-dependencies --all
- 先に起動が必要なユニットの表示: $ systemctl list-dependencies --after
- 後に起動が必要なユニットの表示: $ systemctl list-dependencies --before
いくつかの実行例を記録しておきます。
root@beaglebone:~# systemctl status
Too few arguments.
root@beaglebone:~# systemctl status --all
Too few arguments.
root@beaglebone:~# systemctl list-units
UNIT LOAD ACTIVE SUB DESCRIPTION
proc-sys...t_misc.automount loaded active running Arbitrary Executable File Fo
sys-devi...tty-ttyO0.device loaded active plugged /sys/devices/ocp.2/44e09000.
sys-devi...ty-ttyGS0.device loaded active plugged /sys/devices/ocp.2/47400000.
sys-devi...-net-eth0.device loaded active plugged /sys/devices/ocp.2/4a100000.
sys-devi...blk0boot0.device loaded active plugged /sys/devices/ocp.2/mmc.10/mm
sys-devi...blk0boot1.device loaded active plugged /sys/devices/ocp.2/mmc.10/mm
sys-devi...mmcblk0p1.device loaded active plugged /sys/devices/ocp.2/mmc.10/mm
sys-devi...mmcblk0p2.device loaded active plugged /sys/devices/ocp.2/mmc.10/mm
sys-devi...k-mmcblk0.device loaded active plugged /sys/devices/ocp.2/mmc.10/mm
sys-devi...und-card0.device loaded active plugged /sys/devices/ocp.2/sound.13/
sys-devi...tty-ttyS0.device loaded active plugged /sys/devices/platform/serial
sys-devi...tty-ttyS1.device loaded active plugged /sys/devices/platform/serial
sys-devi...tty-ttyS2.device loaded active plugged /sys/devices/platform/serial
sys-devi...tty-ttyS3.device loaded active plugged /sys/devices/platform/serial
sys-module-fuse.device loaded active plugged /sys/module/fuse
sys-subs...ices-eth0.device loaded active plugged /sys/subsystem/net/devices/e
-.mount loaded active mounted /
dev-mqueue.mount loaded active mounted POSIX Message Queue File Sys
home-root-.gvfs.mount loaded active mounted /home/root/.gvfs
media-BEAGLEBONE.mount loaded active mounted /media/BEAGLEBONE
proc-sys...infmt_misc.mount loaded active mounted Arbitrary Executable File Fo
sys-fs-f...onnections.mount loaded active mounted FUSE Control File System
sys-kernel-debug.mount loaded active mounted Debug File System
tmp.mount loaded active mounted /tmp
systemd-...ord-console.path loaded active waiting Dispatch Password Requests t
systemd-...ssword-wall.path loaded active waiting Forward Password Requests to
avahi-daemon.service loaded active running Avahi mDNS/DNS-SD Stack
bonescript-autorun.service loaded active running Bonescript autorun
cloud9.service loaded active running Cloud9 IDE
connman.service loaded active running Connection service
console-kit-daemon.service loaded active running Console Manager
console-...em-start.service loaded active exited Console System Startup Loggi
crond.service loaded active running Periodic Command Scheduler
dbus.service loaded active running D-Bus System Message Bus
dropbear...00:49307.service loaded active running SSH Per-Connection Server
gateone.service loaded active running GateOne daemon
gdm.service loaded active running Gnome Display Manager
[email protected] loaded active running Getty on tty1
leds.service loaded active exited Angstrom LED config
mpd.service loaded active running Music Player Daemon
ntpdate.service loaded active exited Network Time Service (one-sh
[email protected] loaded active running Serial Getty on ttyGS0
[email protected] loaded active running Serial Getty on ttyO0
storage-gadget-init.service loaded active running Start usb mass storage gadge
systemd-journald.service loaded active running Journal Service
systemd-logind.service loaded active running Login Service
systemd-...les-load.service loaded active exited Load Kernel Modules
systemd-remount-fs.service loaded active exited Remount Root and Kernel File
systemd-sysctl.service loaded active exited Apply Kernel Variables
systemd-...es-setup.service loaded active exited Recreate Volatile Files and
systemd-...-trigger.service loaded active exited udev Coldplug all Devices
systemd-udevd.service loaded active running udev Kernel Device Manager
systemd-...sessions.service loaded active exited Permit User Sessions
udisks-daemon.service loaded active running Disk Manager
wpa_supplicant.service loaded active running WPA supplicant
avahi-daemon.socket loaded active running Avahi mDNS/DNS-SD Stack Acti
bonescript.socket loaded active listening bonescript.socket
dbus.socket loaded active running D-Bus System Message Bus Soc
dropbear.socket loaded active listening dropbear.socket
systemd-initctl.socket loaded active listening /dev/initctl Compatibility N
systemd-journald.socket loaded active running Journal Socket
systemd-shutdownd.socket loaded active listening Delayed Shutdown Socket
systemd-...d-control.socket loaded active listening udev Control Socket
systemd-udevd-kernel.socket loaded active running udev Kernel Socket
basic.target loaded active active Basic System
getty.target loaded active active Login Prompts
graphical.target loaded active active Graphical Interface
local-fs-pre.target loaded active active Local File Systems (Pre)
local-fs.target loaded active active Local File Systems
multi-user.target loaded active active Multi-User
remote-fs.target loaded active active Remote File Systems
sockets.target loaded active active Sockets
sound.target loaded active active Sound Card
swap.target loaded active active Swap
sysinit.target loaded active active System Initialization
cpu-ondemand.timer loaded active elapsed Switches to ondemand CPU-fre
systemd-...iles-clean.timer loaded active waiting Daily Cleanup of Temporary D
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
77 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
root@beaglebone:~# systemctl list-unit-files
UNIT FILE STATE
proc-sys-fs-binfmt_misc.automount static
dev-hugepages.mount static
dev-mqueue.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 static
systemd-ask-password-console.path static
systemd-ask-password-wall.path static
alsa-restore.service static
alsa-store.service static
[email protected] disabled
avahi-daemon.service enabled
avahi-dnsconfd.service disabled
bluetooth.service disabled
bone-tester.service disabled
bonescript-autorun.service enabled
bonescript.service static
busybox-klogd.service disabled
busybox-syslog.service enabled
busybox-udhcpc.service masked
cloud9.service enabled
connman.service enabled
console-getty.service disabled
console-kit-daemon.service disabled
console-kit-log-system-restart.service static
console-kit-log-system-start.service static
console-kit-log-system-stop.service static
console-shell.service disabled
cpu-ondemand.service static
crond.service enabled
dbus-1.service masked
dbus-org.freedesktop.Avahi.service enabled
dbus-org.freedesktop.hostname1.service static
dbus-org.freedesktop.locale1.service static
dbus-org.freedesktop.login1.service static
dbus-org.freedesktop.timedate1.service static
dbus.service static
debug-shell.service disabled
display-manager.service enabled
dnsmasq.service masked
dropbear.service masked
[email protected] static
dropbearkey.service enabled
emergency.service static
gateone.service enabled
gdm.service enabled
[email protected] enabled
hwclock.service masked
leds.service enabled
machineid.service disabled
mpd.service enabled
networking.service masked
ntpdate.service enabled
ofono.service disabled
quotaon.service static
rescue.service static
run-postinsts.service disabled
[email protected] enabled
storage-gadget-init.service enabled
syslog.busybox.service masked
syslog.service enabled
systemd-ask-password-console.service static
systemd-ask-password-wall.service static
systemd-binfmt.service static
systemd-fsck-root.service static
[email protected] static
systemd-halt.service static
systemd-hibernate.service static
systemd-hostnamed.service static
systemd-hybrid-sleep.service static
systemd-initctl.service static
systemd-journal-flush.service static
systemd-journald.service static
systemd-kexec.service static
systemd-localed.service static
systemd-logind.service static
systemd-modules-load.service static
systemd-poweroff.service static
systemd-quotacheck.service static
systemd-random-seed-load.service static
systemd-random-seed-save.service static
systemd-readahead-collect.service disabled
systemd-readahead-done.service static
systemd-readahead-drop.service disabled
systemd-readahead-replay.service disabled
systemd-reboot.service static
systemd-remount-fs.service static
systemd-shutdownd.service static
systemd-suspend.service static
systemd-sysctl.service static
systemd-timedated.service static
systemd-tmpfiles-clean.service static
systemd-tmpfiles-setup.service static
systemd-udev-settle.service static
systemd-udev-trigger.service static
systemd-udevd.service static
systemd-update-utmp-runlevel.service static
systemd-update-utmp-shutdown.service static
systemd-user-sessions.service static
udhcpd.service disabled
udisks-daemon.service disabled
[email protected] static
[email protected] disabled
[email protected] disabled
wpa_supplicant.service disabled
[email protected] disabled
xinetd.service masked
xinput-calibrator.service disabled
avahi-daemon.socket enabled
bonescript.socket enabled
dbus.socket static
dropbear.socket enabled
syslog.socket static
systemd-initctl.socket static
systemd-journald.socket static
systemd-shutdownd.socket static
systemd-udevd-control.socket static
systemd-udevd-kernel.socket static
basic.target static
bluetooth.target static
ctrl-alt-del.target disabled
default.target disabled
emergency.target static
final.target static
getty.target static
graphical.target disabled
halt.target disabled
hibernate.target static
hybrid-sleep.target static
kexec.target disabled
local-fs-pre.target static
local-fs.target static
mail-transfer-agent.target static
multi-user.target disabled
network.target static
nss-lookup.target static
nss-user-lookup.target static
poweroff.target disabled
printer.target static
reboot.target disabled
remote-fs-pre.target static
remote-fs.target enabled
rescue.target disabled
rpcbind.target static
runlevel0.target disabled
runlevel1.target disabled
runlevel2.target disabled
runlevel3.target disabled
runlevel4.target disabled
runlevel5.target disabled
runlevel6.target disabled
shutdown.target static
sigpwr.target static
sleep.target static
smartcard.target static
sockets.target static
sound.target static
suspend.target static
swap.target static
sysinit.target static
syslog.target static
system-update.target static
time-sync.target static
umount.target static
cpu-ondemand.timer enabled
systemd-readahead-done.timer static
systemd-tmpfiles-clean.timer static
169 unit files listed.
root@beaglebone:~# systemctl list-unit-files --type mount
UNIT FILE STATE
dev-hugepages.mount static
dev-mqueue.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 static
7 unit files listed.
systemctlコマンドで、サービスの自動起動を設定すると、「WantedByで指定されたユニット名+.wants」ディレクトリ配下にシンボリックリンクが作成されます。