systemdについて


systemd調systemdsysvinitRedhatDebianLinusSystemdboycott systemd

CentOS 6.5PID 1initCentOS7systemd
$ pstree -h
init─┬─acpid
     ├─agetty
     ├─crond
     ├─6*[mingetty]
     ├─ntpd
     ├─rpc.statd
     ├─rpcbind
     ├─rsyslogd───3*[{rsyslogd}]
     ├─sshd───sshd───sshd───bash───pstree
     └─udevd───2*[udevd]
[vagrant@localhost ~]$ pstree
systemd─┬─NetworkManager─┬─dhclient
        │                └─3*[{NetworkManager}]
        ├─VBoxService───7*[{VBoxService}]
        ├─agetty
        ├─auditd───{auditd}
        ├─avahi-daemon───avahi-daemon
        ├─crond
        ├─dbus-daemon───{dbus-daemon}
        ├─firewalld───{firewalld}
        ├─iprdump
        ├─iprinit
        ├─iprupdate
        ├─lvmetad
        ├─master─┬─pickup
        │        └─qmgr
        ├─polkitd───5*[{polkitd}]
        ├─rsyslogd───2*[{rsyslogd}]
        ├─sshd───sshd───sshd───bash───pstree
        ├─systemd-journal
        ├─systemd-logind
        ├─systemd-udevd
        └─tuned───4*[{tuned}]

/sbin/initsystemd
[vagrant@localhost ~]$ ls -l /sbin/init 
lrwxrwxrwx. 1 root root 22 Aug  1 08:41 /sbin/init -> ../lib/systemd/systemd

systemdsystemd-analyze調
[vagrant@localhost ~]$ systemd-analyze time
Startup finished in 431ms (kernel) + 1.326s (initrd) + 7.844s (userspace) = 9.603s

[vagrant@localhost ~]$ systemd-analyze blame
          2.167s firewalld.service
          1.825s kdump.service
          1.584s tuned.service
          1.442s vboxadd.service
          1.166s network.service
          1.102s lvm2-monitor.service
          :

syslogdjournald
[vagrant@localhost ~]$ sudo journalctl
-- Logs begin at Fri 2014-09-05 01:45:16 EDT, end at Sat 2014-09-06 00:32:19 EDT. --
Sep 05 01:45:16 localhost.localdomain systemd-journal[80]: Runtime journal is using 4.0M (max 24.5M, leaving 36.7M of free 241.1M, current limit 24.5M).
Sep 05 01:45:16 localhost.localdomain systemd-journal[80]: Runtime journal is using 4.0M (max 24.5M, leaving 36.7M of free 241.1M, current limit 24.5M).
Sep 05 01:45:16 localhost.localdomain kernel: Initializing cgroup subsys cpuset
Sep 05 01:45:16 localhost.localdomain kernel: Initializing cgroup subsys cpu
Sep 05 01:45:16 localhost.localdomain kernel: Initializing cgroup subsys cpuacct
Sep 05 01:45:16 localhost.localdomain kernel: Linux version 3.10.0-123.6.3.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC) ) #1 SMP Wed Aug 6 21:12:36 UTC 2014
Sep 05 01:45:16 localhost.localdomain kernel: Command line: BOOT_IMAGE=/vmlinuz-3.10.0-123.6.3.el7.x86_64 root=/dev/mapper/centos-root ro rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 vconsole.keymap=jp106 rd.lvm.lv=centos/root crashkernel=auto rhgb quiet LANG=en_US.UTF-8
:

"-b"_SYSTEMD_UNIT=sshd.service'which sshd'
[vagrant@localhost ~]$ sudo journalctl _SYSTEMD_UNIT=sshd.service
-- Logs begin at Fri 2014-09-05 01:45:16 EDT, end at Sat 2014-09-06 00:34:34 EDT. --
Sep 05 01:45:24 localhost.localdomain sshd[1099]: Server listening on 0.0.0.0 port 22.
Sep 05 01:45:24 localhost.localdomain sshd[1099]: Server listening on :: port 22.
Sep 05 01:45:30 localhost.localdomain sshd[2202]: Accepted publickey for vagrant from 10.0.2.2 port 49275 ssh2: RSA dd:3b:b8:2e:85:04:06:e9:ab:ff:a8:0a:c0:0
Sep 05 01:48:34 localhost.localdomain sshd[3895]: Accepted publickey for vagrant from 10.0.2.2 port 49326 ssh2: RSA dd:3b:b8:2e:85:04:06:e9:ab:ff:a8:0a:c0:0

systemdsystemctlsystemdservice使systemctl rebootpoweroff/usr/sbin/rebootsystemctl

systemd-detect-virt
[vagrant@localhost ~]$ systemd-detect-virt 
oracle

gitCPUIDDMI使VirtualBox/sys/class/dmi/id/sys_vendor"innotek GmbH"VirtualBox

hostnamectlChassis"vm""n/a"
[vagrant@localhost ~]$ sudo hostnamectl 
   Static hostname: localhost.localdomain
         Icon name: computer
           Chassis: n/a
        Machine ID: 42223b0ecc4b406f8c15a34a4ad16be9
           Boot ID: c140fb95493041e7ab58a6ddbe4b74f6
    Virtualization: oracle
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-123.6.3.el7.x86_64
      Architecture: x86_64