<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>我本善良 &#187; rc.local</title>
	<atom:link href="https://wbsl.org/tag/rc-local/feed" rel="self" type="application/rss+xml" />
	<link>https://wbsl.org</link>
	<description>一个不太正常的正常人</description>
	<lastBuildDate>Fri, 05 Jul 2024 01:35:05 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2</generator>
	<item>
		<title>解决/etc/rc.local启动不执行</title>
		<link>https://wbsl.org/linux/296.html</link>
		<comments>https://wbsl.org/linux/296.html#comments</comments>
		<pubDate>Thu, 18 Jun 2020 10:12:39 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[rc.local]]></category>
		<category><![CDATA[启动不执行]]></category>

		<guid isPermaLink="false">https://wbsl.org/?p=296</guid>
		<description><![CDATA[执行以下命令: systemctl list-dependencies multi-user.target &#124;<a href="https://wbsl.org/linux/296.html" class="read-more">Continue Reading</a>]]></description>
				<content:encoded><![CDATA[<p>执行以下命令:</p>
<p><code>systemctl list-dependencies multi-user.target | grep rc-local</code></p>
<p>如果没有输出执行下方命令:</p>
<p><code>chmod +x /etc/rc.d/rc.local<br />
systemctl daemon-reload</code></p>
<p>再次执行命令:</p>
<p><code>systemctl list-dependencies multi-user.target | grep rc-local</code></p>
<p>输出结果:</p>
<p><code>● ├─rc-local.service</code></p>
]]></content:encoded>
			<wfw:commentRss>https://wbsl.org/linux/296.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debian 9/Ubuntu 17添加rc.local开机自启动的方法</title>
		<link>https://wbsl.org/linux/192.html</link>
		<comments>https://wbsl.org/linux/192.html#comments</comments>
		<pubDate>Thu, 11 Jul 2019 06:37:22 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[Debian9]]></category>
		<category><![CDATA[rc.local]]></category>
		<category><![CDATA[Ubuntu17]]></category>
		<category><![CDATA[开机自启动]]></category>

		<guid isPermaLink="false">https://wbsl.org/?p=192</guid>
		<description><![CDATA[方法 1、添加rc-local.service #以下为一整条命令，一起复制运行： [crayon-69dad<a href="https://wbsl.org/linux/192.html" class="read-more">Continue Reading</a>]]></description>
				<content:encoded><![CDATA[<p>方法<br />
1、添加rc-local.service</p>
<p>#以下为一整条命令，一起复制运行：</p>
<p></p><pre class="crayon-plain-tag">cat &gt; /etc/systemd/system/rc-local.service &lt;&lt;EOF
[Unit]
Description=/etc/rc.local
ConditionPathExists=/etc/rc.local
 
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99
 
[Install]
WantedBy=multi-user.target
EOF</pre><p> </p>
<p>2、新建rc-local文件</p>
<p>#以下为一整条命令，一起复制运行：</p>
<p></p><pre class="crayon-plain-tag">cat &gt; /etc/rc.local &lt;&lt;EOF
#!/bin/sh
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
 
exit 0
EOF</pre><p> </p>
<p>3、添加权限并设置开机自启</p>
<p>chmod +x /etc/rc.local<br />
systemctl enable rc-local<br />
systemctl start rc-local.service</p>
<p>检查状态：</p>
<p>systemctl status rc-local.service<br />
返回Active:active信息，则成功。</p>
<p>最后我们就可以在/etc/rc.loacl里，添加开机的自启命令什么的了。记住添加在exit 0之前。</p>
]]></content:encoded>
			<wfw:commentRss>https://wbsl.org/linux/192.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
