学韩顺平linux的笔记:
定义
service本质就是运行在后台监听某个端口的守护进程,比如mysqld、sshd
service管理指令
service 名称 [ start | stop | restart | status | reload ]
使用虚拟机终端查询有哪些service,关闭其中的network,会发现使用MobaXterm没法输入linux命令并且过会儿超时断开。再通过指令开启,恢复原样。
[zxomm@zyc01 init.d]$ ll /etc/init.d/
总用量 40
-rw-r--r--. 1 root root 18281 8月 24 2018 functions
-rwxr-xr-x. 1 root root 4569 8月 24 2018 netconsole
-rwxr-xr-x. 1 root root 7923 8月 24 2018 network
-rw-r--r--. 1 root root 1160 10月 31 2018 README
[zxomm@zyc01 init.d]$
[zxomm@zyc01 init.d]$
[zxomm@zyc01 init.d]$ service network stop
Stopping network (via systemctl): [ 确定 ]
[zxomm@zyc01 init.d]$ service network start
Starting network (via systemctl): [ 确定 ]
ps:centos7.0后service改为systemctl
查看有哪些service
srvice运行级别
systemctl指令