码迷,mamicode.com
首页 > 其他好文 > 详细

学习笔记 三: 用systemd管理服务

时间:2016-08-24 17:45:47      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:rhel7 systemctl systemd

一 systemd基本知识

 提高启动速度

 自动服务依赖管理



  1. systemd基本管理unit

Service unit   .service A system service.

Target unit    .target A group of systemd units.

Automount unit .automount A file system automount point.

Device unit    .device A device file recognized by the kernel.

Mount unit     .mount A file system mount point.

Path unit      .path A file or directory in a file system.

Scope unit     .scope An externally created process.

Slice unit     .slice A group of hierarchically organized units

that manage system processes.

Snapshot unit  .snapshot A saved state of the systemd manager.

Socket unit    .socket An inter-process communication socket.

Swap unit      .swap A swap device or a swap file.

Timer unit     .timer A systemd timer.



2.相关配置文件

/usr/lib/systemd/system


/run/systemd/system/


/etc/systemd/system/


runnerlevel



3.服务启动停止命令 systemctl  

start

stop 

status


systemctl stop bluetooth.service



4.显示所有服务状态

systemctl list-units --type service --all


systemctl --failed --type=service


5.添加自动启动

systemctl enable name.service




6. 查看target

sytemctl list-units --type target


systemctl list-units --type target --all





7.更改target

systemctl set-default multi-user.target



8.重启操作系统

systemctl halt

systemctl poweroff

systemctl reboot



本文出自 “痞子厨子戏子” 博客,请务必保留此出处http://chenwei.blog.51cto.com/32183/1841958

学习笔记 三: 用systemd管理服务

标签:rhel7 systemctl systemd

原文地址:http://chenwei.blog.51cto.com/32183/1841958

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!