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开机自启动配置的更多相关文章

  1. Linux下的应用程序开机自启动

    Linux下的应用程序开机自启动,目前我知道的有2种: 1.将启动语句写到/etc/rc.local 2.在init.d放置启动脚本 第一种,很简单,直接写进去就行,比如说: /db/mongodb/ ...

  2. linux系统下tomcat应用开机自启动 配置

    linux系统下tomcat应用开机自启动 配置 相对简单的方式是将tomcat添加为系统服务第一步  复制文件将 $Tomcat_Home/bin目录下的 catalina.sh脚本文件复制到目录/ ...

  3. 转载:ubuntu 下添加简单的开机自启动脚本

    转自:https://www.cnblogs.com/downey-blog/p/10473939.html linux下添加简单的开机自启动脚本 在linux的使用过程中,我们经常会碰到需要将某个自 ...

  4. Linux系统环境下MySQL数据库源代码的安装

    Linux系统环境下MySQL数据库源代码的安装 基本环境:CentOS Linux release 7.8.2003 (Core).MySQL5.6 一.      安装环境准备 若要在Linux系 ...

  5. ZT Linux系统环境下的Socket编程详细解析

    Linux系统环境下的Socket编程详细解析 来自: http://blog.163.com/jiangh_1982/blog/static/121950520082881457775/ 什么是So ...

  6. linux下Oracle数据库实例开机自启动设置

    linux下数据库实例开机自启动设置 1.改动/oratab [root@org54 ~]# vi/etc/oratab     --把N改为Y,例如以下提示 # This file is used ...

  7. Linux(CentOS7)下rpm安装MySQL8.0.16

    记录一下自己在 CentOS7 下 rpm 安装 MySQL8.0.16 的过程. 一.准备工作 1. 下载MySQL所需要的安装包 从 MySQL官网 下载,上传至 CentOS 系统 /usr/l ...

  8. linux环境下安装oracle步骤和自启动oracle

    oracle安装步骤 一.创建用户 --注释-- /etc/passwd 用户配置文件 /etc/shadow 用户密码文件 /etc/group 组 组用户文件/etc/gshadow 组密码文件 ...

  9. 【Linux】Cent OS 虚拟机开机自启动配置

    一次断电,导致实体机关机了,虚拟机也连不上去,只好手动来起来. 我想增加一下自启动,让硬件开机的时候,自动启动虚拟机: 其实是有办法的,尝试了一下,也成功了,这里简单标记下. virsh autost ...

随机推荐

  1. 中文乱码 URLEncode之后,后台获取仍是乱码问题详解

    java中获取到参数的时候,这时候默认使用的是iso8859-1进行解码的,那么就再使用URLEncode的encoe方法对其进行编码一次,编码格式使用iso8859-1,这样我们就获得最初使用utf ...

  2. 阿里云Oss对象存储

    将文件保存到阿里云上. 1.添加对象存储OSS空间 (新建Bucket) 可以在阿里云后台对象存储里面添加,也可以通过api添加.添加之后设置权限. skd使用. 1安装 Aliyun.OSS.SDK ...

  3. unity中多个门的开关动画保持独立性

    List<Animation> storeAnimation; public void Awake() { storeAnimation = new List<Animation&g ...

  4. 【转载】curl 模拟 GET\POST 请求,curl查看响应头 以及 curl post 上传文件

    补充说明:curl查看响应头 curl -I "http://www.baidu.com"HTTP/1.1 200 OK #HTTP协议 HTTP 返回码Server: Tengi ...

  5. DataGridView中的DataGridViewComboBoxColumn 让其值改变联动

    在工作中自己也遇到过这类问题, 最近也有很多人问我这个问题, 就此机会写出来记录一下. 首先,顾名思义,值改变事件我们会想到 dataGridView1_CellValueChanged 这个事件,想 ...

  6. vs2017 无法提交到tfs的 git存储库

    tfs 是2018版本 使用git 工具是可以提交成功. 使用vs2017的 就会一直提示 授权失败 也可以使用新安装的git https://blog.csdn.net/Meteor_s/artic ...

  7. 开通blog,记录学习历程

    2017.12.15日,开通blog,用于回忆知识点的记录和整理. 开通本blog主要做以下几点事情: 1.巩固知识点,基础打牢: 2.在基础牢固的基础上,学习流行的框架: 3.在框架牢固的基础上学习 ...

  8. SharePoint Framework 基于团队的开发(三)

    博客地址:http://blog.csdn.net/FoxDave 用内部包进行开发 由于你的团队在开发客户端解决方案,你很可能构建通用代码库来在项目中重用.在很多情况下这种库包含的代码是内部所有的不 ...

  9. hdu4003详解(树形dp+多组背包)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4003 Find Metal Mineral Time Limit: 2000/1000 MS (Jav ...

  10. List<T>.ForEach 调用异步方法的意外

    有这么个异步方法 private static async Task<int> Compute(int s) { return await Task<int>.Run(() = ...