<?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>System Process (系统进程) &#8211; Eternal Center</title>
	<atom:link href="https://eternalcenter-sep-2022.github.io/category/system/system-process-system-performance/system-process/feed/" rel="self" type="application/rss+xml" />
	<link>https://eternalcenter-sep-2022.github.io/</link>
	<description></description>
	<lastBuildDate>Wed, 27 Jul 2022 05:55:27 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>[命令] Linux 命令 lsof （显示进程）</title>
		<link>https://eternalcenter-sep-2022.github.io/lsof/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Thu, 23 Jun 2022 10:06:50 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Directory (系统目录)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System Login Security (系统登录安全)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Performance (系统性能)]]></category>
		<category><![CDATA[System Process (系统进程)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<category><![CDATA[System Process Security (系统进程安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Storage (系统存储)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<category><![CDATA[System User (系统用户)]]></category>
		<category><![CDATA[System User & System Privilege (系统用户 & 系统权限)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=26135</guid>

					<description><![CDATA[内容一：lsof 命令输出结果 内容二：lsof 命令输出结果简介 1) COMMAND 进程名2) PID （Process Id） PID 号3) USER 用户4) FD 文件描述信息（补充：cwd 代表当前目录，txt 代表 txt 文件，rtd 代表 root 目录，mem 代表内存映射文件）5) TYPE 文件类型（补充：DIR 代表当前目录，REG 代表普通文件，CHR 代表字符，a_inode 代表 Inode 文件，FIFO 代表管道或者 socket文件，netlink 代表网络，unkonwn 代表未知）6) DEVICE 设备 ID7) SIZE/OFF 进程大小8) NODE 文件的 Inode 号9) NAME 路径或链接 内容三：lsof 使用案例 3.1 案例一：显示已经被删除的文件 3.2 案例二：显示用户已打开的案例 3.2.1 显示某用户已打开的文件 &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/lsof/" class="more-link">Continue reading<span class="screen-reader-text"> "[命令] Linux 命令 lsof （显示进程）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h3>内容一：lsof 命令输出结果</h3>



<pre class="wp-block-code"><code># lsof | more
COMMAND     PID   TID    USER   FD      TYPE             DEVICE  SIZE/OFF       NODE NAME
systemd       1          root  cwd       DIR              251,1      4096          1 /
......</code></pre>



<h3>内容二：lsof 命令输出结果简介</h3>



<p>1) COMMAND 进程名<br>2) PID （Process Id） PID 号<br>3) USER 用户<br>4) FD 文件描述信息<br>（补充：cwd 代表当前目录，txt 代表 txt 文件，rtd 代表 root 目录，mem 代表内存映射文件）<br>5) TYPE 文件类型<br>（补充：DIR 代表当前目录，REG 代表普通文件，CHR 代表字符，a_inode 代表 Inode 文件，FIFO 代表管道或者 socket文件，netlink 代表网络，unkonwn 代表未知）<br>6) DEVICE 设备 ID<br>7) SIZE/OFF 进程大小<br>8) NODE 文件的 Inode 号<br>9) NAME 路径或链接</p>



<h3>内容三：lsof 使用案例</h3>



<h4>3.1 案例一：显示已经被删除的文件</h4>



<pre class="wp-block-code"><code># lsof | grep deleted</code></pre>



<h4>3.2 案例二：显示用户已打开的案例</h4>



<h5>3.2.1 显示某用户已打开的文件</h5>



<pre class="wp-block-code"><code># lsof -u zhumingyu mingyuzhu</code></pre>



<p>（补充：这里以显示用户 zhumingyu 和 mingyuzhu 已打开的文件为例）</p>



<h5>3.2.2 不显示某用户已打开的文件</h5>



<pre class="wp-block-code"><code># lsof -u mingyuzhu</code></pre>



<p>（补充：这里以不显示用户 mingyuzhu 已打开的文件为例）</p>



<h4>3.3 案例三：显示进程已打开的文件</h4>



<h5>3.3.1 显示某进程已打开的文件</h5>



<pre class="wp-block-code"><code># lsof -p 1024</code></pre>



<p>（补充：这里以显示 PID 号是 1024 已打开的文件为例）</p>



<h5>3.3.2 不显示某进程已打开的所有文件</h5>



<pre class="wp-block-code"><code># lsof -p ^1024</code></pre>



<p>（补充：这里以不显示 PID 号是 1024 已打开的文件为例）</p>



<h5>3.3.3 显示某几个进程已打开的文件</h5>



<pre class="wp-block-code"><code># lsof -p 1,2,3</code></pre>



<p>（补充：这里以显示 PID 号是 1、2 和 3 已打开的文件为例）</p>



<h4>3.4 案例四：显示已打开的网络文件</h4>



<h5>3.4.1 显示所有已打开的网络文件</h5>



<pre class="wp-block-code"><code># lsof -i</code></pre>



<h5>3.4.2 显示所有 IPv4 协议已打开的文件</h5>



<pre class="wp-block-code"><code># lsof -i 4</code></pre>



<h5>3.4.3 显示所有 IPv6 协议已打开的文件</h5>



<pre class="wp-block-code"><code># lsof -i 6</code></pre>



<h5>3.4.4 显示所有 TCP 协议已打开的文件</h5>



<pre class="wp-block-code"><code># lsof -i TCP</code></pre>



<h5>3.4.5 显示所有 TCP 协议已打开的文件</h5>



<pre class="wp-block-code"><code># lsof -i UDP</code></pre>



<h5>3.4.6 显示某个 TCP 端口或者 UDP 端口已打开的文件</h5>



<pre class="wp-block-code"><code># lsof -i:22</code></pre>



<p>（补充：这里以显示 TCP 或者 UPD 的 22 端口已打开的文件为例）</p>



<h5>3.4.7 显示某个 TCP 端口已打开的文件</h5>



<pre class="wp-block-code"><code># lsof -i TCP:22</code></pre>



<p>（补充：这里以显示 TCP 的 22 端口已打开的文件为例）</p>



<h5>3.4.8 显示某几个 TCP 端口打开的文件</h5>



<pre class="wp-block-code"><code># lsof -i TCP:1-1024</code></pre>



