以 apache/httpd 服务作为例子

任务

Red Hat / Fedora

Ubuntu

Ubuntu 
(with sysv-rc-conf or sysvconfig)

立即启动/停止某服务

service httpd start

invoke-rc.d apache start

service apache start

启动时自动加载

chkconfig httpd on

update-rc.d apache defaults

sysv-rc-conf apache on

启动时不加载

chkconfig httpd off

update-rc.d apache purge

sysv-rc-conf apache off

https://help.ubuntu.com/community/SwitchingToUbuntu/FromLinux/RedHatEnterpriseLinuxAndFedora

安装sysv-rc-conf
$ sudo apt-get install sysv-rc-conf

用法:
sysv-rc-conf --list [service name]
sysv-rc-conf [--level <runlevels>] <service name> <on|off>

译者按:从Fedora16开始,Redhat不再推荐ntsysv、chkconfig、service,而是建议使用新的服务管理工具systemctl (貌似功能强大) ,尽管旧指令也是可以用的。

http://docs.fedoraproject.org/en-US/Fedora/16/html/System_Administrators_Guide/ch-Services_and_Daemons.html

对比表,以 apache / httpd 为例

任务 旧指令 新指令
使某服务自动启动 chkconfig --level 3 httpd on
systemctl enable httpd.service
使某服务不自动启动 chkconfig --level 3 httpd off
systemctl disable httpd.service
检查服务状态 service httpd status
systemctl status httpd.service (服务详细信息) 
systemctl is-active httpd.service (仅显示是否 Active)
显示所有已启动的服务 (谁知道?
systemctl list-units --type=service           
启动某服务 service httpd start
systemctl start httpd.service
停止某服务 service httpd stop
systemctl stop httpd.service
重启某服务 service httpd restart
 
systemctl restart httpd.service

Ubuntu 和 Redhat / Fedora 服务管理命令对比表(附Fedora16新的服务管理工具systemctl )的更多相关文章

  1. 参考termux中包管理命令的伪装修改的arch版包管理命令

    #!/bin/bash set -e -u show_help() { echo "This help message is useless, please read the content ...

  2. Linux 笔记 - 第十三章 Linux 系统日常管理之(三)Linux 系统日志和服务

    博客地址:http://www.moonxy.com 一.前言 日志文件记录了系统每天发生的各种各样的事情,比如监测系统状况.排查问题等.作为系统运维人员可以通过日志来检查错误发生的原因,或者受到攻击 ...

  3. (转)CentOS下开机启动查看管理命令:chkconfig用法

    CentOS下开机启动查看管理命令:chkconfig用法   CentOS下开机启动查看管理的命令是:chkconfig   1. 开机启动列表查看: chkconfig --list     说明 ...

  4. Linux系列教程(七)——Linux帮助和用户管理命令

    上篇博客我们介绍了Linux文件搜索命令,其中find是用的最多的也是功能最强大的文件或目录搜索命令,和另一个搜索命令locate的区别是,find命令是全盘搜索,刚创建的文件也能搜索的到,而loca ...

  5. ORACLE 12c RAC的常用管理命令

    ORACLE 12c RAC的常用管理命令 一.查询 1.RAC查询 1.1.查询节点 [grid@swnode1 ~]$ su - grid [grid@swnode1 ~]$ /u01/app/1 ...

  6. Linux常用命令之帮助和用户管理命令

    目录 1.帮助命令 一.获得命令或配置文件帮助信息:man 二.获得shell内置命令的帮助信息:help 三.获得命令的中文帮助信息:--help 2.用户管理命令 一.添加新用户:useradd ...

  7. Linux系列教程(七)——Linux常用命令之帮助和用户管理命令

    上篇博客我们介绍了Linux文件搜索命令,其中find是用的最多的也是功能最强大的文件或目录搜索命令,和另一个搜索命令locate的区别是,find命令是全盘搜索,刚创建的文件也能搜索的到,而loca ...

  8. Redhat/Fedora 或类似系统, 配置网络的工具介绍

    在Redhat早期的版本中, 有linuxconf .redhat-config-network .netconfig 等工具: 在Redhat/Fedora 最新的版本有 system-config ...

  9. Linux-进程管理命令

    目录 进程管理命令-ps(静态) 进程管理命令-top(动态) 什么是中断 管理进程状态 kill命令 killall命令 pkill命令 pidof 和 pgrep 补充 关于优先级PR和NI 后台 ...

随机推荐

  1. 如何使用抓包工具fiddler对app进行接口分析

    如果你还不知道什么是抓包,点我 如果你还不知道什么是http,点它 如果你想知道什么是fiddler 什么是接口测试 正文来了.安装fiddler后,打开界面,点击tools,找到如图的options ...

  2. C# (灰度)加权平均法将图片转换为灰度图

    private Bitmap ToG(string file) { using (Bitmap o = new Bitmap(file)) { Bitmap g = new Bitmap(o.Widt ...

  3. Linux上 .vimrc文件

    在Linux上面对VIM编辑器的格式的设置通常可以提升工作效率,下面对工作机器上的.vimrc文件的内容进行一总结,以备后续的查询 set smarttab set tabstop=4 set shi ...

  4. C# Linq 交集、并集、差集、去重

    using System.Linq;         List<string> ListA = new List<string>(); List<string> L ...

  5. Linux下man手册使用

    在 linux 环境下,为了查看一下 free 函数的原型,执行 man free 命令,发现显示结果为系统的 free 命令帮助,而不是库文件中的 free 函数帮助.查阅了一下,发现 man 的使 ...

  6. C++11基于范围的for循环

    C++11包含一种新的 for 循环,称为基于范围的 for 循环,可以简化对数组元素的遍历.格式如下: for(Type VarName : Array){ //每个元素的值会依次赋给 VarNam ...

  7. 总结工作中常见的linux命令

    本文是总结下自己在工作中遇到的常见linux 命令,会持续更新! 1.文件路径切换 进入 cd 返回上一级  cd .. 2.复制 cp 源文件名 目标文件夹 cp log.log test5 3.编 ...

  8. Andy - 又一款速度流畅的免费安卓 Android 模拟器 (支持手机无线控制电脑模拟器)

    随着 Genymotion.BlueStacks 等电脑上的 Android 模拟器流行起来之后,似乎很多人都发现在电脑上运行使用安卓APP软件.畅玩手机游戏确实很有乐趣. 今天我们又发现了一款全新免 ...

  9. 用shell脚本监控进程是否存在 不存在则启动的实例

    用shell脚本监控进程是否存在 不存在则启动的实例,先上代码干货: #!/bin/shps -fe|grep processString |grep -v grepif [ $? -ne 0 ]th ...

  10. module not exists: xxxx Error in ThinkPHP

    Introduction ThinkPHP is a very charming PHP framework to easily build a website. It's structured in ...