实验3服务启动控制
实验环境
在虚拟机Linux系统下
实验目标
检查系统里有多少个独立系统多少个临时服务
查看bluetooth服务是否启动
停止bluetooth服务再次查看服务的运行状态
查看network服务支持哪几种控制方式
重启bluetooth、network服务
实验步骤
1. 检查系统有多少个独立服务多少个临时服务需要利用到管道原理
[root@localhost ~]# ls /etc/init.d/ |wc -l
82 //init.d 所有独立服务的安装目录
[root@localhost ~]# ls /etc/xinetd.d/ |wc -l
21 //xinetd.d所有临时服务的安装目录
2. 查看bluetooth服务前先判断它是属于什么服务再查看它是否启动
[root@localhost ~]# find /etc/ -namebluetooth
/etc/sysconfig/bluetooth
/etc/bluetooth
/etc/rc.d/init.d/Bluetooth
//经查询可知bluetooth属于独立服务
[root@localhost ~]#/etc/init.d/bluetooth status
//查看状态也可以用命令service bluetooth status来查看
hcid (pid 3213) 正在运行...
sdpd (pid 3217) 正在运行...
3. 停止bluetooth服务查看它的运行状态
[root@localhost ~]#/etc/init.d/bluetooth stop
Stopping Bluetooth services: [确定]
//手动停止服务
[root@localhost ~]#/etc/init.d/bluetooth status
hcid 已停
sdpd 已停
4. 查看network服务前也需要查看它属于什么服务然后再查看
[root@localhost ~]# find /etc/ -namenetwork
/etc/sysconfig/network
/etc/vmware-tools/scripts/vmware/network
/etc/rc.d/init.d/network
//属于独立服务
[root@localhost ~]# /etc/init.d/network
用法/etc/init.d/network{start|stop|restart|reload|status}
//利用/etc/init.d/network命令直接回车可以查找它的用法
5. 重启bluetooth、network服务。
[root@localhost ~]# /etc/init.d/bluetooth restart
Stopping Bluetooth services: [失败]
启动蓝牙服务 [确定]
[root@localhost ~]#/etc/init.d/network restart
正在关闭接口 eth0 [确定]
关闭环回接口 [确定]
弹出环回接口 [确定]
弹出界面 eth0
正在决定 eth0 的 IP 信息...完成。
[确定]
转载于:https://blog.51cto.com/suixinerwei/1543888