chkconfig命令 centos 开机启动命令
、利用 chkconfig 来配置启动级别
在CentOS或者RedHat其他系统下,如果是后面安装的服务,如httpd、mysqld、postfix等,安装后系统默认不会自动启动的。就算手动执行 /etc/init.d/mysqld start 启动了服务,只要服务器重启后,系统仍然不会自动启动服务。 在这个时候,我们就需要在安装后做个设置,让系统自动启动这些服务,避免不必要的损失和麻烦。 其实命令很简单的,使用chkconfig即可。 比如要将mysqld设置为开机自动启动: chkconfig mysqld on
要取消掉某个服务自动启动,只需要将最后的参数 “on” 变更为 “off” 即可。
比如要取消 postfix 的自动启动: chkconfig postfix off
值得注意的是,如果这个服务尚未被添加到 chkconfig 列表中,则现需要使用 –-add 参数将其添加进去: chkconfig –-add postfix
如果要查询当前所有自动启动的服务,可以输入: chkconfig -–list
如果只想看指定的服务,只需要在 “–-list” 之后加上服务名就好了,比如查看httpd服务是否为自动启动: chkconfig –-list httpd httpd :off :off :off :off :off :off :off
此时0~6均为off,则说明httpd服务不会在系统启动的时候自动启动。我们输入: chkconfig httpd on
则此时为: httpd :off :off :on :on :on :on :off
这个时候2~5都是on,就表明会自动启动了。
、修改 /etc/rc.d/rc.local 这个文件:
例如将 apache、MySQL、samba、svn 等这些服务的开机自启动问题一起搞定: vi /etc/rc.d/rc.local
#添加以下命令
/usr/sbin/apachectl start
/etc/rc.d/init.d/mysqld start
/etc/rc.d/init.d/smb start
/usr/local/subversion/bin/svnserve -d
chkconfig命令 centos 开机启动命令的更多相关文章
- 【问题记录】centos 开机启动命令未执行
查看日志 /var/log/boot.log 看具体原因,有可能脚本执行有问题, 当你在系统已经启动的时候,脚本执行没问题不代表开机启动能运行
- Ubuntu 16.04设置rc.local开机启动命令/脚本的方法
Ubuntu 16.04设置rc.local开机启动命令/脚本的方法 Ubuntu 16.04设置rc.local开机启动命令/脚本的方法(通过update-rc.d管理Ubuntu开机启 ...
- Linux CentOS开机启动项设置命令:chkconfig
1.开机启动+++crontab 定时执行(定时执行可参考:https://www.cnblogs.com/prefectjava/p/9399552.html)可实现自动化运行的目的,简化了维护人员 ...
- Mac下用Launchd实现使用rc.local执行开机启动命令
其实原理很简单,使用Launchd创建一个开机启动的服务,然后这个服务关联/etc/rc.local文件,那么接下来操作rc.local就和Linux下一样的了. 当然,这种思路还可以直接使用在~/. ...
- Ubuntu 16.04设置rc.local开机启动命令/脚本的方法(通过update-rc.d管理Ubuntu开机启动程序/服务)
注意:rc.local脚本里面启动的用户默认为root权限. 一.rc.local脚本 rc.local脚本是一个Ubuntu开机后会自动执行的脚本,我们可以在该脚本内添加命令行指令.该脚本位于/et ...
- centos 开机启动服务
一.启动脚本 /etc/rc.local 启动 最简单的一种方式,在启动脚本 /etc/rc.local (其实 /etc/rc.local 是/etc/rc.d/rc.local 的软链接文件,实际 ...
- [转]CentOS开机启动脚本
转载自http://www.2cto.com/os/201306/220559.html 我的一个Centos开机自启动脚本的制作 一.切换到/etc/init.d/ 二.制作sh脚本 v ...
- Debian/Ubuntu/CentOS开机启动
说明:常用的Linux启动项就是在/etc/rc.local的exit 0语句之间添加启动脚本,另一种方法,使用update-rc.d命令添加/禁止开机启动项. 在centos7中增加脚本有两种常用的 ...
- centos 开机启动服务 systemctl
systemctl 实现开机自启服务 转载起一个好听的名字 最后发布于2018-06-26 13:49:06 阅读数 13473 收藏 展开 systemctl是RHEL 7 的服务管理工具中主要的 ...
随机推荐
- EntityFramework之事务
一.EF事务 引用程序集 using System.Transactions; 用法 var writer = new System.IO.StringWriter(); try { using (v ...
- mgo mode说明
mgo 是 MongoDB 的 Golang 驱动. 连接池 我们通过 Dial 函数创建一个新的 session: session, err := mgo.Dial(url) 创建的 session ...
- Centos 6.5 freeswitch 编译mod_shout
1. yum install -y patch 2. yum install -y libshout-devel lame-devel libmpg123-devel 3. make install ...
- Flask允许跨域
什么是跨域 在 HTML 中,<a>, <form>, <img>, <script>, <iframe>, <link> 等标 ...
- Python-爬虫-租房Ziroom
目标站点需求分析 涉及的库 import requestsimport timeimport pymongofrom lxml import etreefrom requests.exceptions ...
- Python-爬虫-猫眼T100
目标站点需求分析 涉及的库 from multiprocessing import Poolfrom requests.exceptions import RequestExceptionimport ...
- centos6.5 Python.7 pip install PIL --allow-external PIL --allow-unverified PIL报错 no such option: --allow-external
解决办法 pip install pillow 使用from PIL import Image ,正常!!
- poj1564 Sum It Up dfs水题
题目描述: Description Given a specified total t and a list of n integers, find all distinct sums using n ...
- js 对象的循环
var car = {type:"Fiat", model:500, color:"white"}; var arr = array(); for(i in c ...
- ORACLE_修改实例的内存大小
注:本文来源于:星火spark <Oracle的实例占用内存调整> ORACLE_修改实例的内存大小 一:修改oracle数据库实例内存大小脚本 ---- 1.操作 (oracle使用内 ...