systemd之Centos服务管理

前端之家收集整理的这篇文章主要介绍了systemd之Centos服务管理前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。




systemd 架构图




bg2016030703.png





Systemd

https://www.freedesktop.org/software/systemd/


http://www.jinbuguo.com/systemd/systemd.html


中文手册

https://www.ibm.com/developerworks/cn/linux/1407_liuming_init3/

浅析systemd


https://www.freedesktop.org/wiki/Software/systemd/




http://www.jb51.cc/article/p-rbccvqjh-bnx.html

systemd 命令详解 (赞)


http://blog.jobbole.com/97248/

简明介绍 systemd


systemd提供更优秀的框架以表示系统服务间的依赖关系
实现系统初始化时服务的并行启动,同时达到降低Shell的系统开销的效果
systemd的目标是:尽可能启动更少进程;尽可能将更多进程并行启动。
systemd尽可能减少对shell脚本的依赖。



systemdis a suite of basic building blocks for a Linux system. It provides a system and service manager that runs as PID 1 and starts the rest of the system.provides aggressive parallelization capabilities,uses socket and D-Bus activation for starting services,offers on-demand starting of daemons,keeps track of processes using Linux control groups,maintains mount and automount points,and implements an elaborate transactional dependency-based service control logic.supports SysV and LSB init scripts and works as a replacement for sysvinit. Other parts include a logging daemon,utilities to control basic system configuration like the hostname,date,locale,maintain a list of logged-in users and running containers and virtual machines,system accounts,runtime directories and settings,and daemons to manage simple network configuration,network time synchronization,log forwarding,and name resolution. SeeLennart's blog storyfor a longer introduction,and thethreestatusupdatessince then. Also see theWikipedia article. If you are wondering whether systemd is for you,please have a lookat this comparison of init systems by one of the creators of systemd.






Systemd 的简介和特点

Systemd 是 Linux 系统中最新的初始化系统(init),它主要的设计目标是克服 sysvinit 固有的缺点,提高系统的启动速度。systemd 和 ubuntu 的 upstart 是竞争对手,预计会取代 UpStart,实际上在作者写作本文时,已经有消息称 Ubuntu 也将采用 systemd 作为其标准的系统初始化系统。

Systemd 的很多概念来源于苹果 Mac OS 操作系统上的 launchd,不过 launchd 专用于苹果系统,因此长期未能获得应有的广泛关注。Systemd 借鉴了很多 launchd 的思想,它的重要特性如下:

同 SysVinit 和 LSB init scripts 兼容@H_301_194@

Systemd 是一个"新来的",Linux 上的很多应用程序并没有来得及为它做相应的改变。和 UpStart 一样,systemd 引入了新的配置方式,对应用程序的开发也有一些新的要求。如果 systemd 想替代目前正在运行的初始化系统,就必须和现有程序兼容。任何一个 Linux 发行版都很难为了采用 systemd 而在短时间内将所有的服务代码修改一遍。

Systemd 提供了和 Sysvinit 以及 LSB initscripts 兼容的特性。系统中已经存在的服务和进程无需修改。这降低了系统向 systemd 迁移的成本,使得 systemd 替换现有初始化系统成为可能。

更快的启动速度@H_301_194@

Systemd 提供了比 UpStart 更激进的并行启动能力,采用了 socket / D-Bus activation 等技术启动服务。一个显而易见的结果就是:更快的启动速度。

为了减少系统启动时间,systemd 的目标是:

  • 尽可能启动更少的进程

  • 尽可能将更多进程并行启动


https://blog.linuxeye.cn/400.html



CentOS 7 巨大变动之 systemd 取代 SysV的Init

http://www.jb51.cc/article/p-pfnwklxc-cg.html





常用命令


开机不启动unit

systemctl disable httpd.service

删除/etc/systemd/system/multi-user.target.wants下的软链接

查看开机是否启动

systemctl is-enabled xx.service #查询服务是否开机启动

systemd查看开机自启动的程序

相当于chkconfig --list

ls /etc/systemd/system/multi-user.target.wants/

查看systemd单元加载及活动情况

systemctl

显示启动失败的单元

systemctl --Failed

查看systemd管理的所有单元

systemctl list-unit-files



http://www.linuxidc.com/Linux/2016-04/130413.htm


http://www.linuxidc.com/Linux/2015-04/116648.htm



初次体验CentOS 7的systemd

http://carllai.blog.51cto.com/1664997/1439562/

猜你在找的CentOS相关文章