Skip to content
Permalink
Browse files

[Linux-setup] 启用rc.local

  • Loading branch information...
zjuchenyuan committed Nov 20, 2019
1 parent dba8d63 commit 65cdab73521631c51865340ebc36e72bd0b638c3
Showing with 106 additions and 31 deletions.
  1. +30 −1 Linux-setup.md
  2. +1 −0 README.md
  3. +39 −0 docs/Linux-setup/index.html
  4. +1 −0 docs/README/index.html
  5. +8 −3 docs/search/search_index.json
  6. +27 −27 docs/sitemap.xml
@@ -906,4 +906,33 @@ vgchange -an /dev/ubuntu-vg
kpartx -d disk1.vmdk
kpartx -d disk2.vmdk
kpartx -d disk3.vmdk
```
```

-----

## 启用rc.local

```
nano /etc/systemd/system/rc-local.service
printf '%s\n' '#!/bin/bash' 'exit 0' | sudo tee -a /etc/rc.local
chmod +x /etc/rc.local
systemctl enable rc-local
```

```
[Unit]
Description=/etc/rc.local Compatibility
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
```

@@ -247,6 +247,7 @@ My notebook about technology, for lookup and share
>* 扩容上述单文件btrfs磁盘 /dev/loop0扩容
>* 安全地拔出移动硬盘
>* 挂载多个vmdk中的LVM分区
>* 启用rc.local
## [Linux-SSH](Linux-SSH.md)
>* 客户端不同服务器使用不同的id_rsa
@@ -1168,6 +1168,13 @@

</li>

<li class="md-nav__item">
<a href="#rclocal" title="启用rc.local" class="md-nav__link">
启用rc.local
</a>

</li>



</ul>
@@ -1712,6 +1719,13 @@

</li>

<li class="md-nav__item">
<a href="#rclocal" title="启用rc.local" class="md-nav__link">
启用rc.local
</a>

</li>



</ul>
@@ -2502,6 +2516,31 @@ <h2 id="vmdklvm">挂载多个vmdk中的LVM分区<a class="headerlink" href="#vmd
kpartx -d disk3.vmdk
</pre></div>
</td></tr></table>

<hr />
<h2 id="rclocal">启用rc.local<a class="headerlink" href="#rclocal" title="Permanent link">&para;</a></h2>
<div class="codehilite"><pre><span></span>nano /etc/systemd/system/rc-local.service
printf &#39;%s\n&#39; &#39;#!/bin/bash&#39; &#39;exit 0&#39; | sudo tee -a /etc/rc.local
chmod +x /etc/rc.local
systemctl enable rc-local
</pre></div>


<div class="codehilite"><pre><span></span><span class="k">[Unit]</span>
<span class="na">Description</span><span class="o">=</span><span class="s">/etc/rc.local Compatibility</span>
<span class="s"> ConditionPathExists=/etc/rc.local</span>

<span class="k">[Service]</span>
<span class="na">Type</span><span class="o">=</span><span class="s">forking</span>
<span class="s"> ExecStart=/etc/rc.local start</span>
<span class="s"> TimeoutSec=0</span>
<span class="s"> StandardOutput=tty</span>
<span class="s"> RemainAfterExit=yes</span>
<span class="s"> SysVStartPriority=99</span>

<span class="k">[Install]</span>
<span class="na">WantedBy</span><span class="o">=</span><span class="s">multi-user.target</span>
</pre></div>



@@ -1588,6 +1588,7 @@ <h2 id="linux-setup"><a href="../Linux-setup/">Linux-setup</a><a class="headerli
<li>扩容上述单文件btrfs磁盘 /dev/loop0扩容</li>
<li>安全地拔出移动硬盘</li>
<li>挂载多个vmdk中的LVM分区</li>
<li>启用rc.local</li>
</ul>
</blockquote>
<h2 id="linux-ssh"><a href="../Linux-SSH/">Linux-SSH</a><a class="headerlink" href="#linux-ssh" title="Permanent link">&para;</a></h2>

0 comments on commit 65cdab7

Please sign in to comment.
You can’t perform that action at this time.