# systemd-analyze critical-chain
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.
multi-user.target @20.222s
└─mariadb.service @11.657s +8.565s
......
systemctl list-unit-files 列出所有可用单元
# systemctl list-unit-files
UNIT FILE STATE
proc-sys-fs-binfmt_misc.automount static
.....
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 Syste
evices-pl...erial8250-tty-ttyS2.device loaded active plugged
...
systemctl list-units 列出所有失败单元
UNIT LOAD ACTIVE SUB DESCRIPTION
kdump.service loaded failed failed Crash recovery kernel arming
...
$ cat /var/log/vboxadd-setup.log
Building the main Guest Additions 6.0.12 module for kernel 4.18.0-80.7.1.el8_0.x86_64.
Error building the module. Build output follows.
make V=1 CONFIG_MODULE_SIG= -C /lib/modules/4.18.0-80.7.1.el8_0.x86_64/build M=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j1 modules
Makefile:958: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel". Stop.
make: *** [/tmp/vbox.0/Makefile-footer.gmk:111: vboxguest] Error 2
Could not find the X.Org or XFree86 Window System, skipping.
modprobe vboxguest failed
yum(dnf)install -y elfutils-libelf-devel elfutils-libelf-devel.x86_64
sh VBoxLinuxAdditions.run
echo"I'm the {$i}th child and my pid:{$mypid},parentpid:{$parentpid} a={$a}", PHP_EOL;
sleep($childNum);
exit;
} elseif ($pid>0) {
//parent code
echo"fork the {$i}th child,pid:{$pid} a={$a}", PHP_EOL;
}
}
代码运行结果,全局变量a的值始终为2说明,无法修改父进程的值s
my pid: 37018
fork the 1th child,pid:37019 a=1
I'm the 1th child and my pid:37019,parentpid:37018 a=2
fork the 2th child,pid:37020 a=1
I'm the 2th child and my pid:37020,parentpid:37018 a=2
fork the 3th child,pid:37021 a=1
I'm the 3th child and my pid:37021,parentpid:37018 a=2
fork the 4th child,pid:37022 a=1
I'm the 4th child and my pid:37022,parentpid:37018 a=2
fork the 5th child,pid:37023 a=1
I'm the 5th child and my pid:37023,parentpid:37018 a=2