1.service用法

  1. service SCRIPT COMMAND [OPTIONS]      #执行脚本中方法,最常用法
  2. service --status-all              #查看所有服务的运行状态
  3. service --help | -h | --version       #显示帮助等信息

以service httpd start为例,对这条命令的一般理解是启动httpd服务,这没什么问题;但假如我安装了一个名为test的程序,为什么我们不能通过service test start来启动呢;所以问题在于,service httpd start这条命令到底是怎么完成的。

其实httpd本质上不是服务的名称,而是/etc/init.d目录下脚本的名称;start本质上也不是什么命令,而是脚本中的case分支。

这的意思就是你将/etc/init.d目录下的httpd重命名为http,那么就完全可以通过service http start来启动httpd服务。

脚本名取名为服务名只是方便和习惯问题,分支为start和stop等也一样,都可以自定义;你也完全可以再添加自己想要的分支标志。

所以回过头来安装的test不能通过service来启动的问题很好回答了,那是且只是他在/etc/init.d目录下没有(写有启动分支的)脚本。

另外,linux服务开机自启动的实现,表面上看是在/etc/initx.d目录的文件(x即启动级别)中写入启动脚本,本质上这些文件绝大多数都是/etc/init.d目录文件的软链接,即服务自启动还是调用各服务在/etc/init.d相应文件中的start分支来启动。

2.Linux服务列表

由第一点可以想到,想知道系统当前带了哪些服务,那就到/etc/init.d目录下看有哪些脚本就好了;

服务 说明 作用
abrtd automated bug reporting tool´s daemon 记录进程冲突情况进程
acpid  Advanced Configuration and Power Interface event daemon 检测用户程序涉及硬件的配置的进程
atd run jobs queued for later execution 定时执行任务
auditd The Linux Audit daemon 系统审计进程
autofs Control Script for automounter 自动挂载文件系统
bluetooth   蓝牙
certmonger   CA证书有效性监视
cpuspeed user-space cpu frequency scaling program CPU频率调节
cron daemon to execute scheduled commands 定时任务
cpus Common UNIX Printing System 管理打印机
dnsmasq A lightweight DHCP and caching DNS server DNS缓存
firstboot   首次开机配置向导
haldaemon   键鼠等外设注册
halt reboot or stop the system 关机
hsqldb HyperSQL DataBase 轻量级开源java数据库
htcacheclean Clean up the disk cache 限制磁盘缓存大小
httpd Apache Hypertext Transfer Protocol Server web服务器
ip6tables IPv6 packet filter administration IPV6包过滤防火墙
ipsec invoke IPsec utilities ipsec协助
iptables administration tool for IPv4 packet filtering and NAT IPV4防火墙
irqbalance distribute hardware interrupts across processors on a mul-
tiprocessor system
多核CPU间的平衡
iscsi Internet Small Computer System Interface 网絡传输存储
iscsid Open-iSCSI daemon 网絡传输存储管理
kdump   系统故障时保存内存参数
killall kill processes by name 按名称关闭程序
lldpad Link Layer Discovery Protocol (LLDP) agent daemon 处理LLDP协议
lvm2-monitor   lvm监视器
mdmonitor   媒体设备监视
messagebus   进程间通信
multipathd multipath daemon 多路存储协调
netcosole   将本机日志打印到远程机上
netfs   自动加载网絡文件系统
network   网絡配置
 NetworkManager  network management daemon 网络配置
 nfs  fstab format and options for the nfs file systems  网络文件共享
 nscd  name service cache daemon  用户相关命令缓存
nslcd local LDAP name service daemon 为进程访问目录服务
ntpd Network Time Protocol (NTP) daemon 时钟服务器
ntpdate set the date and time via NTP 时间同步工具
oddjobd   系统bug反馈服务
pcscd PC/SC Smart Card Daemon 读卡器服务
portreserve reserve ports to prevent portmap mapping them 端口占用反馈
postfix Postfix control program postfix邮件服务
quota_nld quota netlink message daemon 用于用户进程与内核通信
rdisc network router discovery daemon 网络路由检测
restorecond

daemon that watches for file creation and then sets the
default SELinux file context

selinux配置符合性审侅
rngd

Check and feed random data from hardware device to kernel random
device

系统随机数服务
rpcbind universal addresses to RPC program number mapper rpc端口映射
     

