zoukankan      html  css  js  c++  java
  • Linux 启/关 自启动服务

    chkconfig命令

    chkconfig用来设置服务在开机的时候自动启动:

    --查看nfs服务是否开机自动启动,可以看见6个开机级别都不会启动的nfs服务
    #chkconfig --list nfs
    nfs 0:off 1:off 2:off 3:off 4:off 5:off 6:off
    --设置开机自动启动nfs服务
    #chkconfig nfs on
    --再次查看,可以看见2、3、4、5级别开机会自动启动nfs服务,
    #chkconfig --list nfs
    nfs 0:off 1:off 2:on 3:on 4:on 5:on 6:off
    --取消开机自动启动nfs服务
    #chkconfig nfs off
    --再次查看,6个级别开机又都不会启动nfs服务了
    #chkconfig --list nfs
    nfs 0:off 1:off 2:off 3:off 4:off 5:off 6:off
    设置3级别开机自动启动nfs
    chkconfig --level3 nfs on
    再次查看,可以看见在级别3开机会自动启动服务
    chkconfig --list nfs
    nfs 0:off 1:off 2:off 3:on 4:off 5:off 6:off

    service命令

    service用于用于对系统服务进行管理,比如启动(start)、停止(stop)、重启(restart)、查看状态(status)等。

    #service nfs status   //查看nfs服务程序处于的状态

    rpc.mountd (pid 2461) is running...

    nfsd (pid 2458 2457 2456 2455 2454 2453 2452 2451)is running...

    #service iptable status //查询防火墙服务程序处于的状态

    Table:filter

    Chain INPUT (policy ACCEPT)

    num    target prot opt source   destination

    Chain FORWARD (policy ACCEPT)

    num    target prot opt source   destination

    Chain  OUTPUT (policy ACCEPT)

    num    target prot opt source   destination

    #service nfs start //立即开启nfs此服务,系统重启无效

    #service iptables start //立即开启防火墙此服务,系统重启无效

    #service nfs stop //立即停止nfs此服务,系统重启无效

    #service iptables stop //立即关闭防火墙此服务,系统重启无效

  • 相关阅读:
    OPENGL_三角形带GL_TRIANGLE_STRIP详解
    OPENGL_单位长度对应屏幕像素
    OPENGL2_基本框架
    WINDOWS编程基础-最简单的windows程序
    着色语言(Shader Language)
    Ogre 学习记录
    Ogre RT Shader System
    Perception Neuron系统,让动作捕捉技术不再高冷
    Ogre 中基于蒙皮骨骼的OBB碰撞检测
    Ogre 绘制基本图形
  • 原文地址:https://www.cnblogs.com/CJye/p/3051927.html
Copyright © 2011-2022 走看看