咨询热线:4006-75-4006

售前:9:00-23:30    备案:9:00-18:00    技术:7*24h

systemctl 命令完全指南(五)

2016-12-17 18:34:56 10568次

使用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'


首页
最新活动
个人中心