Systemd

    2017年12月04日 字数:1550
  • systemd is a set of command.
$ sudo /etc/init.d/apache2 start
$ service apache2 start
## `systemd` instead of `init`, the PID of `systemd` is 1, other processes are children.
$ systemctl --version
# systemd 229
## +PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +G# CRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN
## 重启系统
$ sudo systemctl reboot

## 关闭系统,切断电源
$ sudo systemctl poweroff

## CPU停止工作
$ sudo systemctl halt

## 暂停系统
$ sudo systemctl suspend

## 让系统进入冬眠状态
$ sudo systemctl hibernate

## 让系统进入交互式休眠状态
$ sudo systemctl hybrid-sleep

## 启动进入救援状态(单用户状态)
$ sudo systemctl rescue
## 查看启动耗时
$ systemd-analyze

## 查看每个服务的启动耗时
$ systemd-analyze blame

## 显示瀑布状的启动过程流
$ systemd-analyze critical-chain

## 显示指定服务的启动流
$ systemd-analyze critical-chain atd.service

## 显示当前主机的信息
$ hostnamectl

## 设置主机名。
$ sudo hostnamectl set-hostname rhel7

## 查看本地化设置
$ localectl

## 设置本地化参数。
$ sudo localectl set-locale LANG=en_GB.utf8
$ sudo localectl set-keymap en_GB

## 查看当前时区设置
$ timedatectl

## 显示所有可用的时区
$ timedatectl list-timezones
## 设置当前时区
$ sudo timedatectl set-timezone America/New_York
$ sudo timedatectl set-time YYYY-MM-DD
$ sudo timedatectl set-time HH:MM:SS

## 列出当前session
$ loginctl list-sessions

## 列出当前登录用户
$ loginctl list-users

## 列出显示指定用户的信息
$ loginctl show-user ruanyf

请我喝杯咖啡

取消

感谢您的支持,我会继续写出更优秀的文章!

扫码支持
扫码支持
请我喝杯咖啡

打开微信扫一扫,即可进行扫码打赏哦

comments powered by Disqus