systemctl 命令完全指南(五)

2016-12-17 18:34:56 5715

使用Systemctl控制并管理套接口

 

21. 列出所有可用系统套接口


# systemctl list-unit-files --type=socket

UNIT FILE STATE

dbus.socket static

dm-event.socket enabled

lvm2-lvmetad.socket enabled

rsyncd.socket disabled

sshd.socket disabled

syslog.socket static

systemd-initctl.socket static

systemd-journald.socket static

systemd-shutdownd.socket static

systemd-udevd-control.socket static

systemd-udevd-kernel.socket static

11 unit files listed.

 

22. 在Linux中启动、重启、停止、重载套接口并检查其状?


# systemctl start cups.socket

# systemctl restart cups.socket

# systemctl stop cups.socket

# systemctl reload cups.socket

# systemctl status cups.socket

cups.socket - CUPS PrintingServiceSockets

Loaded: loaded (/usr/lib/systemd/system/cups.socket; enabled)

Active: active (listening) since Tue2015-04-2818:10:59 IST;8s ago

Listen:/var/run/cups/cups.sock (Stream)

Apr2818:10:59 tecmint systemd[1]:Starting CUPS PrintingServiceSockets.

Apr2818:10:59 tecmint systemd[1]:Listening on CUPS PrintingServiceSockets.

 

23. 在启动时激活套接口,并启用或禁用它(系统启动时自启动)


# systemctl is-active cups.socket

# systemctl enable cups.socket

# systemctl disable cups.socket


24. 屏蔽(使它不能启动)或显示套接口


# systemctl mask cups.socket

ln -s '/dev/null''/etc/systemd/system/cups.socket'

# systemctl unmask cups.socket

rm '/etc/systemd/system/cups.socket'


提交成功!非常感谢您的反馈,我们会继续努力做到更好!

这条文档是否有帮助解决问题?

非常抱歉未能帮助到您。为了给您提供更好的服务,我们很需要您进一步的反馈信息:

在文档使用中是否遇到以下问题: