zoukankan      html  css  js  c++  java
  • ubuntu服务管理

    uRedhat 提供了chkconfig这个命令来管理系统在不同运行级别下的服务开启/关闭: chkconfig ServiceName on/off 并可以用chkconfig --list(两个杠) 查看当前的制定状况。

    Ubuntu里没有这个命令,其实也可以不用任何命令简单管理系统服务, 可以通过改变 /etc/rc*.d(*的取值是从0到6和S)下的启动脚本名来管理服务. 比如不想让KDM自动启动, 可以这样: sudo find /etc/rc* -name *kdm* -exec rm {} /; 也就是把KDM的启动脚本全删掉.

    Ubuntu也提供了另外一个简单的命令来实现管理。但首先服务必须已在/etc/init.d目录中存在。如:

    添加一个服务: sudo update-rc.d ServiceName defaults

    删除一个服务: sudo update-rc.d ServiceName remove

    还可以安装另外一个比较强的工具: sudo apt-get install sysv-rc-conf sysvconfig

    启动: sudo sysv-rc-conf 它可心配置各服务在各级别上的启动情况.

    随时想启动某个服务, 可以这样: sudo /etc/init.d/ServiceName start

    比如我要远程登录, 要用ssh服务: sudo /etcinit.d/ssh start (别的系统可能是sshd)

    还可以做别的操作: start : 启动服务 stop : 停止服务 restart : 关闭服务,然后重新启动 reload : 使服不重新启动而重读配置文件 status : 提供服务的当前状态 condrestart : 如果服务锁定,则这个来关闭服务,然后再次启动 再说一下 linux 运行级别的意思: 通常有这几个 runlevel : runlevel  system state 0  halt the system 1   single user mode 2  basic multi user mode 3  multi user mode 5  multi user mode with gui 6  reboot the system S   single user mode runlevel 命令查看当前运行级别. init 命令改变当前运行级别.

    ============

       在ubuntu中没有chkconfig这个的命令来对服务运行级别的管理,虽然不能用这个命令来管理,但是还是可以用来查看服务运行状态的,

    因此你还是可以安装它的:sudo apt-get install chkconfig  然后chkconfig --list即可

          在ubuntu中有一个chkconfig的代替命令sysv-rc-conf,安装方式:sudo apt-get install sysv-rc-conf。这个命令的使用方式跟chkconfig

    的有点不太一样,具体的使用方法baidu or google一下便知

          在ubuntu中对服务还有一个图形界面的管理工具Boot-Up Manager,简称:BUM。安装sudo apt-get install bum使用方法在也不多做介绍

          这里有各个服务的具体服务内容

          http://www.ownlinux.cn/2009/06/13/bum.html

  • 相关阅读:
    My 1st webUI try
    option(recompile)
    Add&Delete WindowService
    powershell
    bootstrap模态框,等待遮盖层
    spring-boot通过@Scheduled配置定时任务
    bootstrap-table的一些参数配置
    $('xx')[0].files[0]的意思
    Go国内镜像
    基础语法-defer使用(12)
  • 原文地址:https://www.cnblogs.com/shineqiujuan/p/4706047.html
Copyright © 2011-2022 走看看