<p>（补充：这里以显示 TCP 的 1 端口到 1024 端口打开的文件为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[排错] 解决 Linux 执行 crontab -e 命令时报错 “You (&#8230;&#8230;) are not allowed to use this program (crontab)”</title>
		<link>https://eternalcenter-sep-2022.github.io/debug-you-are-not-allowed-to-use-this-program-crontab/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 10 Jun 2022 10:07:51 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System File Security (系统文件安全)]]></category>
		<category><![CDATA[System Login Security (系统登录安全)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Performance (系统性能)]]></category>
		<category><![CDATA[System Port Security (系统端口安全)]]></category>
		<category><![CDATA[System Privilege (系统权限)]]></category>
		<category><![CDATA[System Process (系统进程)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<category><![CDATA[System Process Security (系统进程安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Setting (系统设置)]]></category>
		<category><![CDATA[System User (系统用户)]]></category>
		<category><![CDATA[System User & System Privilege (系统用户 & 系统权限)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=23780</guid>

					<description><![CDATA[解决方法 如果在系统中没有 /etc/cron.deny 配置文件，在 /etc/cron.allow 配置文件中添加要使用 crontab -e 命令的用户 添加以下内容： （补充：这里以添加用户 zhumingyu 为例） 如果在系统中没有 /etc/cron.allow 配置文件，在 /etc/cron.allow 配置文件中删除要使用 crontab -e 命令的用户 删除以下内容： （补充：这里以删除用户 zhumingyu 为例）]]></description>
										<content:encoded><![CDATA[
<h2>解决方法</h2>



<p>如果在系统中没有 /etc/cron.deny 配置文件，在 /etc/cron.allow 配置文件中添加要使用 crontab -e 命令的用户</p>



<pre class="wp-block-code"><code># vim /etc/cron.allow</code></pre>



<p>添加以下内容：</p>



<pre class="wp-block-code"><code>......
zhumingyu</code></pre>



<p>（补充：这里以添加用户 zhumingyu 为例）</p>



<p>如果在系统中没有 /etc/cron.allow 配置文件，在 /etc/cron.allow 配置文件中删除要使用 crontab -e 命令的用户</p>



<pre class="wp-block-code"><code># vim /etc/cron.allow</code></pre>



<p>删除以下内容：</p>



<pre class="wp-block-code"><code>......
zhumingyu
......</code></pre>



<p>（补充：这里以删除用户 zhumingyu 为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux 命令 time （显示其它命令所需执行时间）</title>
		<link>https://eternalcenter-sep-2022.github.io/time/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 27 May 2022 06:44:55 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Process (系统进程)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=23640</guid>

					<description><![CDATA[（补充：这里以显示 sosreport 命令所需执行时间为例）]]></description>
										<content:encoded><![CDATA[
<pre class="wp-block-code"><code># time sosreport</code></pre>



<p>（补充：这里以显示 sosreport 命令所需执行时间为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[排错] 解决 Linux 运行时报错 “watchdog: Bug: soft lockup &#8211; CPU&#8230;&#8230;” （CPU 软锁）</title>
		<link>https://eternalcenter-sep-2022.github.io/debug-watchdog-bug-soft-lockup-cpu/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 15 Feb 2022 07:35:47 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Computer & System Hardware & System Installation & System Upgradation (系统电脑 & 系统硬件 & 系统安装 & 系统升级)]]></category>
		<category><![CDATA[System Hardware (系统硬件)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Process (系统进程)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<category><![CDATA[System Setting (系统设置)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=21928</guid>

					<description><![CDATA[报错代码 分析 当 CPU 的负载过高时，一个 CPU 在运行某一个进程时，在内核模式下超过 20 秒没有回应，则看门狗程序会将系统所有 CPU 软锁住，然后会让这些 CPU 显示各自正在运行的进程堆栈跟踪 缓解方法 方法一：通过 /proc/sys/kernel/watchdog_thresh 文件延长看门狗软锁 CPU 的时间 （补充：这里以将看门狗的值延长到 20 为例，也可以根据自己的需求延长更多，默认值为 10） 方法二：通过新建文件延长看门狗软所 CPU 的时间 2.1 通过新建文件延长看门狗软所 CPU 的时间 （补充：这里以将看门狗的值延长到 20 为例，也可以根据自己的需求延长更多，默认值为 10） 2.2 让新建文件立刻生效 深究方法 开启 Kdump，等此报错再次发生时分析 Kdump 在内核崩溃时搜集信息 vmcore]]></description>
										<content:encoded><![CDATA[
<h2 id="报错代码">报错代码</h2>



<pre class="wp-block-code"><code>watchdog: Bug: soft lockup - CPU......</code></pre>



<h2 id="分析">分析</h2>



<p>当 CPU 的负载过高时，一个 CPU 在运行某一个进程时，在内核模式下超过 20 秒没有回应，则看门狗程序会将系统所有 CPU 软锁住，然后会让这些 CPU 显示各自正在运行的进程堆栈跟踪</p>



<h2 id="缓解方法">缓解方法</h2>



<h3 id="缓解方法">方法一：通过 /proc/sys/kernel/watchdog_thresh 文件延长看门狗软锁 CPU 的时间</h3>



<pre class="wp-block-code"><code># echo 20 &gt; /proc/sys/kernel/watchdog_thresh</code></pre>



<p>（补充：这里以将看门狗的值延长到 20 为例，也可以根据自己的需求延长更多，默认值为 10）</p>



<h3 id="方法二-通过新建文件提高看门狗软所-cpu-的时间2-1-通过新建文件提高看门狗软所-cpu-的时间">方法二：通过新建文件延长看门狗软所 CPU 的时间</h3>



<h4 id="方法二-通过新建文件提高看门狗软所-cpu-的时间2-1-通过新建文件提高看门狗软所-cpu-的时间">2.1 通过新建文件延长看门狗软所 CPU 的时间</h4>



<pre class="wp-block-code"><code># echo "kernel.watchdog_thresh = 20" >> /etc/sysctl.conf</code></pre>



<p>（补充：这里以将看门狗的值延长到 20 为例，也可以根据自己的需求延长更多，默认值为 10）</p>



<h4 id="2-2-让新建文件立刻生效">2.2 让新建文件立刻生效</h4>



<pre class="wp-block-code"><code># sysctl -p /etc/sysctl.conf</code></pre>



<h2 id="深究方法">深究方法</h2>



<p>开启 Kdump，等此报错再次发生时分析 Kdump 在内核崩溃时搜集信息 vmcore</p>



<div class="wp-container-1 is-content-justification-center wp-block-buttons">
<div class="wp-block-button aligncenter is-style-outline"><a class="wp-block-button__link no-border-radius" href="https://eternalcenter-sep-2022.github.io/kdump/">Linux Kdump 的开启 <br>（用于收集内核崩溃时的信息）</a></div>



<div class="wp-block-button is-style-outline"><a class="wp-block-button__link" href="https://eternalcenter-sep-2022.github.io/kdump-analysis/" style="border-radius:0px">Linux Kdump 内核奔溃信息的分析</a></div>
</div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[工具] Shell 批量比较服务器所有正在运行进程的变化</title>
		<link>https://eternalcenter-sep-2022.github.io/shell-process-compare/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Thu, 20 Jan 2022 13:38:56 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Language (语言)]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Shell Monitor (监控)]]></category>
		<category><![CDATA[Shell Tools (工具)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Process (系统进程)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=21341</guid>

					<description><![CDATA[介绍 基本信息 作者：朱明宇名称：批量比较服务器所有正在运行进程的变化作用：批量比较服务器所有正在运行进程的变化 使用方法 1. 服务器清单 $server_list 每台服务器占用 1 行2. 在此脚本的分割线内写入相应的内容，并和此脚本放在同一目录下3. 给此脚本添加执行权限4. 执行此脚本5. 此脚本执行完成后，会将运行结果写入当前目录下的 $compare_file 里 脚本分割线里的变量 server_list=server_list.txt #服务器清单first_time=first_time #存储第一次检结果的目录second_time=second_time #存储第二次检查结果的目录compare_file=comparison_results.txt #存储比较结果的文件 注意 此脚本执行前必须要先保证执行本脚本的用户能无密码 ssh 远程这些远程服务器 脚本]]></description>
										<content:encoded><![CDATA[
<h2 id="介绍">介绍</h2>



<h3>基本信息</h3>



<p>作者：朱明宇<br>名称：批量比较服务器所有正在运行进程的变化<br>作用：批量比较服务器所有正在运行进程的变化</p>



<h3>使用方法</h3>



<p>1. 服务器清单 $server_list 每台服务器占用 1 行<br>2. 在此脚本的分割线内写入相应的内容，并和此脚本放在同一目录下<br>3. 给此脚本添加执行权限<br>4. 执行此脚本<br>5. 此脚本执行完成后，会将运行结果写入当前目录下的 $compare_file 里</p>



<h3>脚本分割线里的变量</h3>



<p>server_list=server_list.txt #服务器清单<br>first_time=first_time #存储第一次检结果的目录<br>second_time=second_time #存储第二次检查结果的目录<br>compare_file=comparison_results.txt #存储比较结果的文件</p>



<h3>注意</h3>



<p>此脚本执行前必须要先保证执行本脚本的用户能无密码 ssh 远程这些远程服务器</p>



<h2 id="脚本">脚本</h2>



<pre class="wp-block-code"><code>#!/bin/bash

####################### Separator ########################

server_list=server_list.txt
first_time=first_time
second_time=second_time
compare_file=comparison_results.txt

####################### Separator ########################

mkdir $first_time &amp;&gt; /dev/null
mkdir $second_time &amp;&gt; /dev/null
echo &gt; $compare_file

read -p "Please input first second or compare now: " choice

check(){
        for server_name in `cat $1`
        do
                ssh -t $server_name "ps -A" | awk '{print $4}' &gt; $2/$server_name
        done
}

compare(){
        for server_name in `cat $1`
        do
                echo $server_name &gt;&gt; $4
                for process in `cat $2/$server_name`
                        do
                        grep $process $3/$server_name &amp;&gt; /dev/null
                        if &#91; $? -ne 0 ];then
                                echo $process &gt;&gt; $4
                        fi
                done
                echo &gt;&gt; $4
        done
}

if &#91; $choice == first ];then
        check $server_list $first_time
fi

if &#91; $choice == second ];then
        check $server_list $second_time
fi

if &#91; $choice == compare ];then
        compare $server_list $first_time $second_time $compare_file
fi</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux 进程修正值 （nice 值） 的设置</title>
		<link>https://eternalcenter-sep-2022.github.io/nice/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Thu, 04 Nov 2021 15:38:02 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Performance (系统性能)]]></category>
		<category><![CDATA[System Process (系统进程)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=18158</guid>

					<description><![CDATA[内容一：进程优先级和修正值（nice 值）的关系 1.1 进程优先级的作用 进程的真正优先级越小，则此进程则越能优先被执行 1.2 进程优先级和修正值（nice 值）的关系 进程的真正优先级 = 进程默认优先级 + 修正值（nice 值） 1.3 修正值（nice 值）的范围 从 -20 到 +19 内容二：修正值（nice 值）的设置 2.1 设置修正值（nice 值）的格式 或者： 或者： 2.2 设置修正值（nice 值）的案例 或者： 或者： （注意：这里的 -10 不是指负数 10 而是指正数 10） （补充：这里以修正值为 10 启动 top 命令为例） 内容三：显示进程的修正值 或者： （补充：1) PRI 代表进程默认的优先级2) NI 代表进程的修正值（nice 值）3) 进程的真正优先级 = PRI &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/nice/" class="more-link">Continue reading<span class="screen-reader-text"> "[内容] Linux 进程修正值 （nice 值） 的设置"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h3 id="内容一-进程优先级和修正值-nice-值-的关系-1-1-进程优先级的作用">内容一：进程优先级和修正值（nice 值）的关系</h3>



<h4 id="内容一-进程优先级和修正值-nice-值-的关系-1-1-进程优先级的作用">1.1 进程优先级的作用</h4>



<p>进程的真正优先级越小，则此进程则越能优先被执行</p>



<h4 id="1-2-进程优先级和修正值-nice-值-的关系">1.2 进程优先级和修正值（nice 值）的关系</h4>



<p>进程的真正优先级 = 进程默认优先级 + 修正值（nice 值）</p>



<h4 id="1-3-修正值-nice-值-的范围">1.3 修正值（nice 值）的范围</h4>



<p>从 -20 到 +19</p>



<h3 id="内容二-修正值-nice-值-的设置-2-1-设置修正值-nice-值-的格式">内容二：修正值（nice 值）的设置</h3>



<h4 id="内容二-修正值-nice-值-的设置-2-1-设置修正值-nice-值-的格式">2.1 设置修正值（nice 值）的格式</h4>



<pre class="wp-block-code"><code># nice -n &lt;correction value&gt; &lt;command&gt;</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># nice --adjustment=&lt;correction value&gt; &lt;command&gt;</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># nice -&lt;correction value&gt; &lt;command&gt;</code></pre>



<h4 id="2-2-设置修正值-nice-值-的案例">2.2 设置修正值（nice 值）的案例</h4>



<pre class="wp-block-code"><code># nice -n 10 top</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># nice --adjustment=10 top</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># nice -10 top</code></pre>



<p>（注意：这里的 -10 不是指负数 10 而是指正数 10）</p>



<p>（补充：这里以修正值为 10 启动 top 命令为例）</p>



<h3 id="内容三-显示进程的修正值-1">内容三：显示进程的修正值</h3>



<pre class="wp-block-code"><code># top</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># ps -ef</code></pre>



<p>（<br>补充：<br>1) PRI 代表进程默认的优先级<br>2) NI 代表进程的修正值（nice 值）<br>3) 进程的真正优先级 = PRI + NI<br>4) 如果多个进程的真正优先级一样，则 root 用户的进程被优先执行<br>）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] Linux 脚本的管理 （通过 systemd 实现）</title>
		<link>https://eternalcenter-sep-2022.github.io/systemctl-script/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Wed, 04 Nov 2020 10:17:39 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Process (系统进程)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<category><![CDATA[System Software (系统软件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=11652</guid>

					<description><![CDATA[步骤一：要被管理的脚本 创建以下内容： （补充：这里以创建 /etc/root/for.sh 脚本为例） 步骤二：创建 systemctl 的管理文件 创建以下内容： （补充：这里以创建 /etc/systemd/system/12456.service 来管理 ExecStart=/root/12456.sh 为例） 步骤三：加载刚刚创建的 systemctl 管理文件 步骤四：给 systemctl 的管理文件添加执行权限 步骤五：通过 systemd 管理脚本 5.1 启动脚本 5.2 关闭脚本 5.3 重启脚本 5.4 让脚本开机自启]]></description>
										<content:encoded><![CDATA[
<h3>步骤一：要被管理的脚本</h3>



<pre class="wp-block-code"><code># vim /root/12456.sh</code></pre>



<p>创建以下内容：</p>



<pre class="wp-block-code"><code>#!/bin/bash
for i in {1..5}
do
echo $i
done</code></pre>



<p>（补充：这里以创建 /etc/root/for.sh 脚本为例）</p>



<h3>步骤二：创建 systemctl 的管理文件</h3>



<pre class="wp-block-code"><code># vim /etc/systemd/system/12456.service</code></pre>



<p>创建以下内容：</p>



<pre class="wp-block-code"><code>&#91;Unit]
Description=12345
After=default.target

&#91;Service]
Type=oneshot
ExecStart=/root/12456.sh

&#91;Install]
WantedBy=default.target</code></pre>



<p>（补充：这里以创建 /etc/systemd/system/12456.service 来管理 ExecStart=/root/12456.sh 为例）</p>



<h3>步骤三：加载刚刚创建的 systemctl 管理文件</h3>



<pre class="wp-block-code"><code># systemctl daemon-reload</code></pre>



<h3>步骤四：给 systemctl 的管理文件添加执行权限</h3>



<pre class="wp-block-code"><code># chmod u+x /etc/systemd/system/12456.service</code></pre>



<h3>步骤五：通过 systemd 管理脚本</h3>



<h4>5.1 启动脚本</h4>



<pre class="wp-block-code"><code># systemctl start 12456.service</code></pre>



<h4>5.2 关闭脚本</h4>



<pre class="wp-block-code"><code># systemctl stop 12456.service</code></pre>



<h4>5.3 重启脚本</h4>



<pre class="wp-block-code"><code># systemctl restart 12456.service</code></pre>



<h4>5.4 让脚本开机自启</h4>



<pre class="wp-block-code"><code># systemctl enable 12456.service</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux 命令 service （管理程序单元）</title>
		<link>https://eternalcenter-sep-2022.github.io/service-command/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 21 Jul 2020 09:14:32 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Process (系统进程)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<category><![CDATA[System Software (系统软件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=10158</guid>

					<description><![CDATA[内容一：列出所有受 systemctl 管理的单元 内容二：启动某一个单元 内容三：停止某一个单元]]></description>
										<content:encoded><![CDATA[
<h3>内容一：列出所有受 systemctl 管理的单元</h3>



<pre class="wp-block-code"><code># service -–status-all</code></pre>



<h3>内容二：启动某一个单元</h3>



<pre class="wp-block-code"><code># service &lt;unit&gt; start</code></pre>



<h3>内容三：停止某一个单元</h3>



<pre class="wp-block-code"><code># service &lt;unit&gt; stop</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux 进程状态介绍</title>
		<link>https://eternalcenter-sep-2022.github.io/process-status/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 17 Jul 2020 02:53:57 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Process (系统进程)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=10079</guid>

					<description><![CDATA[内容一：Linux 的第一进程状态 （1）R 处于运行状态或者等待运行状态（2）S 处于休眠状态（3）T 处于停止状态或者处于被追踪的状态（4）Z 处于僵尸进程的状态（5）W 处于进入内存交换的状态（6）X 处于被杀死进程的状态（7）D 处于不可中断的休眠状态 （注意：D 状态通常由存储进程中断导致，无法被 kill 命令杀死，但可以通过重启系统清除） 内容二：Linux 的第二进程状态 （1）&#60; 代表此进程具有高优先级（2）N 代表此进程具有低优先级（3）L 代表此进程有些部分被所进了内存（4）s 代表此进程包含子进程（5）+ 代表此进程处于后台的状态（6）l 代表此进程是被克隆出来的多线程 内容三：Linux 显示进程状态的命令]]></description>
										<content:encoded><![CDATA[
<h4 id="内容一-linux-的第一进程状态">内容一：Linux 的第一进程状态</h4>



<p>（1）R 处于运行状态或者等待运行状态<br>（2）S 处于休眠状态<br>（3）T 处于停止状态或者处于被追踪的状态<br>（4）Z 处于僵尸进程的状态<br>（5）W 处于进入内存交换的状态<br>（6）X 处于被杀死进程的状态<br>（7）D 处于不可中断的休眠状态</p>



<p>（注意：D 状态通常由存储进程中断导致，无法被 kill 命令杀死，但可以通过重启系统清除）</p>



<h4 id="内容二-linux-的第二进程状态">内容二：Linux 的第二进程状态</h4>



<p>（1）&lt; 代表此进程具有高优先级<br>（2）N 代表此进程具有低优先级<br>（3）L 代表此进程有些部分被所进了内存<br>（4）s 代表此进程包含子进程<br>（5）+ 代表此进程处于后台的状态<br>（6）l 代表此进程是被克隆出来的多线程</p>



<h4 id="内容三-linux-显示进程状态的命令">内容三：Linux 显示进程状态的命令</h4>



<pre class="wp-block-code"><code># ps -aux</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] CentOS Linux &#038; RHEL 网页图形化管理工具 cockpit</title>
		<link>https://eternalcenter-sep-2022.github.io/cockpit/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sat, 06 Jun 2020 09:07:39 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Firewall (系统防火墙)]]></category>
		<category><![CDATA[System General Log (系统普通日志)]]></category>
		<category><![CDATA[System Log (系统日志)]]></category>
		<category><![CDATA[System Login Security (系统登录安全)]]></category>
		<category><![CDATA[System Network (系统网络)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Performance (系统性能)]]></category>
		<category><![CDATA[System Port Security (系统端口安全)]]></category>
		<category><![CDATA[System Process (系统进程)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<category><![CDATA[System Process Security (系统进程安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Security Log (系统安全日志)]]></category>
		<category><![CDATA[System Setting (系统设置)]]></category>
		<category><![CDATA[System Software (系统软件)]]></category>
		<category><![CDATA[System Statistic Log (系统统计日志)]]></category>
		<category><![CDATA[System User (系统用户)]]></category>
		<category><![CDATA[System User & System Privilege (系统用户 & 系统权限)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=9718</guid>

					<description><![CDATA[步骤一：系统环境要求 服务器系统配置好可用的软件源 步骤二：安装 cockpit （补充：cockpit 是管理单台主机的程序，cockpit-dashaboard 是管理多台主机的程序） 步骤三：启动 cockpit 步骤四：登录 cockpit 使用浏览器登录：https://&/#60;server IP address&#62;:9090]]></description>
										<content:encoded><![CDATA[
<h3>步骤一：系统环境要求</h3>



<p>服务器系统配置好可用的软件源</p>



<h3>步骤二：安装 cockpit</h3>



<pre class="wp-block-code"><code># yum -y install cockpit cockpit-dashaboard</code></pre>



<p>（补充：cockpit 是管理单台主机的程序，cockpit-dashaboard 是管理多台主机的程序）</p>



<h3>步骤三：启动 cockpit</h3>



<pre class="wp-block-code"><code># systemctl enable --now cockpit.socket</code></pre>



<h3>步骤四：登录 cockpit</h3>



<p>使用浏览器登录：https://&lt;server/ IP address&gt;:9090</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux 命令 ps （显示进程） （转载）</title>
		<link>https://eternalcenter-sep-2022.github.io/ps/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 05 Jun 2020 07:46:58 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Process (系统进程)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<category><![CDATA[System Process Security (系统进程安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=9679</guid>

					<description><![CDATA[注明：所有转载内容皆直接从被转载文章网页的标题和内容的文本和图片中复制而来]]></description>
										<content:encoded><![CDATA[
<pre class="wp-block-code"><code>ps 命令的使用

Ps命令是Linux中最常使用的进程查看工具，主要用于显示包含当前运行的各进程完整信息的静态快照（查看静态的进程统计信息）。通过不同的命令选项可以有选择性的查看进程信息。

a：显示当前终端下的所有进行信息，包括其他用户的进程。与x选项结合时将显示系统中所有的进程信息。

u：使用以用户为主的格式输出进程信息。

x：显示当前用户在所有终端下的进程信息。

-e：显示系统内的所有进程信息。

-l：使用长格式显示进程信息。

-f：使用完整的格式显示进程信息。</code></pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img width="622" height="170" src="https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/ps-1.png" alt="" class="wp-image-19781" srcset="https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/ps-1.png 622w, https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/ps-1-300x82.png 300w" sizes="(max-width: 622px) 100vw, 622px" /></figure></div>


<pre class="wp-block-code"><code># ps aux

解释:

USER：启动该进程的用户账号名称

PID：该进程在系统中的数字ID号，在当前系统中是唯一的。

TTY：表明该进程在哪个终端上运行。“？”表示未知或者不需要终端。

STAT：显示了进程当前的状态，如S（休眠）、R（运行）、Z（僵死）、&lt;（高优先级）、N（低优先级）、s（父进程）、+（前台进程）。对于僵死的进程，应该手动处理掉。（问：为什么？）

START：启动该进程的时间

TIME：该进程占用CPU的时间

COMMAND：启用该进程的命令名称

%CPU：CPU占用百分比

%MEM：内存占用百分比

VSZ：占用虚拟内存（swap空间）大小

RSS：占用常驻空间（物理内存）的大小</code></pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" width="706" height="150" src="https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/ps-2.png" alt="" class="wp-image-19782" srcset="https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/ps-2.png 706w, https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/ps-2-300x64.png 300w" sizes="(max-width: 706px) 100vw, 706px" /></figure></div>


<pre class="wp-block-code"><code>————————————————
版权声明：本文为CSDN博主「秃头阿鑫」的原创文章，遵循CC 4.0 BY-SA版权协议，转载请附上原文出处链接及本声明。
原文链接：https://blog.csdn.net/weixin_47763101/java/article/details/106391154</code></pre>



<p>注明：所有转载内容皆直接从被转载文章网页的标题和内容的文本和图片中复制而来</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" width="1010" height="161" src="https://eternalcenter-sep-2022.github.io/wp-content/uploads/2020/06/版权申明证明-ps.png" alt="" class="wp-image-9682" srcset="https://eternalcenter-sep-2022.github.io/wp-content/uploads/2020/06/版权申明证明-ps.png 1010w, https://eternalcenter-sep-2022.github.io/wp-content/uploads/2020/06/版权申明证明-ps-300x48.png 300w, https://eternalcenter-sep-2022.github.io/wp-content/uploads/2020/06/版权申明证明-ps-768x122.png 768w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption>CC 4.0 BY-SA 版权协议网址：https://creativecommons.org/licenses/by-sa/4.0/deed.z</figcaption></figure></div>


<pre class="wp-block-code"><code>站主补充：
补充一：D 状态的进程
D 状态的进程代表处于不可以被杀死的休眠状态。D 状态的进程就算是用 kill -9 命令也无法杀死

补充二：将 ps 的输出工整
# ps -T

补充三：ps 显示 SELinux 标签
# ps -M
或者：
# ps -Z
</code></pre>



<p></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux 命令 kill （进程杀死）</title>
		<link>https://eternalcenter-sep-2022.github.io/kill/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sat, 30 May 2020 05:19:38 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Performance (系统性能)]]></category>
		<category><![CDATA[System Process (系统进程)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<category><![CDATA[System Process Security (系统进程安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Software (系统软件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=9614</guid>

					<description><![CDATA[内容一：显示 kill 所有可用的选项 内容二：kill 的常用案例 2.1 案例一：强杀某一个 PID 号 或者： 2.2 案例二：正常退出某一个 PID 号 2.3 案例三：杀死某一个进程名称下的所有 PID 号]]></description>
										<content:encoded><![CDATA[
<h3 id="内容一-查看-kill-所有可用的选项">内容一：显示 kill 所有可用的选项</h3>



<pre class="wp-block-code"><code># kill --help</code></pre>



<h3 id="内容二-kill-的常用案例2-1-案例一-强杀某一个-pid-号">内容二：kill 的常用案例</h3>



<h4 id="内容二-kill-的常用案例2-1-案例一-强杀某一个-pid-号">2.1 案例一：强杀某一个 PID 号</h4>



<pre class="wp-block-code"><code># kill -9 &lt;PID number></code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># kill -&lt;kill option> &lt;PID number></code></pre>



<h4 id="2-2-案例二-正常退出某一个-pid-号">2.2 案例二：正常退出某一个 PID 号</h4>



<pre class="wp-block-code"><code># kill -15 &lt;PID number></code></pre>



<h4 id="2-3-案例三-杀死某一个进程名称下的所有-pid-号">2.3 案例三：杀死某一个进程名称下的所有 PID 号</h4>



<pre class="wp-block-code"><code># killall &lt;process name&gt;</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux 命令 pstree （显示进程树）</title>
		<link>https://eternalcenter-sep-2022.github.io/pstreee/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sat, 30 May 2020 05:13:26 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Performance (系统性能)]]></category>
		<category><![CDATA[System Process (系统进程)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<category><![CDATA[System Process Security (系统进程安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=9612</guid>

					<description><![CDATA[内容一：系统环境要求 服务器系统配置好可用的软件源 内容二：如果系统中没有此命令，则需要先安装此命令 （补充：这里以 CentOS&#38;RHEL 安装 psmisc 为例） 内容三：使用此命令]]></description>
										<content:encoded><![CDATA[
<h3 id="内容一-系统环境要求">内容一：系统环境要求</h3>



<p>服务器系统配置好可用的软件源</p>



<h3 id="内容二-如果系统中没有此命令-则需要先安装此命令">内容二：如果系统中没有此命令，则需要先安装此命令</h3>



<pre class="wp-block-code"><code># yum -y install psmisc</code></pre>



<p>（补充：这里以 CentOS&amp;RHEL 安装 psmisc 为例）</p>



<h3 id="内容三-使用此命令">内容三：使用此命令</h3>



<pre class="wp-block-code"><code># pstree</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux 后台进程的管理</title>
		<link>https://eternalcenter-sep-2022.github.io/background-process/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sat, 30 May 2020 04:01:08 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Performance (系统性能)]]></category>
		<category><![CDATA[System Process (系统进程)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<category><![CDATA[System Process Security (系统进程安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Software (系统软件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=9608</guid>

					<description><![CDATA[内容一：将进程放入后台 1.1 直接将一个进程放到后台 1.2 将一个目前正在前台运行的进程放到后台 按下 “ctrl” 键和 “z” 键 内容二：显示放入后台的进程 2.1 显示所有放入后台的进程 2.2 显示某一个放入后台的进程 2.2.1 显示某一个放入后台进程（通过后台进程号） 2.2.2 显示某一个放入后台进程（通过后台进程名） （注意：只有后台进程名唯一时此操作才有效） 内容三：管理放入后台的进程 3.1 在后台启动放入后台的进程 3.1.1 在后台启动放入后台的进程（通过后台进程号） （注意：只有可以在后台启动的进程才能在后台启动） 3.1.2 在后台启动放入后台的进程（通过后台进程名） （注意：只有可以在后台启动的进程才能在后台启动，且只有后台进程名唯一时此操作才有效） 3.2 在前台启动放入后台的进程 3.2.1 在前台启动放入后台的进程（通过后台进程号） 3.2.2 在前台启动放入后台的进程（通过后台进程名） （注意：只有后台进程名唯一时此操作才有效） 3.3 杀死放入后台的进程 3.3.1 杀死放入后台的进程（通过后台进程号） （补充：这里可以配合各种 kill 选项进行操作，例如 kill -9） 3.3.2 杀死放入后台的进程（通过后台进程名） （注意：只有后台进程名唯一时此操作才有效） （补充：这里可以配合各种 kill 选项进行操作，例如 kill -9）]]></description>
										<content:encoded><![CDATA[
<h3 id="内容一-将进程放入后台1-1-直接将一个进程放到后台">内容一：将进程放入后台</h3>



<h4 id="内容一-将进程放入后台1-1-直接将一个进程放到后台">1.1 直接将一个进程放到后台</h4>



<pre class="wp-block-code"><code># firefox&amp;</code></pre>



<h4 id="1-2-将一个目前正在前台运行的进程放到后台">1.2 将一个目前正在前台运行的进程放到后台</h4>



<p>按下 “ctrl” 键和 “z” 键</p>



<h3 id="内容二-显示放入后台的进程2-1-显示所有放入后台的进程">内容二：显示放入后台的进程</h3>



<h4 id="内容二-显示放入后台的进程2-1-显示所有放入后台的进程">2.1 显示所有放入后台的进程</h4>



<pre class="wp-block-code"><code># jobs</code></pre>



<h4 id="2-2-显示某一个放入后台的进程2-2-1-显示某一个放入后台进程-通过后台进程号">2.2 显示某一个放入后台的进程</h4>



<h5 id="2-2-显示某一个放入后台的进程2-2-1-显示某一个放入后台进程-通过后台进程号">2.2.1 显示某一个放入后台进程（通过后台进程号）</h5>



<pre class="wp-block-code"><code># jobs %&lt;background process number&gt;</code></pre>



<h5 id="2-2-2-显示某一个放入后台进程-通过后台进程名">2.2.2 显示某一个放入后台进程（通过后台进程名）</h5>



<pre class="wp-block-code"><code># jobs %&lt;background process name&gt;</code></pre>



<p>（注意：只有后台进程名唯一时此操作才有效）</p>



<h3 id="内容三-管理放入后台的进程3-1-在后台启动放入后台的进程3-1-1-在后台启动放入后台的进程-通过后台进程号">内容三：管理放入后台的进程</h3>



<h4 id="内容三-管理放入后台的进程3-1-在后台启动放入后台的进程3-1-1-在后台启动放入后台的进程-通过后台进程号">3.1 在后台启动放入后台的进程</h4>



<h5 id="内容三-管理放入后台的进程3-1-在后台启动放入后台的进程3-1-1-在后台启动放入后台的进程-通过后台进程号">3.1.1 在后台启动放入后台的进程（通过后台进程号）</h5>



<pre class="wp-block-code"><code># bg %&lt;background process number&gt;</code></pre>



<p>（注意：只有可以在后台启动的进程才能在后台启动）</p>



<h5 id="3-1-2-在后台启动放入后台的进程-通过后台进程名">3.1.2 在后台启动放入后台的进程（通过后台进程名）</h5>



<pre class="wp-block-code"><code># bg %&lt;background process name&gt;</code></pre>



<p>（注意：只有可以在后台启动的进程才能在后台启动，且只有后台进程名唯一时此操作才有效）</p>



<h4 id="3-2-在前台启动放入后台的进程3-2-1-在前台启动放入后台的进程-通过后台进程号">3.2 在前台启动放入后台的进程</h4>



<h5 id="3-2-在前台启动放入后台的进程3-2-1-在前台启动放入后台的进程-通过后台进程号">3.2.1 在前台启动放入后台的进程（通过后台进程号）</h5>



<pre class="wp-block-code"><code># fg %&lt;background process number&gt;</code></pre>



<h5 id="3-2-2-在前台启动放入后台的进程-通过后台进程名">3.2.2 在前台启动放入后台的进程（通过后台进程名）</h5>



<pre class="wp-block-code"><code># fg %&lt;background process name&gt;</code></pre>



<p>（注意：只有后台进程名唯一时此操作才有效）</p>



<h4 id="3-3-杀死放入后台的进程3-3-1-杀死放入后台的进程-通过后台进程号">3.3 杀死放入后台的进程</h4>



<h5 id="3-3-杀死放入后台的进程3-3-1-杀死放入后台的进程-通过后台进程号">3.3.1 杀死放入后台的进程（通过后台进程号）</h5>



<pre class="wp-block-code"><code># kill %&lt;background process number&gt;</code></pre>



<p>（补充：这里可以配合各种 kill 选项进行操作，例如 kill -9）</p>



<h5 id="3-3-2-杀死放入后台的进程-通过后台进程名">3.3.2 杀死放入后台的进程（通过后台进程名）</h5>



<pre class="wp-block-code"><code># kill %&lt;background process name&gt;</code></pre>



<p>（注意：只有后台进程名唯一时此操作才有效）</p>



<p>（补充：这里可以配合各种 kill 选项进行操作，例如 kill -9）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux 命令 systemctl （程序单元启动和管理）</title>
		<link>https://eternalcenter-sep-2022.github.io/systemctl/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 13 Mar 2020 06:59:07 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Process (系统进程)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<category><![CDATA[System Software (系统软件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=8658</guid>

					<description><![CDATA[内容一：受 systemctl 管理的单元列表 1.1 列出所有 systemctl 可用单元以及是否开机自启 （补充：所有受 systemctl 管理单元的文件都是放在 /usr/lib/systemd/system 目录下的） 1.2 列出所有 systemctl 正在运行的单元 （补充：所有受 systemctl 管理单元的文件都是放在 /usr/lib/systemd/system 目录下的） 1.3 列出所有 systemctl 运行失败的单元 （补充：所有受 systemctl 管理单元的文件都是放在 /usr/lib/systemd/system 目录下的） 1.4 列出所有受 systemctl 管理的服务单元 （补充：1) 所有受 systemctl 管理单元的文件都是放在 /usr/lib/systemd/system 目录下的2) service 是一个个单独的服务3) target 是包含很多个单独服务（service）的一组服务） 1.5 列出所有受 systemctl 管理的目标单元 （补充：1) 所有受 systemctl 目标管理单元的文件都是放在 /usr/lib/systemd/system 目录下的2) service &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/systemctl/" class="more-link">Continue reading<span class="screen-reader-text"> "[命令] Linux 命令 systemctl （程序单元启动和管理）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h3 id="内容一-受-systemctl-管理的单元列表1-1-列出所有-systemctl-可用单元">内容一：受 systemctl 管理的单元列表</h3>



<h4 id="内容一-受-systemctl-管理的单元列表1-1-列出所有-systemctl-可用单元">1.1 列出所有 systemctl 可用单元以及是否开机自启</h4>



<pre class="wp-block-code"><code># systemctl list-unit-files</code></pre>



<p>（补充：所有受 systemctl 管理单元的文件都是放在 /usr/lib/systemd/system 目录下的）</p>



<h4 id="1-2-列出所有-systemctl-正在运行的单元">1.2 列出所有 systemctl 正在运行的单元</h4>



<pre class="wp-block-code"><code># systemctl list-units</code></pre>



<p>（补充：所有受 systemctl 管理单元的文件都是放在 /usr/lib/systemd/system 目录下的）</p>



<h4 id="1-3-列出所有-systemctl-运行失败的单元">1.3 列出所有 systemctl 运行失败的单元</h4>



<pre class="wp-block-code"><code># systemctl --failed</code></pre>



<p>（补充：所有受 systemctl 管理单元的文件都是放在 /usr/lib/systemd/system 目录下的）</p>



<h4 id="1-4-列出所有受-systemctl-管理的服务单元">1.4 列出所有受 systemctl 管理的服务单元</h4>



<pre class="wp-block-code"><code># systemctl list-units --type service</code></pre>



<p>（<br>补充：<br>1) 所有受 systemctl 管理单元的文件都是放在 /usr/lib/systemd/system 目录下的<br>2) service 是一个个单独的服务<br>3) target 是包含很多个单独服务（service）的一组服务<br>）</p>



<h4 id="1-5-列出所有受-systemctl-管理的目标单元">1.5 列出所有受 systemctl 管理的目标单元</h4>



<pre class="wp-block-code"><code># systemctl list-units --type target</code></pre>



<p>（<br>补充：<br>1) 所有受 systemctl 目标管理单元的文件都是放在 /usr/lib/systemd/system 目录下的<br>2) service 是一个个单独的服务<br>3) target 是包含很多个单独服务（service）的一组服务<br>）</p>



<h3 id="内容二-单元的状态查看">内容二：单元的状态显示</h3>



<pre class="wp-block-code"><code># systemctl status &lt;unit&gt;</code></pre>



<p>（<br>补充：<br>1) systemctl 的主要状态项有：<br>     Loaded 单元是否已被内存加载<br>     Active 单元是否已成功运行<br>     Main PID 单元主进程的 PID 号<br>     Status 单元的其他相关信息</p>



<p>2) Active 状态项的参数有：<br>     loaded 单元文件已经处理<br>     active（running） 单元正在运行<br>     active（exited）已完成单元的一次性配置<br>     active（waiting）正在等待启动<br>     inactive 没有启动<br>     enabled 将在系统启动时自动启动<br>     disabled 不会在系统启动时自动启动<br>     static 可以被其他单元启动</p>



<p>3) 单元既可以是服务单元也可以是目标单元<br>）</p>



<h3 id="内容三-单元的启动管理3-1-启动某一个单元">内容三：单元的启动管理</h3>



<h4 id="内容三-单元的启动管理3-1-启动某一个单元">3.1 启动某一个单元</h4>



<pre class="wp-block-code"><code># systemctl start &lt;unit&gt;</code></pre>



<p>（<br>补充：<br>1) service 是一个个单独的服务<br>2) target 是包含很多个单独服务（service）的一组服务<br>3) 单元既可以是服务单元（service）也可以是目标单元（target）<br>）</p>



<h4 id="3-2-停止某一个单元">3.2 停止某一个单元</h4>



<pre class="wp-block-code"><code># systemctl stop &lt;unit&gt;</code></pre>



<p>（<br>补充：<br>1) service 是一个个单独的服务<br>2) target 是包含很多个单独服务（service）的一组服务<br>3) 单元既可以是服务单元（service）也可以是目标单元（target）<br>）</p>



<h4 id="3-3-重启某一个单元">3.3 重启某一个单元</h4>



<pre class="wp-block-code"><code># systemctl restart &lt;unit&gt;</code></pre>



<p>（<br>补充：<br>1) service 是一个个单独的服务<br>2) target 是包含很多个单独服务（service）的一组服务<br>3) 单元既可以是服务单元（service）也可以是目标单元（target）<br>）</p>



<h4 id="3-3-显示某一个单元是否正在运行">3.3 显示某一个单元是否正在运行</h4>



<pre class="wp-block-code"><code># systemctl is-active &lt;unit&gt;</code></pre>



<p>（<br>补充：<br>1) service 是一个个单独的服务<br>2) target 是包含很多个单独服务（service）的一组服务<br>3) 单元既可以是服务单元（service）也可以是目标单元（target）<br>）</p>



<h4 id="3-4-启动并将一个单元设置为开机自启">3.4 启动并将一个单元设置为开机自启</h4>



<pre class="wp-block-code"><code># systemctl enable --now &lt;unit&gt;</code></pre>



<p>（<br>补充：<br>1) service 是一个个单独的服务<br>2) target 是包含很多个单独服务（service）的一组服务<br>3) 单元既可以是服务单元（service）也可以是目标单元（target）<br>）</p>



<h3 id="内容四-单元的开机自启管理4-1-让某一个单元开机自启">内容四：单元的开机自启管理</h3>



<h4 id="内容四-单元的开机自启管理4-1-让某一个单元开机自启">4.1 让某一个单元开机自启</h4>



<pre class="wp-block-code"><code># systemctl enable &lt;unit&gt;</code></pre>



<p>（<br>补充：<br>1) service 是一个个单独的服务<br>2) target 是包含很多个单独服务（service）的一组服务<br>3) 单元既可以是服务单元（service）也可以是目标单元（target）<br>）</p>



<h4 id="4-2-取消某一个单元的开机自启">4.2 取消某一个单元的开机自启</h4>



<pre class="wp-block-code"><code># systemctl disable &lt;unit&gt;</code></pre>



<p>（<br>补充：<br>1) service 是一个个单独的服务<br>2) target 是包含很多个单独服务（service）的一组服务<br>3) 单元既可以是服务单元（service）也可以是目标单元（target）<br>）</p>



<h4 id="4-3-显示某一个单元是否是开机自启">4.3 显示某一个单元是否是开机自启</h4>



<pre class="wp-block-code"><code># systemctl is-enabled &lt;unit&gt;</code></pre>



<p>（<br>补充：<br>1) service 是一个个单独的服务<br>2) target 是包含很多个单独服务（service）的一组服务<br>3) 单元既可以是服务单元（service）也可以是目标单元（target）<br>）</p>



<h3 id="内容五-单元的锁定管理5-1-锁定某一个单元-禁止其启动">内容五：单元的锁定管理</h3>



<h4 id="内容五-单元的锁定管理5-1-锁定某一个单元-禁止其启动">5.1 锁定某一个单元（禁止其启动）</h4>



<pre class="wp-block-code"><code># systemctl mask &lt;unit&gt;</code></pre>



<p>（<br>补充：<br>1) service 是一个个单独的服务<br>2) target 是包含很多个单独服务（service）的一组服务<br>3) 单元既可以是服务单元（service）也可以是目标单元（target）<br>）</p>



<h4 id="5-2-取消某一个单元的锁定-让它可以启动">5.2 取消某一个单元的锁定（让它可以启动）</h4>



<pre class="wp-block-code"><code># systemctl umask &lt;unit&gt;</code></pre>



<p>（<br>补充：<br>1) service 是一个个单独的服务<br>2) target 是包含很多个单独服务（service）的一组服务<br>3) 单元既可以是服务单元（service）也可以是目标单元（target）<br>）</p>



<h3 id="内容六-重新加载某-systemctl-的配置文件">内容六：重新加载某 systemctl 的配置文件</h3>



<pre class="wp-block-code"><code># systemctl daemon-reload</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux 命令 iotop （显示某一个进程占用 IO 的情况） （转载）</title>
		<link>https://eternalcenter-sep-2022.github.io/iotop/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 13 Mar 2020 06:52:34 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Performance (系统性能)]]></category>
		<category><![CDATA[System Process (系统进程)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<category><![CDATA[System Process Security (系统进程安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=8655</guid>

					<description><![CDATA[注明：所有转载内容皆直接从被转载文章网页的标题和内容的文本中复制而来]]></description>
										<content:encoded><![CDATA[
<pre class="wp-block-code"><code>记一次iotop分析磁盘占用io问题

问题描述    

                 某一台服务器上面 程序在每小时内偶尔丢包 排查服务器所有性能瓶颈之后发现一个奇怪的问题 程序丢包前后 会有IO过高的情况 于是使用iotop命令排查是哪个程序偶尔占用过高的磁盘IO

所用命令  

                 iotop

相关参数 

    -o：只显示有io操作的进程

    -b：批量显示，无交互，主要用作记录到文件

    -n NUM：显示NUM次，主要用于非交互式模式

    -d SEC：间隔SEC秒显示一次

    -p PID：监控的进程pid

    -u USER：监控的进程用户

排查方法

        iostat命令 只能看出每个盘符的IO情况 不能看到是具体哪个进程使用的IO 所以 我们需要使用iotop命令 但是这次的IO情况并不是一直出现 而是偶尔不规律出现 如果用肉眼去一直盯着终端看 显然不可行 于是我们可以用iotop的-b参数 让结果以非交互的方式输出 这样我们便可以用awk去处理 打印出我们需要的IO列以及相应的进程

命令

iotop -b | awk -F'%' '{if($(NF-1) &gt; 0.2 &amp;&amp; $(NF-1) ~ /&#91;0-9]/ &amp;&amp; $0 !~ /DISK/)printf "TIME: %s,IO:%s%,COMMAND:%s\n",strftime("%F %T"),$(NF-1),$NF}'

输出结果

&#91;root@localhost ~]# iotop -b | awk -F'%' '{if($(NF-1) &gt; 0.2 &amp;&amp; $(NF-1) ~ /&#91;0-9]/ &amp;&amp; $0 !~ /DISK/)printf "TIME: %s,IO:%s%,COMMAND:%s\n",strftime("%F %T"),$(NF-1),$NF}'
TIME: 2018-03-21 18:04:23,IO:  0.23 %,COMMAND: &#91;kworker/0:2]
TIME: 2018-03-21 18:04:35,IO:  0.44 %,COMMAND: &#91;kworker/0:2]
TIME: 2018-03-21 18:04:47,IO:  0.22 %,COMMAND: &#91;kworker/0:2]
TIME: 2018-03-21 18:04:58,IO:  0.39 %,COMMAND: &#91;kworker/0:2]
TIME: 2018-03-21 18:05:08,IO:  0.68 %,COMMAND: &#91;kworker/0:2]
TIME: 2018-03-21 18:05:22,IO:  0.52 %,COMMAND: &#91;kworker/0:2]
TIME: 2018-03-21 18:05:34,IO:  0.24 %,COMMAND: &#91;kworker/0:2]
TIME: 2018-03-21 18:05:45,IO:  0.26 %,COMMAND: &#91;kworker/0:2]

        输出结果类似上面 这里只是简单举个例子 打印出IO大于0.2%的进程 并根据客户需求打印除相应的时间 这里的时间打印 利用awk自己的函数 strftime()
————————————————
版权声明：本文为CSDN博主「why_me310」的原创文章，遵循 CC 4.0 BY-SA 版权协议，转载请附上原文出处链接及本声明。
原文链接：https://blog.csdn.net/why_me310/article/details/79643352</code></pre>



<p>注明：所有转载内容皆直接从被转载文章网页的标题和内容的文本中复制而来</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" width="1013" height="203" src="https://eternalcenter-sep-2022.github.io/wp-content/uploads/2020/03/版权申明证明-iotop.png" alt="" class="wp-image-8656" srcset="https://eternalcenter-sep-2022.github.io/wp-content/uploads/2020/03/版权申明证明-iotop.png 1013w, https://eternalcenter-sep-2022.github.io/wp-content/uploads/2020/03/版权申明证明-iotop-300x60.png 300w, https://eternalcenter-sep-2022.github.io/wp-content/uploads/2020/03/版权申明证明-iotop-768x154.png 768w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption>CC 4.0 BY-SA 版权协议网址：https://creativecommons.org/licenses/by-sa/4.0/deed.z</figcaption></figure></div>



<pre class="wp-block-code"><code>站主补充：
 iotop 还有以下参数
-k, --kilobytes 在非交互的模式下，以 kb 为单位显示
-t, --time 在非交互的模式下，加上时间戳
-q, --quiet 在交互的模式下，禁止头几行，它有三种指定方式
    -q 只有在第一次显示时显示列名
    -qq 永远不显示列名
    -qqq 永远不显示 I/O 汇总的总量</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux 命令 sar （报告系统活动情况） （转载）</title>
		<link>https://eternalcenter-sep-2022.github.io/sar/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 13 Mar 2020 06:36:59 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Network (系统网络)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Performance (系统性能)]]></category>
		<category><![CDATA[System Process (系统进程)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<category><![CDATA[System Process Security (系统进程安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Storage (系统存储)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=8644</guid>

					<description><![CDATA[注明：所有转载内容皆直接从被转载文章网页的标题和内容的文本和图片中复制而来]]></description>
										<content:encoded><![CDATA[
<pre class="wp-block-code"><code>sar

sar（SYstem ActivityReporter系统活动情况报告）是目前Linux上最为全面的系统性能分析工具之一，可以从多方面对系统的活动进行报告，包括：文件的读写情况，系统调用的使用情况，磁盘I/O，CPU效率，内存使用状况，进程活动及IPC有关的活动；
sar命令有sysstat安装包安装
1.安装：&#91;root@admin ~]# yum -y install sysstat
2.参数：
-u :输出CPU使用情况和统计信息
-p:报告每个CPU的状态
-q:查看平均负载
-r:查看内存使用情况
-W :查看系统swap分区的统计信息
-x:显示给定进程的统计信息
-b:查看I/O和传递速率的统计信息
 -d:磁盘使用详细统计
 -v:进程，inode，文件和锁表状态
 -n:统计网络信息
-u :输出CPU使用情况和统计信息
-A：所有报告总和
-i:设置状态信息刷新的间隔时间
    &#91;root@admin ~]# sar -u 1 3  （每隔一秒总共统计三次；统计CPU的使用情况）</code></pre>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="579" height="218" src="https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/sar-1.png" alt="" class="wp-image-19637" srcset="https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/sar-1.png 579w, https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/sar-1-300x113.png 300w" sizes="(max-width: 579px) 100vw, 579px" /></figure></div>



<pre class="wp-block-code"><code>在以上的显示中，主要看%iowait和%idle，%iowait过高表示存在I/O瓶颈，即磁盘I/O无法满足业务需求，如果%idle过低表示CPU使用率比较严重，需要结合内存使用等情况半段CPU是否瓶颈。
2.2 -p:报告每个CPU的状态
    &#91;root@admin ~]# sar -p 1 3 （报告每个CPU的使用状态）</code></pre>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="571" height="130" src="https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/sar-2.png" alt="" class="wp-image-19638" srcset="https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/sar-2.png 571w, https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/sar-2-300x68.png 300w" sizes="(max-width: 571px) 100vw, 571px" /></figure></div>



<pre class="wp-block-code"><code>2.3 将统计结果保存在文件中，并从文件读取内容
        &#91;root@admin ~]# sar -u -o /servers/script/sar.txt 2 3 （保存之文件，保存后的文件是二进制的，无法使用vim和cat查看）
        &#91;root@admin ~]# sar -u -f /servers/script/sar.txt （从二进制文件读取）</code></pre>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="579" height="262" src="https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/sar-3.png" alt="" class="wp-image-19639" srcset="https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/sar-3.png 579w, https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/sar-3-300x136.png 300w" sizes="(max-width: 579px) 100vw, 579px" /></figure></div>



<pre class="wp-block-code"><code>注：将输出到文件(-o)和读取记录信息(-f)
2.4 -q:查看平均负载
        &#91;root@admin ~]# sar -q 1 3</code></pre>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="566" height="227" src="https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/sar-4.png" alt="" class="wp-image-19640" srcset="https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/sar-4.png 566w, https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/sar-4-300x120.png 300w" sizes="(max-width: 566px) 100vw, 566px" /></figure></div>



<pre class="wp-block-code"><code>2.5-r:查看内存使用情况
        &#91;root@admin ~]# sar -r</code></pre>



<figure class="wp-block-image size-full"><img loading="lazy" width="612" height="393" src="https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/sar-5.png" alt="" class="wp-image-19642" srcset="https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/sar-5.png 612w, https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/sar-5-300x193.png 300w" sizes="(max-width: 612px) 100vw, 612px" /></figure>



<pre class="wp-block-code"><code>2.6 -W :查看系统swap分区的统计信息</code></pre>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="369" height="232" src="https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/sar-6.png" alt="" class="wp-image-19643" srcset="https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/sar-6.png 369w, https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/sar-6-300x189.png 300w" sizes="(max-width: 369px) 100vw, 369px" /></figure></div>



<pre class="wp-block-code"><code>2.7 -b:查看I/O和传递速率的统计信息
2.8 -d:磁盘使用详细统计
2.9 -v:进程，inode，文件和锁表状态
2.10 -n:统计网络信息
        1） DEV：网络接口统计信息
        2） EDEV：网络接口错误
        3）IP：IP数据报统计信息
        4)：EIP：IP错误统计信息
         5）TCP：TCP统计信息
          6）ETCP：TCP错误统计信息
         7）SOCK：套接字使用</code></pre>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" width="556" height="246" src="https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/sar-7.png" alt="" class="wp-image-19644" srcset="https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/sar-7.png 556w, https://eternalcenter-sep-2022.github.io/wp-content/uploads/2021/12/sar-7-300x133.png 300w" sizes="(max-width: 556px) 100vw, 556px" /></figure></div>



<pre class="wp-block-code"><code>————————————————
版权声明：本文为CSDN博主「喵喵Amy」的原创文章，遵循 CC 4.0 BY-SA 版权协议，转载请附上原文出处链接及本声明。
原文链接：https://blog.csdn.net/an1415/article/details/80761614</code></pre>



<p>注明：所有转载内容皆直接从被转载文章网页的标题和内容的文本和图片中复制而来</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" width="1014" height="202" src="https://eternalcenter-sep-2022.github.io/wp-content/uploads/2020/03/版权申明证明-sar.png" alt="" class="wp-image-8652" srcset="https://eternalcenter-sep-2022.github.io/wp-content/uploads/2020/03/版权申明证明-sar.png 1014w, https://eternalcenter-sep-2022.github.io/wp-content/uploads/2020/03/版权申明证明-sar-300x60.png 300w, https://eternalcenter-sep-2022.github.io/wp-content/uploads/2020/03/版权申明证明-sar-768x153.png 768w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /><figcaption>CC 4.0 BY-SA 版权协议网址：https://creativecommons.org/licenses/by-sa/4.0/deed.z</figcaption></figure></div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] Linux Nginx  源码安装包的管理 （通过 systemd 实现）</title>
		<link>https://eternalcenter-sep-2022.github.io/systemctl-service/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Thu, 17 Oct 2019 14:32:11 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Nginx Management (管理)]]></category>
		<category><![CDATA[Nginx Monitor (监控)]]></category>
		<category><![CDATA[Service (服务)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Process (系统进程)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<category><![CDATA[System Software (系统软件)]]></category>
		<category><![CDATA[Website Service (网站服务)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=5912</guid>

					<description><![CDATA[注意： 在通过 systemd 管理源码安装的软件或自制 rpm 包安装的软件（以 Nginx 为例）之前，先要源码安装 Nginx 或者自制 rpm 包安装 Nginx 正文： 步骤一：创建 Nginx 的 systemd 文件 创建以下内容： 步骤二：导入新创建的 Nginx systemd 配置文件 步骤三：使用 systemd 管理 Nginx 3.1 使用 systemd 启动 Nginx 3.2 使用 systemd 开机自启 Nginx 3.3 使用 systemd 显示 Nginx 的状态]]></description>
										<content:encoded><![CDATA[
<h1>注意：</h1>



<p>在通过 systemd 管理源码安装的软件或自制 rpm 包安装的软件（以 Nginx 为例）之前，先要源码安装 Nginx 或者自制 rpm 包安装 Nginx</p>



<div class="wp-container-2 is-horizontal is-content-justification-center wp-block-buttons">
<div class="wp-block-button is-style-outline"><a class="wp-block-button__link no-border-radius" href="https://eternalcenter-sep-2022.github.io/nginx-install-source/">Nginx 源码软件包的安装</a></div>



<div class="wp-block-button is-style-outline"><a class="wp-block-button__link no-border-radius" href="https://eternalcenter-sep-2022.github.io/rpm-make/">Linux rpm 软件包的制作<br>（通过 rpm-build 实现）<br>（Nginx 版）</a></div>
</div>



<h1 id="正文">正文：</h1>



<h3 id="步骤一-创建-nginx-的-systemd-文件">步骤一：创建 Nginx 的 systemd 文件</h3>



<pre class="wp-block-code"><code># vim /etc/systemd/system/nginx.service </code></pre>



<p>创建以下内容：</p>



<pre class="wp-block-code"><code>&#91;Unit]

Description=nginx server daemon

Documentation=man:nginx(8)

After=network.target

&#91;Service]

Type=forking

ExecStart=/usr/local/nginx/sbin/nginx

ExecReload=/usr/local/nginx/sbin/nginx -s reload

ExecStop=/usr/local/nginx/sbin/nginx -s stop

PrivateTmp=true

&#91;Install]

WantedBy=multi-user.target</code></pre>



<h3 id="步骤二-导入新创建的-nginx-systemd-配置文件">步骤二：导入新创建的 Nginx systemd 配置文件</h3>



<pre class="wp-block-code"><code># systemctl daemon-reload</code></pre>



<h3 id="步骤三-使用-systemd-管理-ngixn3-1-使用-systemd-启动-nginx">步骤三：使用 systemd 管理 Nginx</h3>



<h4 id="步骤三-使用-systemd-管理-ngixn3-1-使用-systemd-启动-nginx">3.1 使用 systemd 启动 Nginx</h4>



<pre class="wp-block-code"><code># systemctl start nginx.service</code></pre>



<h4 id="3-2-使用-systemd-开机自启-nginx">3.2 使用 systemd 开机自启 Nginx</h4>



<pre class="wp-block-code"><code># systemctl enable nginx.service</code></pre>



<h4 id="3-3-使用-systemd-显示-nginx-的状态">3.3 使用 systemd 显示 Nginx 的状态</h4>



<pre class="wp-block-code"><code># systemctl status nginx.service</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] Linux 开机自启 （通过 chkconfig 实现）</title>
		<link>https://eternalcenter-sep-2022.github.io/chkconfig/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Wed, 24 Jul 2019 12:03:18 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System File Security (系统文件安全)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Process (系统进程)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Setting (系统设置)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=4889</guid>

					<description><![CDATA[案例一：添加一个受 chkconfig 管理的服务（脚本） 1.1 编写一个脚本 创建以下内容： （补充：chkconfig:后面的 3 个含义为 httpd 的级别为 3、4 和 5，启动序号为 85，关闭序号为 15） 1.2 给脚本添加执行权限 1.3 将脚本添加到 chkconfig 中 1.4 显示刚刚添加到 chkconfig 的应用 案例二：通过 chkconfig 管理一个服务或脚本 2.1 设定 start.sh 在 3 和 5 等级为 on 2.2 设定 start.sh 在各等级为 on，“各等级”包括 2、3、4、5 等级 2.3 设定 start.sh 在各等级为 off，“各等级”包括 2、3、4、5 等级]]></description>
										<content:encoded><![CDATA[
<h3 id="案例一-添加一个受-chkconfig-管理的服务-脚本-1-1-编写一个脚本">案例一：添加一个受 chkconfig 管理的服务（脚本）</h3>



<h4 id="案例一-添加一个受-chkconfig-管理的服务-脚本-1-1-编写一个脚本">1.1 编写一个脚本</h4>



<pre class="wp-block-code"><code># vim /etc/init.d/start.sh</code></pre>



<p>创建以下内容：</p>



<pre class="wp-block-code"><code>#!/bin/bash
systemctl start httpd

# chkconfig: 345 85 15
# description: This is a script of starting httpd</code></pre>



<p>（补充：chkconfig:后面的 3 个含义为 httpd 的级别为 3、4 和 5，启动序号为 85，关闭序号为 15）</p>



<h4 id="1-2-给脚本添加执行权限">1.2 给脚本添加执行权限</h4>



<pre class="wp-block-code"><code># chmod +x /etc/init.d/start.sh</code></pre>



<h4 id="1-3-将脚本添加到-chkconfig-中">1.3 将脚本添加到 chkconfig 中</h4>



<pre class="wp-block-code"><code># chkconfig --add start.sh</code></pre>



<h4 id="1-4-显示刚刚添加到-chkconfig-的应用">1.4 显示刚刚添加到 chkconfig 的应用</h4>



<pre class="wp-block-code"><code># chkconfig --list</code></pre>



<h3 id="案例二-通过-chkconfig-管理一个服务或脚本2-1-设定-start-sh-在-3-和-5-等级为-on">案例二：通过 chkconfig 管理一个服务或脚本</h3>



<h4 id="案例二-通过-chkconfig-管理一个服务或脚本2-1-设定-start-sh-在-3-和-5-等级为-on">2.1 设定 start.sh 在 3 和 5 等级为 on</h4>



<pre class="wp-block-code"><code># chkconfig --level 35 start.sh on</code></pre>



<h4 id="2-2-设定-start-sh-在各等级为-on-各等级-包括-2-3-4-5-等级">2.2 设定 start.sh 在各等级为 on，“各等级”包括 2、3、4、5 等级</h4>



<pre class="wp-block-code"><code># chkconfig start.sh on</code></pre>



<h4 id="2-3-设定-start-sh-在各等级为-off-各等级-包括-2-3-4-5-等级">2.3 设定 start.sh 在各等级为 off，“各等级”包括 2、3、4、5 等级</h4>



<pre class="wp-block-code"><code># chkconfig start.sh off</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] openSUSE &#038; SLE 开机自启</title>
		<link>https://eternalcenter-sep-2022.github.io/auto-start-opensuse-sle/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 11 Jun 2019 03:02:48 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System File Security (系统文件安全)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Process (系统进程)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<category><![CDATA[System Process Security (系统进程安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Setting (系统设置)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=4785</guid>

					<description><![CDATA[内容一：openSUSE &#38; SLE 开机设置文档介绍 （补充：1) 其中的 boot.local 是在刚开机时，在所有其他的程序执行前执行的文件2) 其中的 after.local 是在刚开机后，在所有其他的程序执行后执行的文件） （注意：上面第三和第四个档案默认是不存在的，可以自己创建一个, 就像写个 shell 一样很简单） 内容二：设置 openSUSE &#38; SLE 开机自启命令的案例 2.1 创建 after.local 文件 创建以下内容： （补充：这里以开机自启 httpd 程序为例） 2.2 给 after.local 文件执行权限]]></description>
										<content:encoded><![CDATA[
<h3>内容一：openSUSE &amp; SLE 开机设置文档介绍</h3>



<pre class="wp-block-code"><code>1) /etc/init.d/boot.local
2) /etc/init.d/halt.local
3) /etc/init.d/before.local
4) /etc/init.d/after.local</code></pre>



<p>（<br>补充：<br>1) 其中的 boot.local 是在刚开机时，在所有其他的程序执行前执行的文件<br>2) 其中的 after.local 是在刚开机后，在所有其他的程序执行后执行的文件<br>）</p>



<p>（注意：上面第三和第四个档案默认是不存在的，可以自己创建一个, 就像写个 shell 一样很简单）</p>



<h3>内容二：设置 openSUSE &amp; SLE 开机自启命令的案例</h3>



<h4>2.1 创建 after.local 文件</h4>



<pre class="wp-block-code"><code># vim /etc/init.d/after.local</code></pre>



<p>创建以下内容：</p>



<pre class="wp-block-code"><code>sudo systemctl restart httpd</code></pre>



<p>（补充：这里以开机自启 httpd 程序为例）</p>



<h4>2.2 给 after.local 文件执行权限</h4>



<pre class="wp-block-code"><code># chmod u+x /etc/init.d/after.local</code></pre>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
