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 ...
随机推荐
- Python_Mix*OS模块,序列化模块种的json,pickle
os.path.basename(path)返回path最后的文件名,如何path以/或\结尾,那么就会返回空值,即os.path.split(path)的第一个元素 ret = os.path.ba ...
- Java代码调用服务器上的Shell脚本
Java代码调用服务器上的Shell脚本 这里主要是因为我们报表平台有用到用户手工录入的数据作为结果数据且需要纳入saiku去展示 如我们所知,saiku不会自动刷新,所以需要在数据更新接口中调用服务 ...
- Linux配置JDK、Tomcat和Mysql免安装版
现在已有JDK.Tomcat和mysql的tar.gz压缩文件 1.解压文件 (1)解压tar.gz tar -zxvf 待解压文件名 -C 解压到目标文件目录 (2)解压zip unzip 待解压文 ...
- 一条命令关掉centos所有不必要的服务和端口号
centos作为服务器开放的服务多了,难免一些服务软件有漏洞,开放的端口号越多,上线的服务器越危险,所以我们必须在服务器上线之前把centos里面不必要的服务全部干掉,不让坏人有可乘之机. 首先看一下 ...
- idea使用错误及技巧总结合集(一)
--- Cannot start process, the working directory 'E:\algorithm\algorithm' does not exist 1.点击run后再点击e ...
- jenkins 关闭和重启的实现
jerkins自带的重启手段重启过程缓慢,在jenkins的操作过程中可使用以下操作: 关闭Jenkins 只需要在访问jenkins服务器的网址url地址后加上exit.例如我jenkins的地址h ...
- 在servlet中跳转问题
跳转有重定向和转发 1重定向 2转发
- 004dayPython学习输入并输出用户名和密码
在python 2.7中,捕获用户输入用raw_input 一.捕获并打印用户名和密码 要求: 输入用户名和密码都可见 # -*- coding:utf-8 -*-userName = raw_inp ...
- node.js学习三--------------------- http服务器模块的搭建
/** * http服务器的搭建,相当于php中的Apache或者java中的tomcat服务器 */ // 导包 const http=require("http"); //创建 ...
- Python数据库连接池---DBUtils
Python数据库连接池DBUtils DBUtils是Python的一个用于实现数据库连接池的模块. 此连接池有两种连接模式: 模式一:为每个线程创建一个连接,线程即使调用了close方法,也不 ...