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 ...
随机推荐
- sqlserver数据库 视图相关
1.首先创建一个视图 方法一:右键解决 方法二:脚本 create view view_test AS select * from t1 GO 2.删除视图 方法1:右键解决 方法2:脚本 if ex ...
- 常用的lamp环境以及一些依赖包的安装
- 基于MAVEN使用IDEA创建dubbo入门项目图文教程
花了很长时间没有找到一个很详细的图文教程来学习dubbo入门框架,故记录下来. 一: 项目工程目录 简单介绍项目目录结构: 二: 创建父工程 具体操作步骤: 1,打开IDEA,按下面步骤来 File- ...
- PHP运算符知识
1.三目运算符: $a =1; echo $a>0 ? '大于0':$a==0 ? '等于0':'小于0'; 貌似应该输出:大于0 其实: 然而,上面语句的实际输出是't',因为三元运算符是从左 ...
- 基于服务器AAA的实验
1.实验拓扑 2.地址分配 Device Interface IP Address Subnet Mask R0 Fa0/0 192.168.1.2 255.255.255.0 S ...
- Google Quic协议
0x01 Quic QUIC协议于2012年实现,2015年提交RFC草案,它是Goolge为了解决当今WEB应用常见的传输层和应用层问题而提出的,从分层结构上可以看做是TCP+TLS+HTTP2的集 ...
- gridview单击选中勾选框
1.Dev2005版本: gridView1.OptionsBehavior.ShowEditorOnMouseUp = false;2.Dev2013版本: gridView1.OptionsBeh ...
- 获取.properties后缀的数据
在MyPro.properties中的数据如下: Name=ABC 测试类中: Properties properties = new Properties(); String configFile ...
- 第九次作业——K-means算法应用:图片压缩
一.读取一张示例图片或自己准备的图片,观察图片存放数据特点. 根据图片的分辨率,可适当降低分辨率. 再用k均值聚类算法,将图片中所有的颜色值做聚类. 然后用聚类中心的颜色代替原来的颜色值. 形成新的图 ...
- node作为中间层 —> 跨域请求java后台接口(使用http-proxy-middleware中间件)
情景:利用node的express 作为中间层,跨域调取java后台接口,由于java接口对session有判断,因此每次请求都必须在req的headers中需要带上cookie,否则接口报500错误 ...