systemctl

作者: 踌躇月光 | 来源:发表于2018-01-31 02:35 被阅读0次

图形界面及命令行界面

设置开机默认界面为图形界面

systemctl set-default graphical.target

设置开机默认界面为命令行界面

systemctl set-default multi-user.target

开机重启即可生效,当然也可不重启切换
切换为图形界面

systemctl start graphical.target

切换为命令行界面

systemctl start multi-user.target

服务控制

systemctl status service
systemctl start service
systemctl restart service
systemctl stop service
systemctl enable service
systemctl disable service

服务文件

服务位置

/usr/lib/systemd/system/
[Unit]
Description=OpenSSH server daemon
Documentation=man:sshd(8) man:sshd_config(5)
After=network.target sshd-keygen.service
Wants=sshd-keygen.service

[Service]
EnvironmentFile=/etc/sysconfig/sshd
ExecStart=/usr/sbin/sshd -D $OPTIONS
ExecReload=/bin/kill -HUP $MAINPID
Type=simple
KillMode=process
Restart=on-failure
RestartSec=42s

[Install]
WantedBy=multi-user.target

相关文章

  • systemd学习笔记

    systemctl 重启 systemctl reboot 关闭 systemctl poweroff CPU停止...

  • 5. linux命令

    来源: http://man.linuxde.net/systemctl systemctl systemctl命...

  • Basic knowledge about systemd an

    systemctl --help #查詢systemctl指令用法systemctl list-units #查詢...

  • CentOS7 Failed to start LSB: Bri

    systemctl stop NetworkManager systemctl disable NetworkMa...

  • systemctl

    重新加载配置文件 systemctl daemon-reload 启动 systemctl start redi...

  • systemctl

    图形界面及命令行界面 设置开机默认界面为图形界面 设置开机默认界面为命令行界面 开机重启即可生效,当然也可不重启切...

  • systemctl

    centos 7 关闭防火墙: systemctl stop firewalld.service #停止firew...

  • systemctl

    systemctl相当于service和chkconfig的结合体,使用它可以永久性启用/禁止或临时关闭/启动某个...

  • systemctl

    systemctl(system control)-控制systemd系统和服务管理器。 描述: 向system ...

  • systemctl

网友评论

      本文标题:systemctl

      本文链接:https://www.haomeiwen.com/subject/lvohzxtx.html