<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://wiki.linuxsa.org/index.php?action=history&amp;feed=atom&amp;title=Debian_rc.local_%E5%BC%80%E6%9C%BA%E5%90%AF%E5%8A%A8%E9%97%AE%E9%A2%98</id>
	<title>Debian rc.local 开机启动问题 - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.linuxsa.org/index.php?action=history&amp;feed=atom&amp;title=Debian_rc.local_%E5%BC%80%E6%9C%BA%E5%90%AF%E5%8A%A8%E9%97%AE%E9%A2%98"/>
	<link rel="alternate" type="text/html" href="https://wiki.linuxsa.org/index.php?title=Debian_rc.local_%E5%BC%80%E6%9C%BA%E5%90%AF%E5%8A%A8%E9%97%AE%E9%A2%98&amp;action=history"/>
	<updated>2026-04-19T12:21:08Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://wiki.linuxsa.org/index.php?title=Debian_rc.local_%E5%BC%80%E6%9C%BA%E5%90%AF%E5%8A%A8%E9%97%AE%E9%A2%98&amp;diff=269&amp;oldid=prev</id>
		<title>2021年8月17日 (二) 12:32 Evan</title>
		<link rel="alternate" type="text/html" href="https://wiki.linuxsa.org/index.php?title=Debian_rc.local_%E5%BC%80%E6%9C%BA%E5%90%AF%E5%8A%A8%E9%97%AE%E9%A2%98&amp;diff=269&amp;oldid=prev"/>
		<updated>2021-08-17T12:32:42Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=debian10=&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;lt;&amp;lt;EOF &amp;gt;/etc/rc.local&lt;br /&gt;
#!/bin/sh -e&lt;br /&gt;
#&lt;br /&gt;
# rc.local&lt;br /&gt;
#&lt;br /&gt;
# This script is executed at the end of each multiuser runlevel.&lt;br /&gt;
# Make sure that the script will &amp;quot;exit 0&amp;quot; on success or any other&lt;br /&gt;
# value on error.&lt;br /&gt;
#&lt;br /&gt;
# In order to enable or disable this script just change the execution&lt;br /&gt;
# bits.&lt;br /&gt;
#&lt;br /&gt;
# By default this script does nothing.&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
EOF&lt;br /&gt;
chmod +x /etc/rc.local&lt;br /&gt;
systemctl daemon-reload&lt;br /&gt;
systemctl start rc-local&lt;br /&gt;
systemctl status rc-local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
https://stackoverflow.com/questions/44797694/where-is-rc-local-in-debian-9-debian-stretch#44801337&lt;br /&gt;
=Question=&lt;br /&gt;
 leanote 没有做成规范的启动脚本 所以 得加到开机自启动 于是想到 rc.local&lt;br /&gt;
&lt;br /&gt;
=Solution=&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#一定得加这个启动文件 不然是不行的&lt;br /&gt;
cat &amp;gt; /etc/systemd/system/rc-local.service &amp;lt;&amp;lt;EOF&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=/etc/rc.local&lt;br /&gt;
ConditionPathExists=/etc/rc.local&lt;br /&gt;
 &lt;br /&gt;
[Service]&lt;br /&gt;
Type=forking&lt;br /&gt;
ExecStart=/etc/rc.local start&lt;br /&gt;
TimeoutSec=0&lt;br /&gt;
StandardOutput=tty&lt;br /&gt;
RemainAfterExit=yes&lt;br /&gt;
SysVStartPriority=99&lt;br /&gt;
 &lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
cat &amp;lt;&amp;lt;EOF &amp;gt;/etc/rc.local&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
# rc.local&lt;br /&gt;
#&lt;br /&gt;
# This script is executed at the end of each multiuser runlevel.&lt;br /&gt;
# Make sure that the script will &amp;quot;exit 0&amp;quot; on success or any other&lt;br /&gt;
# value on error.&lt;br /&gt;
#&lt;br /&gt;
# In order to enable or disable this script just change the execution&lt;br /&gt;
# bits.&lt;br /&gt;
#&lt;br /&gt;
# By default this script does nothing.&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
chmod +x /etc/rc.local&lt;br /&gt;
systemctl  enable  rc-local&lt;br /&gt;
&lt;br /&gt;
systemctl start  rc-local&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=trouble shooting=&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#cat /etc/rc.local &lt;br /&gt;
&lt;br /&gt;
#这个会导致ssh起不来 可能是因为 有交互内容吧 &lt;br /&gt;
/data/apps/leanote/bin/run.sh&lt;br /&gt;
&lt;br /&gt;
#这个就可以正常启动了哦&lt;br /&gt;
/usr/bin/nohup  /data/apps/leanote/bin/run.sh  &amp;amp;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:debian]]&lt;/div&gt;</summary>
		<author><name>Evan</name></author>
	</entry>
</feed>