uTools-Manuals/docs/linux/service.html
2019-04-21 11:50:48 +08:00

37 lines
1.8 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1 id="service">service</h1>
<p>控制系统服务的实用工具</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>service命令</strong> 是Redhat Linux兼容的发行版中用来控制系统服务的实用工具它以启动、停止、重新启动和关闭系统服务还可以显示所有系统服务的当前状态。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">service(选项)(参数)</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash">-h显示帮助信息
--status-all显示所服务的状态。</code></pre>
<h3 id="参数">参数</h3>
<ul>
<li>服务名:自动要控制的服务名,即<code>/etc/init.d</code>目录下的脚本文件名;</li>
<li>控制命令:系统服务脚本支持的控制命令。</li>
</ul>
<h3 id="实例">实例</h3>
<p>当修改了主机名、ip地址等信息时经常需要把网络重启使之生效。</p>
<pre><code class="language-bash">service network status
配置设备:
lo eth0
当前的活跃设备:
lo eth0
service network restart
正在关闭接口 eth0 [ 确定 ]
关闭环回接口: [ 确定 ]
设置网络参数: [ 确定 ]
弹出环回接口: [ 确定 ]
弹出界面 eth0 [ 确定 ]</code></pre>
<p>重启mysql</p>
<pre><code class="language-bash">service mysqld status
mysqld (pid 1638) 正在运行...
service mysqld restart
停止 MySQL [ 确定 ]
启动 MySQL [ 确定 ]</code></pre>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->