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 ...
随机推荐
- lumion材质系统室内渲染6.3
材质系统是对于导入的模型,而不对自带的模型起作用.自带的模型有的能改变属性. 点击“材质”点击墙,出来材质库.为墙体赋予一种材质, 完成后点击保存,就可以保存了.然后给窗户添加玻璃材质. 可以看到墙, ...
- java操作svn工具类SvnUtil
直接上代码,工作中使用的版本,记录下. public class SvnUtil { private static Logger logger = Logger.getLogger(SvnUtil.c ...
- Win10系列:C#应用控件进阶4
多边形 若要绘制多边形需要用到Polygon元素,并通过定义一系列的点绘制多边形.Polygon类型的对象有Points属性, 这个属性用来定义组成边的点集.在前台代码中,使用空格分隔各个点,然后利用 ...
- Android 音视频深入 十八 FFmpeg播放视频,有声音(附源码下载)
项目地址https://github.com/979451341/AudioVideoStudyCodeTwo/tree/master/FFmpegv%E6%92%AD%E6%94%BE%E8%A7% ...
- unity中EventTrigger组件的应用
using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using D ...
- jsp页面<%@ page报错问题
eclipse中的web项目jsp页面<%@报错如下图所示: 解决办法: 在项目上右键→ Build Path → Configure Build Path... Libraries → add ...
- 关于input
form表单的使用: 1.iuput:type:类型有很多常用的: text:输入的内容为文本格式(内容可见) password:输入的内容为......(内容不可见) radio:显示为单选框(框为 ...
- Spring使用ioc注解方式配置bean
context层 : 上下文环境/容器环境 applicationContext.xml 具体示例: 现在ioc容器中添加context层支持: 包括添加xmlns:context.xsi:schem ...
- 运行python脚本时,报错InsecurePlatformWarning: A true SSLContext object is not available,解决方法
今天,要在新环境里运行一个python脚本,遇到下面的报错: /usr/lib/python2.7/site-packages/urllib3/util/ssl_.py:160: InsecurePl ...
- Python入门学习例子——从Hao123获取图片
import urllib.requestimport re #获取html页面内容def getHtml(url): data=urllib.request.urlopen(url) pageCon ...