Chinaunix首页 | 论坛 | 博客
  • 博客访问: 27909
  • 博文数量: 3
  • 博客积分: 25
  • 博客等级: 民兵
  • 技术积分: 47
  • 用 户 组: 普通用户
  • 注册时间: 2012-05-24 12:07
文章分类

全部博文(3)

文章存档

2015年(3)

我的朋友

分类: 系统运维

2015-01-08 23:45:09

  服务管理    
  init scripts have been replaced with service units
    systemctl命令可以实现之前版本系统的service和chkconfig,在bash环境中,输入systemctl 及空格后(也不仅限于systemd命令),在点两下tab键,可以看到可用的控制命令 

点击(此处)折叠或打开

  1. 启动服务 systemctl start name[.service]     eg: systemctl start named.service
  2. 重新加载配置文件 systemctl reload name[.service]     eg: systemctl start named.service
  3. 查看服务 systemctl list-units [ --type service [ --all ] ] 不加--type只列出已激活的。      eg: systemctl list-units --type service
  4. 使服务开机启动 systemctl enable name.service
  5. 查看某项服务是否为开机启动 systemctl is-enable name.service
  6. 查看某项服务是否已被激活 systemctl is-active name.service
  7. 查看某项服务的启动状态及运行状态 systemctl status name.service
  8.     输出内容主要有Loaded:是否被加载,是否开机启动;Active状态;MainPID;Status;CGroup

系统启动模式管理 
     level0 - poweroff.target        1 - rescue.target        2,3,4 - multi-user.target        5 - graphical.target        6 - reboot.target

点击(此处)折叠或打开

  1. 查看默认target #systemctl get-default
  2.     该命令解析的是/etc/systemd/system/default.target的符号链接,不同的默认target有不同的源文件

  3. 设置默认target #systemctl set-default name.target
  4. 改变当前的target #systemctl isolate name.target

系统管理
    系统halt,poweroff,reboot, pm-suspend, pm-hibernate
    

点击(此处)折叠或打开

  1. ~]# systemctl halt
  2. ~]# systemctl poweroff
  3. ~]# systemctl --no-wall reboot   
  4.         --no-wall不通知其它用户

systemd的远程控制
    systemd可以和其它正在运行systemd的机器进行通信通过ssh协议。
    命令格式:systemctl  [ -H  |  --host ]  username@[hostname | ip ] command
    eg:  ~]# systemctl  -H  root@192.168.56.104  poweroff
                   关闭192.168.56.104机器
    systemd其它命令也可以通过-H远程进行远程控制,比如说服务相关控制

阅读(1924) | 评论(0) | 转发(0) |
0

上一篇:virtualbox E_FAIL (0x80004005) SessionMachine

下一篇:没有了

给主人留下些什么吧!~~