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

一 systemd基本知识ssh

  systemd再同一时间,启动 socket

提升启动速度系统资源,系统服务,其它进程ide

 自动服务依赖管理操作系统


systemctl -l help
进程





  1. systemd基本管理unitip

Service unit   .service A system service.ci

Target unit    .target A group of systemd units.资源

Automount unit .automount A file system automount point.get

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

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


systemctl status sshd.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


9.配置系统启动

graphical.target  :system supports multiple users,graphical and text-based

multi-user.target  : system supports multiple users,text-based logins only

rescue.target  sulogin prompt,basic system initialization completed.

emergency.target :sulogin prompt,initramfs pivot complete and system root mounted on /read


systemctl list-dependencies graphical.target | grep target

相关文章
相关标签/搜索