Centos 6&7下服务启动方法及添加到开机启动

在linux系统中,安装完一个软件或应用后,有时候需要手动启动该应用,也需要收到将该应用添加到开机启动项中,让其可以能够在linux一开机后就加载该应用

启动应用的方法

CentOS 6 :

service SERVICE start|stop|restart|reload|status

CentOS 7 :

systemctl start|stop|restart|reload|status SERVICE

添加到开机启动项的方法

CentOS 6 :

chkconfig SERVICE on|off

CentOS 7 :

systemctl enable|disable SERVICE

Centos 6&7下服务启动方法及添加到开机启动

时间: 2024-08-05 11:11:54

Centos 6&7下服务启动方法及添加到开机启动的相关文章

添加tomcat开机启动服务时报错:Neither the JAVA_HOME nor the JRE_HOME enviromment variable is defined

首先,参考的 https://blog.csdn.net/wabil/article/details/78818249 的方式添加 tomcat 开机启动,这种方式不需要添加 setenv.sh 文件,轻量级,非常方便,具体方式如下: 1. 创建一个服务文件 vim /lib/systemd/system/tomcat.service 复制如下内容,修改后保存: [Unit]Description=tomcatAfter=network.target [Service]Type=oneshotE

Linux Redis自动启动,Redis开机启动,Linux Redis设置开机启动

Linux Redis自动启动,Redis开机启动,Linux Redis设置开机启动 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ©Copyright 蕃薯耀 2017年7月21日 http://www.cnblogs.com/fanshuyao/ Linux Redis安装,Linux如何安

CentOS7添加需要开机启动的脚本

1.修改开机脚本添加文件的权限 [[email protected] ~]# cat /etc/rc.d/rc.local  #!/bin/bash # THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES # # It is highly advisable to create own systemd services or udev rules # to run scripts during boot instead of using this file

Golang 在 Linux CentOS 6.5 服务器上实现 博客后台程序开机启动

在linux下想实现开机启动的方法很多,这里我采用了在/etc/rc.local里写shell指令的方式. 以下就以我的实际操作为例子讲述,很多地方需要看官自己调整信息哦! 1.在/etc/rc.local文件中,添加你想要执行的脚本. 比如,我现在要执行的是Golang项目启动的脚本: ficowLogPath="/home/ficow/autoLaunchLog.txt" #launch ficow's blog server cd /home/ficow/ficowblog/sr

Linux启动原理介绍及设置开机启动脚本方法

转自本人个人博客:http://www.xgezhang.com/linux_init_shell.html 之前总是对Linux的整个启动脉络不了解,把这个问题看得很神秘,昨天稍微研究了一下,其实还是很简单的. Linux启动时,所有的启动脚本都放在/etc/init.d/ 下面,而这些脚本又有映射到各个/etc/rcX.d,这个X代表0-6,分别对应不同的系统级别: 0代表关机(halt) 1级别是单用户模式(single) 2级别是多用户级别,这个是默认级 3,4,5未定义,可以提供给用户

CentOS在VirtualBox下安装增强软件,添加共享文件夹,Xshell/Xftp的安装

1.点击VirtualBox的菜单项"设备",选择"安装增强功能".(此时光盘已加载在CDROM) 2.挂载光盘 #mkdir /mnt/cdrom // 新建目录 #mount /dev/cdrom /mnt/cdrom //装载光盘 #cd /mnt/cdrom #./VBoxLinuxAdditions.run 会提示kernel-devel版本不对 #yum -y install kernel-devel-2.6.32-504.el6.x86_64 // 根

Linux(centOS6.5)下SVN的安装、配置及开机启动

作为一名“万能”的码农,这种活儿你迟早要干的.----By Jimi没有bond 准备工作:yum 1.检查是否已安装 rpm -qa subversion 如果要卸载旧版本: yum remove subversion 2.安装 yum install subversion PS:yum install httpd httpd-devel subversion mod_dav_svn mod_auth_mysql(这是安装配合Apache的模块,我暂时还没做,做了再补上,你可以只装subver

[转]Linux(centOS6.5)下SVN的安装、配置及开机启动

1.检查是否已安装 rpm -qa subversion 如果要卸载旧版本: yum remove subversion 2.安装 yum install subversion PS:yum install httpd httpd-devel subversion mod_dav_svn mod_auth_mysql(这是安装配合Apache的模块,我暂时还没做,做了再补上,你可以只装subversion,多装了也无所谓) #确认是否已安装svn模块[[email protected] ~]#

tomcat 服务不支持 chkconfig 以及其他服务不能添加到开机启动时的操作

在安装完tomcat后想添加的开机自启动的操作,但是报错tomcat 服务不支持 chkconfig,后来在  /etc/init.d/tomcat中的#!/bin/bash后添加上#chkconfig: 2345 80 90,添加之后保存,然后在执行 chmod 755 /etc/init.d/tomcat 然后再  加入到自起动的列表中 chkconfig --add tomcat 查看自起列表: chkconfig --list|grep tomcat tomcat 0:关闭 1:关闭 2