<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://purl.org/rss/1.0/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel rdf:about="https://www.ishiguang.cn/feed/rss/tag/shell/">
<title>拾光 - shell</title>
<link>https://www.ishiguang.cn/tag/shell/</link>
<description></description>
<items>
<rdf:Seq>
<rdf:li resource="https://www.ishiguang.cn/17863.html"/>
</rdf:Seq>
</items>
</channel>
<item rdf:about="https://www.ishiguang.cn/17863.html">
<title>Linux自启动脚本编写</title>
<link>https://www.ishiguang.cn/17863.html</link>
<dc:date>2023-03-07T17:16:00+08:00</dc:date>
<description>本文章向大家介绍Linux里编写shell脚本实现开机自动启动1.连接上SSH终端，使用vim在/etc/init.d/文件夹里面创建一个名为start.sh的脚本文件vim /etc/init.d/start.sh2.编写名为start.sh脚本内容 #!/bin/bash

### BEGIN INIT INFO
# Provides:     start
# Required-Start:  $remote_fs $syslog
# Required-Stop:   $remote_fs $syslog
# Default-Start:   2 3 4 5
# Default-Stop:   0 1 6
# Short-Description: start test
# Description:    start test
### END INIT INFO

#此处编写脚本内容
cd /var/local/
nohup java -jar -Xms512M  -Xmx1024M jenkins.war --httpPort=8080 &gt; jenkins.log 2&gt;&amp;1 &amp;

exit 03.给文件增加权限chmod +755 /etc/init.d/start.sh4.设置开机自启动sudo update-rc.d /etc/init.d/start.sh defaults5.重启服务器reboot6.查看进程ps -ef |grep jenkns完成OK文章来源于：小威博客</description>
</item>
</rdf:RDF>