linux中将程序加入到开机自动启动

如果将在linux中将命令或者程序设置为开机自动启动,只需要进入到将对应命令加入到/etc/rc.d/rc.local文件里即可,如下

打开文件,vi /etc/rc.d/rc.local

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local


/usr/local/apache-tomcat-6.0.37/bin/startup.sh    --设置tomcat为开机自动启动程序。
sh /rpc_start.sh                                        ---设置rpc_start.sh脚本为开机自动启动程序。
~

原文地址:https://www.cnblogs.com/jinjiangongzuoshi/p/3337119.html