Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要将启动脚本放到我的 CentOS6 服务器上。
我看到我需要一个包含启停案例的脚本。但是我有一个问题,也没有如何启动这个脚本。
任何人都可以告诉我如何添加它?
该脚本必须运行一个运行 jar 文件的简单命令:
java -jar FileName.jar
最简单的方法是将您的命令添加到文件中
/etc/rc.d/rc.local
上述文件中的命令在启动时运行(以 root 身份)。请注意,如果您这样做,您的命令将不会响应通常的服务启动/停止命令。