Control of System Services (Linux)

Source: Internet
Author: User

1.systemd
System initialization program, the first process that the system starts, the PID is 1

2.systemctl command
Systemctl List-units # #列出当前系统服务的状态

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M00/8F/97/wKiom1jl8IrgNWVjAADheEJpDHA152.png-wh_500x0-wm_ 3-wmp_4-s_448054066.png "style=" Float:none; "title=" Image001.png "alt=" wkiom1jl8irgnwvjaadheejpdha152.png-wh_50 "/ >

Systemctl List-unit-files # #列出服务的开机状态

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M00/8F/95/wKioL1jl8Iri3R2xAADZkD721VU232.png-wh_500x0-wm_ 3-wmp_4-s_1944166304.png "style=" Float:none; "title=" Image002.png "alt=" Wkiol1jl8iri3r2xaadzkd721vu232.png-wh_50 " />

Systemctl Status sshd # #查看指定服务的状态

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M01/8F/97/wKiom1jl8Iug9USvAACIoOBWAnY523.png-wh_500x0-wm_ 3-wmp_4-s_1399050091.png "style=" Float:none; "title=" Image003.png "alt=" Wkiom1jl8iug9usvaacioobwany523.png-wh_50 " />

Systemctl Stop sshd # #关闭指定服务

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M01/8F/97/wKiom1jl8IvToxSxAAB6DmyqiQA228.png-wh_500x0-wm_ 3-wmp_4-s_2856452909.png "style=" Float:none; "title=" Image004.png "alt=" Wkiom1jl8ivtoxsxaab6dmyqiqa228.png-wh_50 " />

Systemctl Start sshd # #开启指定服务

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M01/8F/95/wKioL1jl8IvCejPrAACx8R7sow0778.png-wh_500x0-wm_ 3-wmp_4-s_1973619865.png "style=" Float:none; "title=" Image005.png "alt=" Wkiol1jl8ivcejpraacx8r7sow0778.png-wh_50 " />

Systemctl Restart sshd # #从新启动服务
Systemctl Enable SSHD # #设定指定服务开机开启
Systemctl Disable SSHD # #设定指定服务开机关闭
Systemctl Reload sshd # #使指定服务从新加载配置
Systemctl list-dependencies sshd # #查看指定服务的倚赖关系

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M01/8F/95/wKioL1jl8IygzV3TAADUX28SUcI083.png-wh_500x0-wm_ 3-wmp_4-s_1750797479.png "style=" Float:none; "title=" Image006.png "alt=" Wkiol1jl8iygzv3taadux28suci083.png-wh_50 " />

Systemctl Mask sshd # #冻结指定服务
Systemctl unmask sshd # #启用服务
Systemctl Set-default Multi-user.target # #开机不开启图形

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M02/8F/97/wKiom1jl8IzThrDIAAAa8OQO-cM451.png-wh_500x0-wm_ 3-wmp_4-s_834856367.png "style=" Float:none; "title=" Image007.png "alt=" wkiom1jl8izthrdiaaaa8oqo-cm451.png-wh_50 "/ >

Systemctl Set-default Graphical.target # #开机启动图形

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M02/8F/97/wKiom1jl8I3wlwQOAAAlb16RT1c644.png-wh_500x0-wm_ 3-wmp_4-s_2868044075.png "style=" Float:none; "title=" Image008.png "alt=" Wkiom1jl8i3wlwqoaaalb16rt1c644.png-wh_50 " />

Setterm # #文本界面设定color

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M00/8F/96/wKioL1jl8c7g2PIdAAA4TA7XqE4932.png-wh_500x0-wm_ 3-wmp_4-s_3054983184.png "title=" Image009.png "alt=" Wkiol1jl8c7g2pidaaa4ta7xqe4932.png-wh_50 "/>

Change color

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M00/8F/97/wKiom1jl8I2xoga6AAAVbqUIutA434.png-wh_500x0-wm_ 3-wmp_4-s_1712077041.png "style=" Float:none; "title=" Image010.png "alt=" Wkiom1jl8i2xoga6aaavbquiuta434.png-wh_50 " />

restore system specified color
3.Service Status
Systemctl StatusService Name

Loaded # #The system service has been initialized, the configuration has been loaded
Active(Running)            ##one or more programs are executing in the system,
#vsftpdThis is the pattern .

Atcive(exited)              ##A service that only performs a normal end,
# There are currently no programs in the system .

Atcive(Waiting)            ##is being executed.
# and wait for other events to continue.

Inactive # #Service shutdown
enbaled # #Service boot up
Disabled # #service boot not self-starter
Static # #Service boot entry cannot be managed


Control of System Services (Linux)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.