Linux系统环境下Tomcat8、httpd、mysql8开机自启动配置
Linux系统环境下Tomcat8、httpd、mysql8开机自启动配置:
相关命令:chkconfig
参考链接:https://jingyan.baidu.com/article/6525d4b1382f0aac7d2e9421.html
CHKCONFIG(8) System Manager's Manual CHKCONFIG(8)
NAME
chkconfig - updates and queries runlevel information for system services
SYNOPSIS
chkconfig [--list] [--type type] [name]
chkconfig --add name
chkconfig --del name
chkconfig --override name
chkconfig [--level levels] [--type type] [--no-redirect] name <on|off|reset|resetpriorities>
chkconfig [--level levels] [--type type] [--no-redirect] name
DESCRIPTION
chkconfig provides a simple command-line tool for maintaining the /etc/rc[0-6].d directory hierarchy by relieving system administrators of the task of
directly manipulating the numerous symbolic links in those directories.
This implementation of chkconfig was inspired by the chkconfig command present in the IRIX operating system. Rather than maintaining configuration informa‐
tion outside of the /etc/rc[0-6].d hierarchy, however, this version directly manages the symlinks in /etc/rc[0-6].d. This leaves all of the configuration
information regarding what services init starts in a single location.
chkconfig has five distinct functions: adding new services for management, removing services from management, listing the current startup information for
services, changing the startup information for services, and checking the startup state of a particular service.
When chkconfig is run with only a service name, it checks to see if the service is configured to be started in the current runlevel. If it is, chkconfig
returns true; otherwise it returns false. The --level option may be used to have chkconfig query an alternative runlevel rather than the current one.
When chkconfig is run with the --list argument, or no arguments at all, a listing is displayed of all services and their current configuration.
If one of on, off, reset, or resetpriorities is specified after the service name, chkconfig changes the startup information for the specified service. The
on and off flags cause the service to be started or stopped, respectively, in the runlevels being changed. The reset flag resets the on/off state for all
runlevels for the service to whatever is specified in the init script in question, while the resetpriorities flag resets the start/stop priorities for the
service to whatever is specified in the init script.
By default, the on and off options affect only runlevels 2, 3, 4, and 5, while reset and resetpriorities affects all of the runlevels. The --level option
may be used to specify which runlevels are affected.
Note that for every service, each runlevel has either a start script or a stop script. When switching runlevels, init will not re-start an already-started
service, and will not re-stop a service that is not running.
chkconfig also can manage xinetd scripts via the means of xinetd.d configuration files. Note that only the on, off, and --list commands are supported for
xinetd.d services.
chkconfig supports a --type argument to limit actions to only a specific type of services, in the case where services of either type may share a name. Pos‐
sible values for type are sysv and xinetd.
OPTIONS
--level levels
Specifies the run levels an operation should pertain to. It is given as a string of numbers from 0 to 6. For example, --level 35 specifies runlevels
3 and 5.
--no-redirect
When chkconfig is run on a system that uses systemd as its init system, chkconfig will forward commands to systemd if a systemd service file exists
for it. This switch turns off the redirection to systemd and only operates on the symlinks in /etc/rc[0-6].d. This option is only valid when on,
off, or no command (to check enablement) is passed to a service.
--add name
This option adds a new service for management by chkconfig. When a new service is added, chkconfig ensures that the service has either a start or a
kill entry in every runlevel. If any runlevel is missing such an entry, chkconfig creates the appropriate entry as specified by the default values in
the init script. Note that default entries in LSB-delimited 'INIT INFO' sections take precedence over the default runlevels in the initscript; if any
Required-Start or Required-Stop entries are present, the start and stop priorities of the script will be adjusted to account for these dependencies.
--del name
The service is removed from chkconfig management, and any symbolic links in /etc/rc[0-6].d which pertain to it are removed.
Note that future package installs for this service may run chkconfig --add, which will re-add such links. To disable a service, run chkconfig name
off.
--override name
If service name is configured exactly as it would be if the --add option had been specified with no override file in /etc/chkconfig.d/name, and if
/etc/chkconfig.d/name now exists and is specified differently from the base initscript, change the configuration for service name to follow the over‐
rides instead of the base configuration.
--list name
This option lists all of the services which chkconfig knows about, and whether they are stopped or started in each runlevel. If name is specified,
information in only display about service name.
RUNLEVEL FILES
Each service which should be manageable by chkconfig needs two or more commented lines added to its init.d script. The first line tells chkconfig what run‐
levels the service should be started in by default, as well as the start and stop priority levels. If the service should not, by default, be started in any
runlevels, a - should be used in place of the runlevels list. The second line contains a description for the service, and may be extended across multiple
lines with backslash continuation.
For example, random.init has these three lines:
# chkconfig: 2345 20 80
# description: Saves and restores system entropy pool for \
# higher quality random number generation.
This says that the random script should be started in levels 2, 3, 4, and 5, that its start priority should be 20, and that its stop priority should be 80.
You should be able to figure out what the description says; the \ causes the line to be continued. The extra space in front of the line is ignored.
chkconfig also supports LSB-style init stanzas, and will apply them in preference to "chkconfig:" lines where available. A LSB stanza looks like:
### BEGIN INIT INFO
# Provides: foo
# Required-Start: bar
# Defalt-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Foo init script
### END INIT INFO
In this case, the start priority of "foo" would be changed such that it is higher than the "bar" start priority, if "bar" is enabled. Care must be taken
when adding dependencies, as they can cause vast shifts in the start and stop priorities of many scripts.
OVERRIDE FILES
Files in /etc/chkconfig.d/servicename are parsed using the same comments that chkconfig notices in init service scripts, and override values in the init
service scripts themselves.
SEE ALSO
init(8) ntsysv(8) system-config-services(8)
AUTHOR
Erik Troan <ewt@redhat.com>
4th Berkeley Distribution Wed Oct 8 1997 CHKCONFIG(8)
Manual page chkconfig(8) line 81/130 (END) (press h for help or q to quit)
Linux系统环境下Tomcat8、httpd、mysql8开机自启动配置的更多相关文章
- Linux下的应用程序开机自启动
Linux下的应用程序开机自启动,目前我知道的有2种: 1.将启动语句写到/etc/rc.local 2.在init.d放置启动脚本 第一种,很简单,直接写进去就行,比如说: /db/mongodb/ ...
- linux系统下tomcat应用开机自启动 配置
linux系统下tomcat应用开机自启动 配置 相对简单的方式是将tomcat添加为系统服务第一步 复制文件将 $Tomcat_Home/bin目录下的 catalina.sh脚本文件复制到目录/ ...
- 转载:ubuntu 下添加简单的开机自启动脚本
转自:https://www.cnblogs.com/downey-blog/p/10473939.html linux下添加简单的开机自启动脚本 在linux的使用过程中,我们经常会碰到需要将某个自 ...
- Linux系统环境下MySQL数据库源代码的安装
Linux系统环境下MySQL数据库源代码的安装 基本环境:CentOS Linux release 7.8.2003 (Core).MySQL5.6 一. 安装环境准备 若要在Linux系 ...
- ZT Linux系统环境下的Socket编程详细解析
Linux系统环境下的Socket编程详细解析 来自: http://blog.163.com/jiangh_1982/blog/static/121950520082881457775/ 什么是So ...
- linux下Oracle数据库实例开机自启动设置
linux下数据库实例开机自启动设置 1.改动/oratab [root@org54 ~]# vi/etc/oratab --把N改为Y,例如以下提示 # This file is used ...
- Linux(CentOS7)下rpm安装MySQL8.0.16
记录一下自己在 CentOS7 下 rpm 安装 MySQL8.0.16 的过程. 一.准备工作 1. 下载MySQL所需要的安装包 从 MySQL官网 下载,上传至 CentOS 系统 /usr/l ...
- linux环境下安装oracle步骤和自启动oracle
oracle安装步骤 一.创建用户 --注释-- /etc/passwd 用户配置文件 /etc/shadow 用户密码文件 /etc/group 组 组用户文件/etc/gshadow 组密码文件 ...
- 【Linux】Cent OS 虚拟机开机自启动配置
一次断电,导致实体机关机了,虚拟机也连不上去,只好手动来起来. 我想增加一下自启动,让硬件开机的时候,自动启动虚拟机: 其实是有办法的,尝试了一下,也成功了,这里简单标记下. virsh autost ...
随机推荐
- 使用MobaXterm远程连接Ubuntu,启动Octave,界面不能正常显示
使用MobaXterm远程连接Ubuntu,启动Octave,界面不能正常显示,键盘输入无法显示,解决方法如下. 在启动octave之前,输入这两个命令: export GTK_MODULES=gai ...
- Android最火热修复实战
Sophix官网文档地址 https://help.aliyun.com/document_detail/53240.html 快速接入 项目build.gradle的repositories节点下添 ...
- elment重置表格行高,hover效果
来源网络,做个笔记.表头行高.el-table__header tr, .el-table__header th { padding: 0; height: 50px; }表体行高 .el-table ...
- numpy中的stack操作:hstack()、vstack()、stack()、dstack()、vsplit()、concatenate()
stack():沿着新的轴加入一系列数组. vstack():堆栈数组垂直顺序(行) hstack():堆栈数组水平顺序(列). dstack():堆栈数组按顺序深入(沿第三维). concatena ...
- 输入系统:进程间双向通信(socketpair+binder)
一.双向通信(socketpair) socketpair()函数用于创建一对无名的.相互连接的套接子,如果函数成功,则返回0,创建好的套接字分别是sv[0]和sv[1]:否则返回-1,错误码保存于e ...
- spark中map与flatMap的区别
作为spark初学者对,一直对map与flatMap两个函数比较难以理解,这几天看了和写了不少例子,终于把它们搞清楚了 两者的区别主要在于action后得到的值 例子: import org.apac ...
- 关于Flex布局
Flex是Flexible Box的缩写,意为“弹性布局”.弹性布局提供了一种更加有效的方式来对一个容器内的项目进行排列/对齐/分配空间等操作,让盒模型具有更大的灵活性.在一个容器盒子上添加displ ...
- scrapy_redis项目配置
一.创建普通scrapy项目 二.spiders爬虫文件中修改项 import scrapy from XX.items import XXItem import json # ----1 导入类 f ...
- Rewrite json
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http ...
- js datagrid 移动去重
function dataLeft(){ var checkedData = $(listTemplate_right).datagrid('getChecked'); var rows = $(li ...