Linux服务列表(CentOS)的更多相关文章

  1. Windows主机里利用VMware安装Linux(CentOS)虚拟机,Host-only连接上网方式详解

    关于Host-only指的是主机与虚拟机之间的互联,因此虚拟机是不能连网的,若需要连网则需要使用NAT模式: Host-only模式实现联网得考虑如下配置过程: 附:VMware虚拟机三种网络模式(B ...

  2. 玩转Linux之- CentOS 7.0,启用iptables防火墙

    原文 玩转Linux之- CentOS 7.0,启用iptables防火墙 CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall:sy ...

  3. linux虚拟机CentOS 7完整安装流程截图

    安装VMware虚拟机过程此处省略,只介绍在虚拟机上安装linux系统CentOS 7过程截图. 1 新建虚拟机 2 命名虚拟机,选择linux安装位置 3 选择虚拟机处理器数量和处理器核心数 4 分 ...

  4. 如何设置Linux(Centos)系统定期任务(corntab详细用法)

    如何设置Linux(Centos)系统定期任务(crontab详细用法) 1.Crontab简介 Linux 系统则是由 cron (crond) 这个系统服务来控制的.Linux 系统上面原本就有非 ...

  5. linux(centos)上安装mysql教程,为需要远程登录的用户赋予权限

    最近把之前学生时代的win server换成了linux(centos)系统,因为win对于部署一些项目时候比较麻烦,直接入正题 1.准备阶段 我使用xshell工具管理服务器,相应下载和安装自行百度 ...

  6. VMware 安装Linux系统 CentOS

    VMware 安装Linux系统 CentOS 1.  下载镜像系统 centos镜像下载地址:https://www.centos.org/download/ 选择DVD下载即可 linux各版本下 ...

  7. Asp.Net Core 程序部署到Linux(centos)生产环境(二):docker部署

    运行环境 照例,先亮环境:软件的话我这里假设你已经批准好了.net core 运行环境,未配置可以看我的这篇[linux(centos)搭建.net core 运行环境] 腾讯云 centos:7.2 ...

  8. Asp.Net Core 程序部署到Linux(centos)生产环境(一):普通部署

    运行环境 照例,先亮底 centos:7.2 cpu:1核 2G内存 1M带宽 辅助工具:xshell xftp 搭建.net core运行环境 .net core 的运行环境我单独写了一篇,请看我的 ...

  9. linux(CentOS)磁盘挂载数据盘

    linux(CentOS)磁盘挂载数据盘:第一步:查看是否存在需要挂载的磁盘: sudo fdisk -l 第二步:为需要挂载的磁盘创建分区: sudo fdisk /dev/vdb 执行中:依次选择 ...

随机推荐

  1. JaveWeb 公司项目(6)----- 通过ToolTip给控件添加动态注释

    现在公司的项目进展到了视屏这一块,关于海康网页端的构建我会另外写一篇博客来详细讲解,这一篇的博文主要讲的是我刚刚遇到的一个小问题 连接上了视屏之后,将控制按钮换成图标,方位按钮比较好理解,调焦调距的按 ...

  2. file_put_contents结合print_r,打造日志功能

    <?php $log = []; $log['name'] = '张三'; $log['age'] = '15'; $log['date'] = date('Y-m-d'); echo prin ...

  3. VC.【转】窗口置于前台并激活的方法

    1.VC 窗口置于前台并激活的方法 - CSDN博客.html https://blog.csdn.net/oXunFeng/article/details/52681279 2.(http://ww ...

  4. 重装win7系统并激活

    备份 大白菜制作启动盘 下载大白菜软件UEFI版(新电脑使用uefi版本,装机版支持的主板多) 选择默认安装 选择默认模式开始制作 下载iso镜像文件,复制到u盘(手动复制) 设置bios       ...

  5. Boostrap本地导入js文件

    我一般都是用CDN直接导入的,但是有时候需要自己添加一些功能进入,会用到本地导入.关于导入路径问题,做个笔记. 使用HBuilder,首先右键导入相应的js/cs文件 然后是常规——>文件系统 ...

  6. 滑动验证 和滑动图片验证JS

    滑动验证 先放效果图 <!DOCTYPE html> <html lang="en"> <head> <meta charset=&quo ...

  7. leecode第五十四题(螺旋矩阵)

    class Solution { public: vector<int> spiralOrder(vector<vector<int>>& matrix) ...

  8. css设置字体单行,多行超出省略号显示

    单行: overflow: hidden; text-overflow:ellipsis; white-space: nowrap; 多行 display: -webkit-box; -webkit- ...

  9. angular2 学习笔记 (Typescript - Attribute & reflection & decorator)

    更新 : 2018-11-27 { date: Date } 之前好像搞错了,这个是可以用 design:type 拿到的 { date: Date | null } 任何类型一但配上了 | 就 de ...

  10. python float转为decimal

    73.2413793103 ======= 73.2414 <type 'float'> ======= <class 'decimal.Decimal'> 当断言这两个值相等 ...