Linux 基础14 rpm包安装的独立服务的管理

这里主要讲解rpm安装的独立服务的管理,这里的独立是相对于xinted 而言的。

rpm包安装的默认位置

/etc/init.d 启动脚本位置

/etc/sysconfig 初始化环境配置文件位置

/etc 配置文件位置

/etc/xinetd.conf xinetd配置文件位置

/etc/xinetd.d 基于xinetd服务的启动脚本

/var/lib 服务产生的数据放在这里

/var/log 日志

 

独立服务的启动方法

/etc/init.d/独立服务名 start|stop|status|restart

service 独立服务名 start|stop|restart|status

据说service是redhat专有命令

 

service --status-all 列出系统中所有rpm安装的包的状态

 

独立服务的自启动

1.chkconfig [--level 运行级别] [独立服务名] [on|off]

2.修改/etc/rc.d/rc.local文件(ubuntu /etc/init.d/rc 或者 rc.local)

3.使用ntsysv命令管理自启动(图形界面类似于setup)

[root@Liu-Centos init.d]# chkconfig --list | grep httpd

httpd           0:关闭  1:关闭  2:关闭  3:关闭  4:关闭  5:关闭  6:关闭

[root@Liu-Centos init.d]# chkconfig --level 2345 httpd on

[root@Liu-Centos init.d]# chkconfig --list | grep httpd

httpd           0:关闭  1:关闭  2:启用  3:启用  4:启用  5:启用  6:关闭

[root@Liu-Centos init.d]# chkconfig --level 2345 httpd off

 

 

[root@Liu-Centos init.d]# vim /etc/rc.d/rc.local  (linux自启动时会读取该文件)

#!/bin/sh

#

# This script will be executed *after* all the other init scripts.

# You can put your own initialization stuff in here if you don't

# want to do the full Sys V style init stuff.

 

touch /var/lock/subsys/local

/etc/rc.d/init.d/httpd start 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值