
Linux 启动、关闭、重启网络服务的两种方式:
1、使用service脚本来调度网络服务,如:
启动 service network start;
关闭 service network stop;
重启 service network restart;
2、直接执行网络服务的管理脚本,如:
启动 /etc/init.d/network start;
关闭 /etc/init.d/network stop;
重启 /etc/init.d/network restart。
扩展资料
linux其他服务相关命令介绍:
1、linux显示所有服务的运行状态命令
service --status-all
chkconfig --list
2、linux查看单个服务的运行状态命令
service iptables status
3、linux查看服务启动状态,是否开机自动启动命令
chkconfig --list servicename
如何查看和终止linux的自启动:
查看Linux启动的服务
chkconfig --list 查询出所有当前运行的服务
chkconfig --list atd 查询atd服务的当前状态
停止所有服务并且在下次系统启动时不再启动,如下所示:
chkconfig --levels 12345 NetworkManager off
如果想查看当前处于运行状态的服务,用如下语句过滤即可
chkconfig --list |grep on
如果只是想当前的设置状态有效,在系统重启动后即不生效的话,可以用如下命令停止服务
service sshd stop
如果只是想当前的设置状态有效,在系统重启动后即不生效的话,可以用如下命令停止服务
service sshd stop
下图是Linux系统中包括的比较齐全的服务的说明及是否需要启动的说明,可以参考下:
说明:示例,可以把不需要启动的服务写入到一个脚本中,直接用sh 文件名一执行就可以。
chkconfig --levels 0123456 NetworkManager off
chkconfig --levels 0123456 anacron off
chkconfig --levels 0123456 auditd off
chkconfig --levels 0123456 avahi-daemon off
chkconfig --levels 0123456 bluetooth off
chkconfig --levels 0123456 clvmd off
chkconfig --levels 0123456 cman off
chkconfig --levels 0123456 cups off
chkconfig --levels 0123456 gfs off
chkconfig --levels 0123456 gfs2 off
chkconfig --levels 0123456 hidd off
chkconfig --levels 0123456 httpd off
chkconfig --levels 0123456 iptables off
chkconfig --levels 0123456 ip6tables off
chkconfig --levels 0123456 ipvsadm off
chkconfig --levels 0123456 luci off
chkconfig --levels 0123456 mcstrans off
chkconfig --levels 0123456 pand off
chkconfig --levels 0123456 Nrestorecond off
chkconfig --levels 0123456 ricci off
chkconfig --levels 0123456 rmanager off
chkconfig --levels 0123456 saslauthd off
chkconfig --levels 0123456 sendmail off
chkconfig --levels 0123456 smb off
chkconfig --levels 0123456 snmp off
chkconfig --levels 0123456 snmptrapd off
chkconfig --levels 0123456 tog-pegasus off
chkconfig --levels 0123456 wdaemon off
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)