Chinaunix首页 | 论坛 | 博客
  • 博客访问: 39229
  • 博文数量: 2
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 27
  • 用 户 组: 普通用户
  • 注册时间: 2013-05-11 11:29
个人简介

传递价值,分享进步

文章分类

全部博文(2)

文章存档

2013年(2)

我的朋友

分类: LINUX

2013-11-22 08:59:49

systemd 是 Linux 下的一款系统和服务管理器,兼容 SysV 和 LSB 的启动脚本。systemd 的特性有:支持并行化任务;同时采用 socket 式与 D-Bus 总线式激活服务;按需启动守护进程(daemon);利用 Linux 的 cgroups 监视进程;支持快照和系统恢复;维护挂载点和自动挂载点;各服务间基于依赖关系进行精密控制

检视和控制systemd的主要命令是systemctl。该命令可用于查看系统状态和管理系统及服务。详见%28%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87%29

对比表,以操作 apache / httpd 为例
任务 旧指令 新指令
使某服务自动启动 chkconfig --level 3 httpd on systemctl enable httpd.service
使某服务不自动启动 chkconfig --level 3 httpd off systemctl disable httpd.service
检查服务状态 service httpd status systemctl status httpd.service (服务详细信息) systemctl is-active httpd.service (仅显示是否 Active)
显示所有已启动的服务 chkconfig --list systemctl list-units --type=service
启动某服务 service httpd start systemctl start httpd.service
停止某服务 service httpd stop systemctl stop httpd.service
重启某服务 service httpd restart systemctl restart httpd.service

下面以nfs服务为例:

1.启动nfs服务

systemctl start nfs-server.service 

2.设置开机自启动

systemctl enable nfs-server.service 

3.停止开机自启动

systemctl disable nfs-server.service 

4.查看服务当前状态

systemctl status nfs-server.service 

5.重新启动某服务

systemctl restart nfs-server.service 

6.查看所有已启动的服务

systemctl list -units --type=service 

阅读(3814) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~