From 837ce31756c3ca3e0f9f9a1843724b3720720ee2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=88=98=E7=BE=A4?= <517067180@qq.com>
Date: Thu, 7 May 2020 14:29:51 +0800
Subject: [PATCH 01/22] =?UTF-8?q?=E4=BF=AE=E6=AD=A3xml=E7=A4=BA=E4=BE=8B?=
=?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=BC=A9=E8=BF=9B=E5=AF=B9=E9=BD=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...21\347\273\234\350\256\276\345\244\207.md" | 126 +++++++++---------
1 file changed, 63 insertions(+), 63 deletions(-)
diff --git "a/content/zh/docs/Virtualization/\347\275\221\347\273\234\350\256\276\345\244\207.md" "b/content/zh/docs/Virtualization/\347\275\221\347\273\234\350\256\276\345\244\207.md"
index c8bd234a0..05253d246 100644
--- "a/content/zh/docs/Virtualization/\347\275\221\347\273\234\350\256\276\345\244\207.md"
+++ "b/content/zh/docs/Virtualization/\347\275\221\347\273\234\350\256\276\345\244\207.md"
@@ -11,65 +11,65 @@ XML配置文件中使用元素“interface”,其属性“type”表示虚拟
**表 1** bridge模式虚拟网卡常用子元素
-
/etc/vsftpd/chroot_list
@@ -173,6 +170,7 @@ FTP的正常工作需要使用到多个网络端口,服务器端会使用到
+
### 默认配置说明
> **说明:**
@@ -181,7 +179,7 @@ FTP的正常工作需要使用到多个网络端口,服务器端会使用到
openEuler系统中 ,vsftpd默认不开放匿名用户,使用vim命令查看主配置文件,其内容如下:
```
-# vim /etc/vsftpd/vsftpd.conf
+$ vim /etc/vsftpd/vsftpd.conf
anonymous_enable=NO
local_enable=YES
write_enable=YES
@@ -283,7 +281,7 @@ openEuler系统中,vsftpd默认使用GMT时间(格林尼治时间),可
#### 设置方法
-设置vsftpd时间为本地时间的操作步骤如下:
+在root权限下设置vsftpd时间为本地时间的操作步骤如下:
1. 打开配置文件vsftpd.conf,将参数use\_localtime的参数值改为YES。命令如下:
@@ -312,7 +310,7 @@ openEuler系统中,vsftpd默认使用GMT时间(格林尼治时间),可
### 配置欢迎信息
-正常使用vsftpd服务,需要存在欢迎信息文件。设置vsftp的欢迎信息welcome.txt文件的操作步骤如下:
+正常使用vsftpd服务,需要存在欢迎信息文件。在root权限下设置vsftp的欢迎信息welcome.txt文件的操作步骤如下:
1. 打开配置文件vsftpd.conf,加入欢迎信息文件配置内容后保存退出。
@@ -350,12 +348,12 @@ openEuler系统中,vsftpd默认使用GMT时间(格林尼治时间),可
两个文件的必须同时存在且内容相同,请参考/etc/passwd文件,将UID小于500的帐号写入这两个文件,每一行代表一个帐号。
-如果用户需要限制系统帐号登录,需要将对应帐号添加到/etc/vsftpd/ftpusers和/etc/vsftpd/user\_list。
+如果用户需要限制系统帐号登录,需要在root权限下将对应帐号添加到/etc/vsftpd/ftpusers和/etc/vsftpd/user\_list。
打开user\_list可以查看当前文件中包含的帐号信息,命令和回显如下:
```
-# vim /etc/vsftpd/user_list
+$ vim /etc/vsftpd/user_list
root
bin
daemon
@@ -377,8 +375,7 @@ nobody
可以使用openEuler提供的FTP客户端进行验证。命令和回显如下,根据提示输入用户名(用户为系统中存在的用户)和密码。如果显示Login successful,即说明FTP服务器搭建成功。
```
-# dnf install ftp
-# ftp localhost
+$ ftp localhost
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
220-Welcome to this FTP server!
@@ -393,9 +390,14 @@ ftp> bye
221 Goodbye.
```
+> **说明:**
+>如果没有**ftp**命令,可以在root权限下执行**dnf install ftp**命令安装后再使用**ftp**命令。
+
+
+
## 配置防火墙
-如果要将FTP开放给Internet使用,需要对防火墙和SElinux进行设置。
+如果要将FTP开放给Internet使用,需要在root权限下对防火墙和SElinux进行设置。
```
# firewall-cmd --add-service=ftp --permanent
@@ -424,7 +426,7 @@ success
在openEuler系统的命令行终端,执行如下命令:
```
-ftp ip-address
+$ ftp ip-address
```
根据提示输入用户名和密码,认证通过后显示如下,说明ftp连接成功,此时进入了连接到的服务器目录。
@@ -435,7 +437,7 @@ ftp>
在该提示符下,可以输入不同的命令进行相关操作:
-- 显示服务器当前地址
+- 显示服务器当前路径
```
ftp>pwd
@@ -465,10 +467,10 @@ ftp>
其中 _remote-file_ 为远程文件,_local-file_ 为本地文件
-- 示例:获取远程服务器上的/usr/your/openEuler.htm文件,命令如下:
+- 示例:获取远程服务器上的/home/openEuler/openEuler.htm文件到本地/home/myopenEuler/,并改名为myopenEuler.htm,命令如下:
```
- ftp> get /usr/your/openEuler.htm
+ ftp> get /home/openEuler/openEuler.htm /home/myopenEuler/myopenEuler.htm
```
@@ -479,16 +481,16 @@ ftp>
其中 _remote-file_ 为远程文件
-- 示例:获取服务器上/usr/your/目录下的所有文件,命令如下:
+- 示例:获取服务器上/home/openEuler/目录下的所有文件,命令如下:
```
- ftp> cd /usr/your/
+ ftp> cd /home/openEuler/
ftp> mget *.*
```
> **说明:**
>- 此时每下载一个文件,都会有提示信息。如果要屏蔽提示信息,则在 **mget \*.\*** 命令前先执行**prompt off**
- >- 文件都被下载到Linux主机的当前目录下。比如,在/usr/my/下运行的ftp命令,则文件都下载到/usr/my/下。
+ >- 文件都被下载到Linux主机的当前目录下。比如,在/home/myopenEuler/下运行的ftp命令,则文件都下载到/home/myopenEuler/下。
### 上传文件
@@ -502,10 +504,10 @@ ftp>
其中 _remote-file_ 为远程文件,_local-file_ 为本地文件
-- 示例:将本地的Euler.htm传送到远端主机/usr/your/,并改名为openEuler.htm,命令如下:
+- 示例:将本地的myopenEuler.htm传送到远端主机/home/openEuler/,并改名为openEuler.htm,命令如下:
```
- ftp> put Euler.htm /usr/your/openEuler.htm
+ ftp> put myopenEuler.htm /home/openEuler/openEuler.htm
```
@@ -516,10 +518,10 @@ ftp>
其中 _local-file_ 为本地文件
-- 示例:将本地当前目录下所有htm文件上传到服务器/usr/your/下,命令如下:
+- 示例:将本地当前目录下所有htm文件上传到服务器/home/openEuler/下,命令如下:
```
- ftp> cd /usr/your
+ ftp> cd /home/openEuler/
ftp> mput *.htm
```
@@ -535,13 +537,13 @@ ftp>
其中 _remote-file_ 为远程文件
-- 示例:删除远程服务器上的openFile文件,命令如下:
+- 示例:删除远程服务器上/home/openEuler/下的openEuler.htm文件,命令如下:
```
- ftp> delete openFile
+ ftp> cd /home/openEuler/
+ ftp> delete openEuler.htm
```
-
**mdelete使用方法**
- 功能说明:删除远程服务器上的文件,常用于批量删除
@@ -549,9 +551,10 @@ ftp>
其中 _remote-file_ 为远程文件
-- 示例:删除所有a开头的文件,命令如下:
+- 示例:删除远程服务器上/home/openEuler/下所有a开头的文件,命令如下:
```
+ ftp> cd /home/openEuler/
ftp> mdelete a*
```
diff --git "a/content/zh/docs/Administration/\346\220\255\345\273\272repo\346\234\215\345\212\241\345\231\250.md" "b/content/zh/docs/Administration/\346\220\255\345\273\272repo\346\234\215\345\212\241\345\231\250.md"
index 519808a7b..d46a7ee41 100644
--- "a/content/zh/docs/Administration/\346\220\255\345\273\272repo\346\234\215\345\212\241\345\231\250.md"
+++ "b/content/zh/docs/Administration/\346\220\255\345\273\272repo\346\234\215\345\212\241\345\231\250.md"
@@ -37,12 +37,12 @@
### 挂载ISO创建repo源
-使用mount命令挂载镜像文件。
+在root权限下使用mount命令挂载镜像文件。
示例如下:
```
-mount /home/openEuler/openEuler-20.03-LTS-aarch64-dvd.iso /mnt/
+# mount /home/openEuler/openEuler-20.03-LTS-aarch64-dvd.iso /mnt/
```
挂载好的mnt目录如下:
@@ -66,11 +66,11 @@ mount /home/openEuler/openEuler-20.03-LTS-aarch64-dvd.iso /mnt/
可以拷贝镜像中相关文件至本地目录以创建本地repo源,示例如下:
```
-mount /home/openEuler/openEuler-20.03-LTS-aarch64-dvd.iso /mnt/
-mkdir -p /srv/repo/
-cp -r /mnt/Packages /srv/repo/
-cp -r /mnt/repodata /srv/repo/
-cp -r /mnt/RPM-GPG-KEY-openEuler /srv/repo/
+# mount /home/openEuler/openEuler-20.03-LTS-aarch64-dvd.iso /mnt/
+$ mkdir -p ~/srv/repo/
+$ cp -r /mnt/Packages ~/srv/repo/
+$ cp -r /mnt/repodata ~/srv/repo/
+$ cp -r /mnt/RPM-GPG-KEY-openEuler ~/srv/repo/
```
从而本地repo目录如下:
@@ -88,15 +88,18 @@ Packages为rpm包所在的目录,repodata为repo源元数据所在的目录,
更新repo源有两种方式:
-- 通过新版本的ISO更新已有的repo源,与创建repo源的方式相同,即挂载镜像或者重新拷贝镜像至本地目录
+- 通过新版本的ISO更新已有的repo源,与创建repo源的方式相同,即挂载镜像或者重新拷贝镜像至本地目录
+
- 在repo源的Packages目录下添加rpm包,然后更新repo源,可通过createrepo命令更新repo源
```
- dnf install createrepo
- createrepo --update --workers=10 /srv/repo
+ $ createrepo --update --workers=10 ~/srv/repo
```
其中,\-\-update表示更新,\-\-workers表示线程数,可自定义。
+
+ > **说明:**
+ >若命令打印信息为“createrepo:未找到命令”,则表示未安装createrepo软件,可在root权限下执行**dnf install createrepo**进行安装。
## 部署远端repo源
@@ -104,14 +107,14 @@ Packages为rpm包所在的目录,repodata为repo源元数据所在的目录,
安装openEuler操作系统,在openEuler上通过nginx部署repo源。
### nginx安装与配置
-1. 请自行下载nginx工具并安装nginx。
-2. 安装nginx之后,配置/etc/nginx/nginx.conf。
+1. 请自行下载nginx工具并在root权限下安装nginx。
+2. 安装nginx之后,在root权限下配置/etc/nginx/nginx.conf。
> **说明:**
>文档中的配置内容仅供参考,请用户根据实际情况(例如安全加固需要)进行配置。
```
- user root;
+ user openEuler;
worker_processes auto; # 建议设置为core-1
error_log /var/log/nginx/error.log warn; # log存放位置
pid /var/run/nginx.pid;
@@ -136,7 +139,7 @@ Packages为rpm包所在的目录,repodata为repo源元数据所在的目录,
listen 80;
server_name localhost; # 服务器名(url)
client_max_body_size 4G;
- root /srv/repo; # 服务默认目录
+ root /home/openEuler/srv/repo; # 服务默认目录
location / {
autoindex on; # 开启访问目录下层文件
@@ -152,17 +155,17 @@ Packages为rpm包所在的目录,repodata为repo源元数据所在的目录,
### 启动nginx服务
-1. 通过systemd启动nginx服务:
+1. 在root权限下通过systemd启动nginx服务:
```
- systemctl enable nginx
- systemctl start nginx
+ # systemctl enable nginx
+ # systemctl start nginx
```
2. nginx是否启动成功可通过下面命令查看:
```
- systemctl status nginx
+ $ systemctl status nginx
```
- [图1](#zh-cn_topic_0151920971_fd25e3f1d664b4087ae26631719990a71)表示nginx服务启动成功
@@ -173,57 +176,57 @@ Packages为rpm包所在的目录,repodata为repo源元数据所在的目录,
- 若nginx服务启动失败,查看错误信息:
```
- systemctl status nginx.service --full
+ $ systemctl status nginx.service --full
```
**图 2** nginx服务启动失败

- 如[图2](#zh-cn_topic_0151920971_f1f9f3d086e454b9cba29a7cae96a4c54)所示nginx服务创建失败,是由于目录/var/spool/nginx/tmp/client\_body创建失败,手动进行创建,类似的问题也这样处理:
+ 如[图2](#zh-cn_topic_0151920971_f1f9f3d086e454b9cba29a7cae96a4c54)所示nginx服务创建失败,是由于目录/var/spool/nginx/tmp/client\_body创建失败,在root权限下手动进行创建,类似的问题也这样处理:
```
- mkdir -p /var/spool/nginx/tmp/client_body
- mkdir -p /var/spool/nginx/tmp/proxy
- mkdir -p /var/spool/nginx/tmp/fastcgi
- mkdir -p /usr/share/nginx/uwsgi_temp
- mkdir -p /usr/share/nginx/scgi_temp
+ # mkdir -p /var/spool/nginx/tmp/client_body
+ # mkdir -p /var/spool/nginx/tmp/proxy
+ # mkdir -p /var/spool/nginx/tmp/fastcgi
+ # mkdir -p /usr/share/nginx/uwsgi_temp
+ # mkdir -p /usr/share/nginx/scgi_temp
```
### repo源部署
-1. 创建nginx配置文件/etc/nginx/nginx.conf中指定的目录/srv/repo:
+1. 创建nginx配置文件/etc/nginx/nginx.conf中指定的目录/home/openEuler/srv/repo:
```
- mkdir -p /srv/repo
+ $ mkdir -p /home/openEuler/srv/repo
```
-2. SELinux设置为宽容模式:
+2. 在root权限下将SELinux设置为宽容模式:
```
- setenforce permissive
+ # setenforce permissive
```
> **说明:**
>repo server重启后,需要重新设置。
-3. 设置防火墙规则,开启nginx设置的端口(此处为80端口),通过firewall设置端口开启:
+3. 设置防火墙规则,开启nginx设置的端口(此处为80端口),在root权限下通过firewall设置端口开启:
```
- firewall-cmd --add-port=80/tcp --permanent
- firewall-cmd --reload
+ # firewall-cmd --add-port=80/tcp --permanent
+ # firewall-cmd --reload
```
- 查询80端口是否开启成功,输出为yes则表示80端口开启成功:
+ 在root权限下查询80端口是否开启成功,输出为yes则表示80端口开启成功:
```
- firewall-cmd --query-port=80/tcp
+ # firewall-cmd --query-port=80/tcp
```
- 也可通过iptables来设置80端口开启:
+ 也可在root权限下通过iptables来设置80端口开启:
```
- iptables -I INPUT -p tcp --dport 80 -j ACCEPT
+ # iptables -I INPUT -p tcp --dport 80 -j ACCEPT
```
4. nginx服务设置好之后,即可通过ip直接访问网页,如[图3](#zh-cn_topic_0151921017_fig1880404110396):
@@ -231,25 +234,25 @@ Packages为rpm包所在的目录,repodata为repo源元数据所在的目录,
**图 3** nginx部署成功

-5. 通过下面几种方式将repo源放入到/srv/repo下:
- - 拷贝镜像中相关文件至在/srv/repo下
+5. 通过下面几种方式将repo源放入到/home/openEuler/srv/repo下:
+ - 拷贝镜像中相关文件至在/home/openEuler/srv/repo下
```
- mount /home/openEuler/openEuler-20.03-LTS-aarch64-dvd.iso /mnt/
- cp -r /mnt/Packages /srv/repo/
- cp -r /mnt/repodata /srv/repo/
- cp -r /mnt/RPM-GPG-KEY-openEuler /srv/repo/
+ # mount /home/openEuler/openEuler-20.03-LTS-aarch64-dvd.iso /mnt/
+ $ cp -r /mnt/Packages /home/openEuler/srv/repo/
+ $ cp -r /mnt/repodata /home/openEuler/srv/repo/
+ $ cp -r /mnt/RPM-GPG-KEY-openEuler /home/openEuler/srv/repo/
```
openEuler-20.03-LTS-aarch64-dvd.iso存放在/home/openEuler目录下。
- - 在/srv/repo下创建repo源的软链接
+ - 在/home/openEuler/srv/repo下创建repo源的软链接
```
- ln -s /home/openEuler/os /srv/repo/os
+ $ ln -s /home/openEuler/os /home/openEuler/srv/repo/os
```
- /home/openEuler/os为已经创建好的repo源,/srv/repo/os将指向/home/openEuler/os。
+ /home/openEuler/os为已经创建好的repo源,/home/openEuler/srv/repo/os将指向/home/openEuler/os。
@@ -258,7 +261,7 @@ Packages为rpm包所在的目录,repodata为repo源元数据所在的目录,
repo可配置为yum源,yum(全称为 Yellow dog Updater, Modified)是一个Shell前端软件包管理器。基于RPM包管理,能够从指定的服务器自动下载RPM包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软体包,无须繁琐地一次次下载和安装。
### repo配置为yum源
-构建好的repo可以配置为yum源使用,在/etc/yum.repos.d/目录下创建\*\*\*.repo的配置文件(必须以.repo为扩展名),分为本地和http服务器配置yum源两种方式:
+构建好的repo可以配置为yum源使用,在/etc/yum.repos.d/目录下使用root权限创建\*\*\*.repo的配置文件(必须以.repo为扩展名),分为本地和http服务器配置yum源两种方式:
- 配置本地yum源
@@ -267,10 +270,10 @@ repo可配置为yum源,yum(全称为 Yellow dog Updater, Modified)是一
```
[base]
name=base
- baseurl=file:///srv/repo
+ baseurl=file:///home/openEuler/srv/repo
enabled=1
gpgcheck=1
- gpgkey=file:///srv/repo/RPM-GPG-KEY-openEuler
+ gpgkey=file:///home/openEuler/srv/repo/RPM-GPG-KEY-openEuler
```
> **说明:**
@@ -322,63 +325,63 @@ dnf
常用的命令如下:
-- 安装
+- 安装,需要在root权限下执行。
```
- dnf install
+ # dnf install
```
-- 升级
+- 升级,需要在root权限下执行。
```
- dnf update
+ # dnf update
```
-- 回退
+- 回退,需要在root权限下执行。
```
- dnf downgrade
+ # dnf downgrade
```
- 检查更新
```
- dnf check-update
+ $ dnf check-update
```
-- 卸载
+- 卸载,需要在root权限下执行。
```
- dnf remove
+ # dnf remove
```
- 查询
```
- dnf search
+ $ dnf search
```
-- 本地安装
+- 本地安装,需要在root权限下执行。
```
- dnf localinstall
+ # dnf localinstall
```
- 查看历史记录
```
- dnf history
+ $ dnf history
```
- 清除缓存目录
```
- dnf clean all
+ $ dnf clean all
```
- 更新缓存
```
- dnf makecache
+ $ dnf makecache
```
diff --git "a/content/zh/docs/Administration/\346\220\255\345\273\272web\346\234\215\345\212\241\345\231\250.md" "b/content/zh/docs/Administration/\346\220\255\345\273\272web\346\234\215\345\212\241\345\231\250.md"
index e0b2fe793..3ed3aa10e 100644
--- "a/content/zh/docs/Administration/\346\220\255\345\273\272web\346\234\215\345\212\241\345\231\250.md"
+++ "b/content/zh/docs/Administration/\346\220\255\345\273\272web\346\234\215\345\212\241\345\231\250.md"
@@ -33,7 +33,7 @@ openEuler系统中的web服务器版本是Apache HTTP服务器2.4版本,即htt
#### 前提条件
-- 为了能够使用Apache HTTP服务,请确保您的系统中已经安装httpd服务的rpm包。安装命令如下:
+- 为了能够使用Apache HTTP服务,请确保您的系统中已经安装httpd服务的rpm包。在root权限下执行如下命令进行安装:
```
# dnf install httpd
@@ -113,7 +113,7 @@ openEuler系统中的web服务器版本是Apache HTTP服务器2.4版本,即htt
验证httpd服务是否正在运行
```
-# systemctl is-active httpd
+$ systemctl is-active httpd
```
回显为“active”说明服务处于运行状态。
@@ -145,7 +145,7 @@ openEuler系统中的web服务器版本是Apache HTTP服务器2.4版本,即htt
-虽然默认配置可以适用于多数情况,但是用户至少需要熟悉里面的一些重要配置项。配置文件修改完成后,可以使用如下命令检查配置文件可能出现的语法错误。
+虽然默认配置可以适用于多数情况,但是用户至少需要熟悉里面的一些重要配置项。配置文件修改完成后,可以在root权限下使用如下命令检查配置文件可能出现的语法错误。
```
# apachectl configtest
@@ -173,19 +173,19 @@ httpd服务是一个模块化的应用,它和许多动态共享对象DSO(Dyn
例如,加载asis DSO模块的操作步骤如下:
-1. 在/etc/httpd/conf.modules.d/00-optional.conf文件中,取消注释如下配置行。
+1. 在/etc/httpd/conf.modules.d/00-optional.conf文件中,使用root权限取消注释如下配置行。
```
LoadModule asis_module modules/mod_asis.so
```
-2. 加载完成后,请重启httpd服务以便于重新加载配置文件。
+2. 加载完成后,请使用root权限重启httpd服务以便于重新加载配置文件。
```
# systemctl restart httpd
```
-3. 加载完成后,使用httpd -M的命令查看是否已经加载了asis DSO模块。
+3. 加载完成后,在root权限下使用httpd -M的命令查看是否已经加载了asis DSO模块。
```
# httpd -M | grep asis
@@ -200,6 +200,7 @@ httpd服务是一个模块化的应用,它和许多动态共享对象DSO(Dyn
> **说明:**
>**httpd 的常用命令**
+>
>- httpd -v : 查看httpd的版本号。
>- httpd -l:查看编译进httpd程序的静态模块。
>- httpd -M:查看已经编译进httpd程序的静态模块和已经加载的动态模块。
@@ -208,19 +209,19 @@ httpd服务是一个模块化的应用,它和许多动态共享对象DSO(Dyn
安全套接层SSL(Secure Sockets Layer)是一个允许服务端和客户端之间进行安全通信的加密协议。其中,传输层安全性协议TLS(Transport Layer Security)为网络通信提供了安全性和数据完整性保障。openEuler支持Mozilla NSS(Network Security Services)作为安全性协议TLS进行配置。加载SSL的操作步骤如下:
-1. 安装mod\_ssl的rpm包。
+1. 在root权限下安装mod\_ssl的rpm包。
```
# dnf install mod_ssl
```
-2. 安装完成后,请重启httpd服务以便于重新加载配置文件。
+2. 安装完成后,请在root权限下重启httpd服务以便于重新加载配置文件。
```
# systemctl restart httpd
```
-3. 加载完成后,使用httpd -M的命令查看是否已经加载了SSL。
+3. 加载完成后,在root权限下使用httpd -M的命令查看是否已经加载了SSL。
```
# httpd -M | grep ssl
@@ -237,7 +238,7 @@ httpd服务是一个模块化的应用,它和许多动态共享对象DSO(Dyn
Web服务器搭建完成后,可以通过如下方式验证是否搭建成功。
-1. 查看服务器的IP地址,命令如下:
+1. 在root权限下查看服务器的IP地址,命令如下:
```
# ifconfig
@@ -272,7 +273,7 @@ Web服务器搭建完成后,可以通过如下方式验证是否搭建成功
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
```
-2. 配置防火墙:
+2. 在root权限下配置防火墙:
```
# firewall-cmd --add-service=http --permanent
@@ -287,24 +288,24 @@ Web服务器搭建完成后,可以通过如下方式验证是否搭建成功
执行如下命令,查看是否可以访问网页信息,服务搭建成功时,该网页可以正常访问。
```
- curl https://192.168.1.60
+ $ curl http://192.168.1.60
```
执行如下命令,查看命令返回值是否为0,返回值为0,说明httpd服务器搭建成功。
```
- echo $?
+ $ echo $?
```
- 使用Windows系统验证
打开浏览器,在地址栏输入如下地址,如果能正常访问网页,说明httpd服务器搭建成功。
- https://_192.168.1.60_
+ https://192.168.1.60_
如果修改了端口号,输入地址格式如下:
- https://_192.168.1.60:端口号_
+ https://192.168.1.60:端口号
@@ -319,25 +320,25 @@ Nginx 是一款轻量级的 Web 服务器/反向代理服务器及电子邮件
2. 清除缓存。
```
- #dnf clean all
+ $ dnf clean all
```
3. 创建缓存。
```
- #dnf makecache
+ $ dnf makecache
```
-4. 安装nginx服务。
+4. 在root权限下安装nginx服务。
```
- #dnf install nginx
+ # dnf install nginx
```
5. 查看安装后的rpm包。
```
- dnf list all | grep nginx
+ $ dnf list all | grep nginx
```
@@ -406,7 +407,7 @@ Nginx 是一款轻量级的 Web 服务器/反向代理服务器及电子邮件
- 重新加载配置
```
- # systemctl reload httpd
+ # systemctl reload nginx
```
该命令会使运行的nginx服务重新加载它的配置文件。任何当前正在处理的请求将会被中断,从而造成客户端浏览器显示一个错误消息或者重新渲染部分页面。
@@ -422,10 +423,10 @@ Nginx 是一款轻量级的 Web 服务器/反向代理服务器及电子邮件
#### 验证服务状态
-验证httpd服务是否正在运行
+验证nginx服务是否正在运行
```
-# systemctl is-active nginx
+$ systemctl is-active nginx
```
回显为“active”说明服务处于运行状态。
@@ -457,10 +458,10 @@ Nginx 是一款轻量级的 Web 服务器/反向代理服务器及电子邮件
-虽然默认配置可以适用于多数情况,但是用户至少需要熟悉里面的一些重要配置项。配置文件修改完成后,可以使用如下命令检查配置文件可能出现的语法错误。
+虽然默认配置可以适用于多数情况,但是用户至少需要熟悉里面的一些重要配置项。配置文件修改完成后,可以在root权限下使用如下命令检查配置文件可能出现的语法错误。
```
-# /usr/sbin/nginx -t
+# nginx -t
```
如果回显信息中有“syntax is ok”,说明配置文件语法正确。
@@ -485,7 +486,7 @@ nginx服务是一个模块化的应用,它和许多动态共享对象DSO(Dyn
Web服务器搭建完成后,可以通过如下方式验证是否搭建成功。
-1. 查看服务器的IP地址,命令如下:
+1. 在root权限下查看服务器的IP地址,命令如下:
```
# ifconfig
@@ -520,7 +521,7 @@ Web服务器搭建完成后,可以通过如下方式验证是否搭建成功
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
```
-2. 配置防火墙:
+2. 在root权限下配置防火墙:
```
# firewall-cmd --add-service=http --permanent
@@ -535,23 +536,23 @@ Web服务器搭建完成后,可以通过如下方式验证是否搭建成功
执行如下命令,查看是否可以访问网页信息,服务搭建成功时,该网页可以正常访问。
```
- curl http://192.168.1.60
+ $ curl http://192.168.1.60
```
执行如下命令,查看命令返回值是否为0,返回值为0,说明nginx服务器搭建成功。
```
- echo $?
+ $ echo $?
```
- 使用Windows系统验证
打开浏览器,在地址栏输入如下地址,如果能正常访问网页,说明nginx服务器搭建成功。
- http://_192.168.1.60_
+ http://192.168.1.60_
如果修改了端口号,输入地址格式如下:
- http://_192.168.1.60:端口号_
+ http://192.168.1.60:端口号
diff --git "a/content/zh/docs/Administration/\346\220\255\345\273\272\346\225\260\346\215\256\345\272\223\346\234\215\345\212\241\345\231\250.md" "b/content/zh/docs/Administration/\346\220\255\345\273\272\346\225\260\346\215\256\345\272\223\346\234\215\345\212\241\345\231\250.md"
index fb17745d7..91a104f5c 100644
--- "a/content/zh/docs/Administration/\346\220\255\345\273\272\346\225\260\346\215\256\345\272\223\346\234\215\345\212\241\345\231\250.md"
+++ "b/content/zh/docs/Administration/\346\220\255\345\273\272\346\225\260\346\215\256\345\272\223\346\234\215\345\212\241\345\231\250.md"
@@ -112,16 +112,16 @@ PostgreSQL的架构如[图1](#fig26022387391)所示,主要进程说明如[表1
> **说明:**
>测试环境下通常会关闭防火墙以避免部分网络因素影响,视实际需求做配置。
-1. 停止防火墙。
+1. 在root权限下停止防火墙。
```
- #systemctl stop firewalld
+ # systemctl stop firewalld
```
-2. 关闭防火墙。
+2. 在root权限下关闭防火墙。
```
- #systemctl disable firewalld
+ # systemctl disable firewalld
```
> **说明:**
@@ -130,10 +130,10 @@ PostgreSQL的架构如[图1](#fig26022387391)所示,主要进程说明如[表1
#### 修改SELINUX为disabled
-1. 修改配置文件。
+1. 在root权限下修改配置文件。
```
- #sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux
+ # sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux
```
@@ -142,20 +142,20 @@ PostgreSQL的架构如[图1](#fig26022387391)所示,主要进程说明如[表1
> **说明:**
>服务器环境下,为了系统安全,通常会为进程分配单独的用户,以实现权限隔离。本章节创建的组和用户都是操作系统层面的,不是数据库层面的。
-1. 创建PostgreSQL用户(组)。
+1. 在root权限下创建PostgreSQL用户(组)。
```
- #groupadd postgres
+ # groupadd postgres
```
```
- #useradd -g postgres postgres
+ # useradd -g postgres postgres
```
-2. 设置postgres用户密码(重复输入密码)。
+2. 在root权限下设置postgres用户密码(重复输入密码)。
```
- #passwd postgres
+ # passwd postgres
```
@@ -163,34 +163,34 @@ PostgreSQL的架构如[图1](#fig26022387391)所示,主要进程说明如[表1
> **说明:**
>- 测试极限性能时,建议单独挂载IO性能更优的NVME SSD存储介质创建PostgreSQL测试实例,避免磁盘IO对性能测试结果的影响,本文以单独挂载NVME SSD为例,参考步骤1\~步骤4。
->- 非性能测试时,执行以下命令,创建数据目录即可。然后跳过本小节:
-> \#mkdir /data
+>- 非性能测试时,在root权限下执行以下命令,创建数据目录即可。然后跳过本小节:
+> \# mkdir /data
-1. 创建文件系统(以xfs为例,根据实际需求创建文件系统),若磁盘之前已做过文件系统,执行此命令会出现报错,可使用-f参数强制创建文件系统。
+1. 在root权限下创建文件系统(以xfs为例,根据实际需求创建文件系统),若磁盘之前已做过文件系统,执行此命令会出现报错,可使用-f参数强制创建文件系统。
```
- #mkfs.xfs /dev/nvme0n1
+ # mkfs.xfs /dev/nvme0n1
```
-2. 创建数据目录。
+2. 在root权限下创建数据目录。
```
- #mkdir /data
+ # mkdir /data
```
-3. 挂载磁盘。
+3. 在root权限下挂载磁盘。
```
- #mount -o noatime,nobarrier /dev/nvme0n1 /data
+ # mount -o noatime,nobarrier /dev/nvme0n1 /data
```
#### 数据目录授权
-1. 修改目录权限。
+1. 在root权限下修改目录权限。
```
- #chown -R postgres:postgres /data/
+ # chown -R postgres:postgres /data/
```
@@ -201,25 +201,25 @@ PostgreSQL的架构如[图1](#fig26022387391)所示,主要进程说明如[表1
2. 清除缓存。
```
- #dnf clean all
+ $ dnf clean all
```
3. 创建缓存。
```
- #dnf makecache
+ $ dnf makecache
```
-4. 安装PostgreSQL服务器。
+4. 在root权限下安装PostgreSQL服务器。
```
- #dnf install postgresql-server
+ # dnf install postgresql-server
```
5. 查看安装后的rpm包。
```
- #rpm -qa | grep postgresql
+ $ rpm -qa | grep postgresql
```
@@ -232,13 +232,13 @@ PostgreSQL的架构如[图1](#fig26022387391)所示,主要进程说明如[表1
1. 切换到已创建的PostgreSQL用户。
```
- #su - postgres
+ # su - postgres
```
2. 初始化数据库,其中命令中的/usr/bin是命令initdb所在的目录。
```
- $/usr/bin/initdb -D /data/
+ $ /usr/bin/initdb -D /data/
```
@@ -247,13 +247,13 @@ PostgreSQL的架构如[图1](#fig26022387391)所示,主要进程说明如[表1
1. 启动PostgreSQL数据库。
```
- $/usr/bin/pg_ctl -D /data/ -l /data/logfile start
+ $ /usr/bin/pg_ctl -D /data/ -l /data/logfile start
```
2. 确认PostgreSQL数据库进程是否正常启动。
```
- $ps -ef | grep postgres
+ $ ps -ef | grep postgres
```
命令执行后,打印信息如下图所示,PostgreSQL相关进程已经正常启动了。
@@ -266,7 +266,7 @@ PostgreSQL的架构如[图1](#fig26022387391)所示,主要进程说明如[表1
1. 登录数据库。
```
- $/usr/bin/psql -U postgres
+ $ /usr/bin/psql -U postgres
```

@@ -300,7 +300,7 @@ PostgreSQL的架构如[图1](#fig26022387391)所示,主要进程说明如[表1
1. 停止PostgreSQL数据库。
```
- $/usr/bin/pg_ctl -D /data/ -l /data/logfile stop
+ $ /usr/bin/pg_ctl -D /data/ -l /data/logfile stop
```
@@ -309,13 +309,13 @@ PostgreSQL的架构如[图1](#fig26022387391)所示,主要进程说明如[表1
1. 在postgres用户下停止数据库。
```
- $/usr/bin/pg_ctl -D /data/ -l /data/logfile stop
+ $ /usr/bin/pg_ctl -D /data/ -l /data/logfile stop
```
2. 在root用户下执行**dnf remove postgresql-server**卸载PostgreSQL数据库。
```
- #dnf remove postgresql-server
+ # dnf remove postgresql-server
```
@@ -417,7 +417,7 @@ ALTER ROLE oldrolername RENAME TO newrolename;
\#将角色名roleexample1修改为roleexapme2。
```
-# ALTER ROLE roleexample1 RENAME TO roleexample2;
+postgres=# ALTER ROLE roleexample1 RENAME TO roleexample2;
```
##### 修改用户密码
@@ -438,7 +438,7 @@ ALTER ROLE rolename PASSWORD 'password'
\#将roleexample1的密码修改为456789。
```
-# ALTER ROLE roleexample1 WITH PASSWORD '456789';
+postgres=# ALTER ROLE roleexample1 WITH PASSWORD '456789';
```
#### 删除角色
@@ -544,13 +544,13 @@ GRANT rolename1 [, ...] TO rolename2 [, ...] [ WITH ADMIN OPTION ]
\#对userexample授予数据库database1的CREATE权限。
```
-# GRANT CREATE ON DATABASE database1 TO userexample;
+postgres=# GRANT CREATE ON DATABASE database1 TO userexample;
```
\#对所有用户授予表table1的所有权限。
```
-# GRANT ALL PRIVILEGES ON TABLE table1 TO PUBLIC;
+postgres=# GRANT ALL PRIVILEGES ON TABLE table1 TO PUBLIC;
```
#### 删除用户权限
@@ -630,13 +630,13 @@ REVOKE [ ADMIN OPTION FOR ] rolename1 [, ...] FROM rolename2 [, ...] [ CASCADE |
\#对userexample授予数据库database1的CREATE权限。
```
-# GRANT CREATE ON DATABASE database1 TO userexample;
+postgres=# GRANT CREATE ON DATABASE database1 TO userexample;
```
\#对所有用户授予表table1的所有权限。
```
-# GRANT ALL PRIVILEGES ON TABLE table1 TO PUBLIC;
+postgres=# GRANT ALL PRIVILEGES ON TABLE table1 TO PUBLIC;
```
### 管理数据库
@@ -679,7 +679,7 @@ postgres=# CREATE DATABASE database1;
\#选择databaseexample数据库。
```
-# \c databaseexample;
+postgres=# \c databaseexample;
```
#### 查看数据库
@@ -695,7 +695,7 @@ postgres=# CREATE DATABASE database1;
\#查看所有数据库。
```
-# \l;
+postgres=# \l;
```
#### 删除数据库
@@ -724,7 +724,7 @@ DROP DATABASE只能由超级管理员或数据库拥有者执行。
\#删除databaseexample数据库。
```
-# DROP DATABASE databaseexample;
+postgres=# DROP DATABASE databaseexample;
```
#### 备份数据库
@@ -753,7 +753,7 @@ pg_dump [option]... [databasename] > outfile
\#备份主机为192.168.202.144,端口为3306,postgres用户下的database1数据库到db1.sql中。
```
-$ pg_dump -h 192.168.202.144 -p 3306 -U postgres -W database1 > db1.sql
+[postgres@localhost ~]$ pg_dump -h 192.168.202.144 -p 3306 -U postgres -W database1 > db1.sql
```
#### 恢复数据库
@@ -785,8 +785,8 @@ psql命令不会自动创建databasename数据库,所以在执行psql恢复数
\#将db1.sql脚本文件导入到主机为192.168.202.144,端口为3306,postgres用户下newdb数据库中。
```
-$ createdb newdb
-$ psql -h 192.168.202.144 -p 3306 -U postgres -W -d newdb < db1.sql
+[postgres@localhost ~]$ createdb newdb
+[postgres@localhost ~]$ psql -h 192.168.202.144 -p 3306 -U postgres -W -d newdb < db1.sql
```
## Mariadb服务器
@@ -826,16 +826,16 @@ MariaDB的架构如[图2](#fig13492418164520)所示。
> **说明:**
>测试环境下通常会关闭防火墙以避免部分网络因素影响,视实际需求做配置。
-1. 停止防火墙。
+1. 在root权限下停止防火墙。
```
- #systemctl stop firewalld
+ # systemctl stop firewalld
```
-2. 关闭防火墙。
+2. 在root权限下关闭防火墙。
```
- #systemctl disable firewalld
+ # systemctl disable firewalld
```
> **说明:**
@@ -844,10 +844,10 @@ MariaDB的架构如[图2](#fig13492418164520)所示。
#### 修改SELINUX为disabled
-1. 修改配置文件。
+1. 在root权限下修改配置文件。
```
- #sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux
+ # sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux
```
@@ -856,20 +856,20 @@ MariaDB的架构如[图2](#fig13492418164520)所示。
> **说明:**
>服务器环境下,为了系统安全,通常会为进程分配单独的用户,以实现权限隔离。本章节创建的组和用户都是操作系统层面的,不是数据库层面的。
-1. 创建MySQL用户(组)。
+1. 在root权限下创建MySQL用户(组)。
```
- #groupadd mysql
+ # groupadd mysql
```
```
- #useradd -g mysql mysql
+ # useradd -g mysql mysql
```
-2. 设置MySQL用户密码。
+2. 在root权限下设置MySQL用户密码。
```
- #passwd mysql
+ # passwd mysql
```
重复输入密码(根据实际需求设置密码)。
@@ -879,15 +879,15 @@ MariaDB的架构如[图2](#fig13492418164520)所示。
> **说明:**
>- 进行性能测试时,数据目录使用单独硬盘,需要对硬盘进行格式化并挂载,参考方法一或者方法二
->- 非性能测试时,执行以下命令,创建数据目录即可。然后跳过本小节:
+>- 非性能测试时,在root权限下执行以下命令,创建数据目录即可。然后跳过本小节:
> \#mkdir /data
-##### 方法一:使用fdisk进行磁盘管理
+##### 方法一:在root权限下使用fdisk进行磁盘管理
1. 创建分区(以/dev/sdb为例,根据实际情况创建)
```
- #fdisk /dev/sdb
+ # fdisk /dev/sdb
```
2. 输入n,按回车确认。
@@ -899,17 +899,17 @@ MariaDB的架构如[图2](#fig13492418164520)所示。
8. 创建文件系统(以xfs为例,根据实际需求创建文件系统)
```
- #mkfs.xfs /dev/sdb1
+ # mkfs.xfs /dev/sdb1
```
9. 挂载分区到“/data”以供操作系统使用。
```
- #mkdir /data
+ # mkdir /data
```
```
- #mount /dev/sdb1 /data
+ # mount /dev/sdb1 /data
```
10. 执行命令“vi /etc/fstab", 编辑“/etc/fstab”使重启后自动挂载数据盘。如下图中,添加最后一行内容。
@@ -919,46 +919,47 @@ MariaDB的架构如[图2](#fig13492418164520)所示。

-##### 方法二:使用LVM进行磁盘管理
+##### 方法二:在root权限下使用LVM进行磁盘管理
> **说明:**
>此步骤需要安装镜像中的lvm2相关包,步骤如下:
+>
>1. 配置本地yum源,详细信息请参考[搭建repo服务器](搭建repo服务器.html)。如果已经执行,则可跳过此步。
->2. 执行命令安装lvm2。
-> **\#yum install lvm2**
+>2. 在root权限下执行命令安装lvm2。
+> **\# yum install lvm2**
1. 创建物理卷(sdb为硬盘名称,具体名字以实际为准)。
```
- #pvcreate /dev/sdb
+ # pvcreate /dev/sdb
```
2. 创建物理卷组(其中datavg为创建的卷组名称,具体名字以实际规划为准)。
```
- #vgcreate datavg /dev/sdb
+ # vgcreate datavg /dev/sdb
```
3. 创建逻辑卷(其中600G为规划的逻辑卷大小,具体大小以实际情况为准;datalv为创建的逻辑卷的名字,具体名称以实际规划为准。\)。
```
- #lvcreate -L 600G -n datalv datavg
+ # lvcreate -L 600G -n datalv datavg
```
4. 创建文件系统。
```
- #mkfs.xfs /dev/datavg/datalv
+ # mkfs.xfs /dev/datavg/datalv
```
5. 创建数据目录并挂载。
```
- #mkdir /data
+ # mkdir /data
```
```
- #mount /dev/datavg/datalv /data
+ # mount /dev/datavg/datalv /data
```
6. 执行命令**vi /etc/fstab**,编辑“/etc/fstab”使重启后自动挂载数据盘。如下图中,添加最后一行内容。
@@ -970,13 +971,13 @@ MariaDB的架构如[图2](#fig13492418164520)所示。
#### 创建数据库目录并且授权
-1. 在已创建的数据目录 **/data** 基础上,继续创建进程所需的相关目录并授权MySQL用户(组)。
+1. 在已创建的数据目录 **/data** 基础上,使用root权限继续创建进程所需的相关目录并授权MySQL用户(组)。
```
- #mkdir -p /data/mariadb
- #cd /data/mariadb
- #mkdir data tmp run log
- #chown -R mysql:mysql /data
+ # mkdir -p /data/mariadb
+ # cd /data/mariadb
+ # mkdir data tmp run log
+ # chown -R mysql:mysql /data
```
@@ -987,40 +988,40 @@ MariaDB的架构如[图2](#fig13492418164520)所示。
2. 清除缓存。
```
- #dnf clean all
+ $ dnf clean all
```
3. 创建缓存。
```
- #dnf makecache
+ $ dnf makecache
```
-4. 安装mariadb服务器。
+4. 在root权限下安装mariadb服务器。
```
- #dnf install mariadb-server
+ # dnf install mariadb-server
```
5. 查看安装后的rpm包。
```
- #rpm -qa | grep mariadb
+ $ rpm -qa | grep mariadb
```
#### 运行
-1. 开启mariadb服务器。
+1. 在root权限下开启mariadb服务器。
```
- #systemctl start mariadb
+ # systemctl start mariadb
```
-2. 初始化数据库。
+2. 在root权限下初始化数据库。
```
- #/usr/bin/mysql_secure_installation
+ # /usr/bin/mysql_secure_installation
```
命令执行过程中需要输入数据库的root设置的密码,若没有密码则直接按“Enter”。然后根据提示及实际情况进行设置。
@@ -1028,7 +1029,7 @@ MariaDB的架构如[图2](#fig13492418164520)所示。
3. 登录数据库。
```
- # mysql -u root -p
+ $ mysql -u root -p
```
命令执行后提示输入密码。密码为[2](#li197143190587)中设置的密码。
@@ -1039,17 +1040,17 @@ MariaDB的架构如[图2](#fig13492418164520)所示。
#### 卸载
-1. 关闭数据库进程。
+1. 在root权限下关闭数据库进程。
```
- #ps -ef | grep mysql
- #kill -9 进程ID
+ $ ps -ef | grep mysql
+ # kill -9 进程ID
```
-2. 执行**dnf remove mariadb-server**命令卸载mariadb。
+2. 在root权限下执行**dnf remove mariadb-server**命令卸载mariadb。
```
- #dnf remove mariadb-server
+ # dnf remove mariadb-server
```
@@ -1344,7 +1345,7 @@ DROP SCHEMA是DROP DATABASE的同义词。
#### 备份数据库
-可以使用mysqldump命令备份数据库。
+可以在root权限下使用mysqldump命令备份数据库。
备份一个或多个表:
@@ -1413,7 +1414,7 @@ mysqldump [options] -all-databases > outputfile
#### 恢复数据库
-可以使用mysqldump命令恢复数据库。
+可以在root权限下使用mysql命令恢复数据库。
备份一个或多个表:
@@ -1456,16 +1457,16 @@ MySQL所使用的SQL语言是用于访问数据库的最常用标准化语言。
> **说明:**
>测试环境下通常会关闭防火墙以避免部分网络因素影响,视实际需求做配置。
-1. 停止防火墙。
+1. 在root权限下停止防火墙。
```
- #systemctl stop firewalld
+ # systemctl stop firewalld
```
-2. 关闭防火墙。
+2. 在root权限下关闭防火墙。
```
- #systemctl disable firewalld
+ #s ystemctl disable firewalld
```
> **说明:**
@@ -1474,10 +1475,10 @@ MySQL所使用的SQL语言是用于访问数据库的最常用标准化语言。
#### 修改SELINUX为disabled
-1. 修改配置文件。
+1. 在root权限下修改配置文件。
```
- #sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux
+ # sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux
```
@@ -1486,20 +1487,20 @@ MySQL所使用的SQL语言是用于访问数据库的最常用标准化语言。
> **说明:**
>服务器环境下,为了系统安全,通常会为进程分配单独的用户,以实现权限隔离。本章节创建的组和用户都是操作系统层面的,不是数据库层面的。
-1. 创建MySQL用户(组)。
+1. 在root权限下创建MySQL用户(组)。
```
- #groupadd mysql
+ # groupadd mysql
```
```
- #useradd -g mysql mysql
+ # useradd -g mysql mysql
```
-2. 设置MySQL用户密码。
+2. 在root权限下设置MySQL用户密码。
```
- #passwd mysql
+ # passwd mysql
```
重复输入密码(根据实际需求设置密码)。
@@ -1509,15 +1510,15 @@ MySQL所使用的SQL语言是用于访问数据库的最常用标准化语言。
> **说明:**
>- 进行性能测试时,数据目录使用单独硬盘,需要对硬盘进行格式化并挂载,参考方法一或者方法二
->- 非性能测试时,执行以下命令,创建数据目录即可。然后跳过本小节:
-> \#mkdir /data
+>- 非性能测试时,在root权限下执行以下命令,创建数据目录即可。然后跳过本小节:
+> \# mkdir /data
-##### 方法一:使用fdisk进行磁盘管理
+##### 方法一:在root权限下使用fdisk进行磁盘管理
1. 创建分区(以/dev/sdb为例,根据实际情况创建)
```
- #fdisk /dev/sdb
+ # fdisk /dev/sdb
```
2. 输入n,按回车确认。
@@ -1529,17 +1530,17 @@ MySQL所使用的SQL语言是用于访问数据库的最常用标准化语言。
8. 创建文件系统(以xfs为例,根据实际需求创建文件系统)
```
- #mkfs.xfs /dev/sdb1
+ # mkfs.xfs /dev/sdb1
```
9. 挂载分区到“/data”以供操作系统使用。
```
- #mkdir /data
+ # mkdir /data
```
```
- #mount /dev/sdb1 /data
+ # mount /dev/sdb1 /data
```
10. 执行命令“vi /etc/fstab", 编辑“/etc/fstab”使重启后自动挂载数据盘。如下图中,添加最后一行内容。
@@ -1549,7 +1550,7 @@ MySQL所使用的SQL语言是用于访问数据库的最常用标准化语言。

-##### 方法二:使用LVM进行磁盘管理
+##### 方法二:在root权限下使用LVM进行磁盘管理
> **说明:**
>此步骤需要安装镜像中的lvm2相关包,步骤如下:
@@ -1600,13 +1601,13 @@ MySQL所使用的SQL语言是用于访问数据库的最常用标准化语言。
#### 创建数据库目录并且授权
-1. 在已创建的数据目录 **/data** 基础上,继续创建进程所需的相关目录并授权MySQL用户(组)。
+1. 在已创建的数据目录 **/data** 基础上,使用root权限继续创建进程所需的相关目录并授权MySQL用户(组)。
```
- #mkdir -p /data/mysql
- #cd /data/mysql
- #mkdir data tmp run log
- #chown -R mysql:mysql /data
+ # mkdir -p /data/mysql
+ # cd /data/mysql
+ # mkdir data tmp run log
+ # chown -R mysql:mysql /data
```
@@ -1617,35 +1618,35 @@ MySQL所使用的SQL语言是用于访问数据库的最常用标准化语言。
2. 清除缓存。
```
- #dnf clean all
+ $ dnf clean all
```
3. 创建缓存。
```
- #dnf makecache
+ $ dnf makecache
```
-4. 安装MySQL服务器。
+4. 在root权限下安装MySQL服务器。
```
- #dnf install mysql
+ # dnf install mysql
```
5. 查看安装后的rpm包。
```
- #rpm -qa | grep mysql
+ $ rpm -qa | grep mysql
```
#### 运行
1. 修改配置文件。
- 1. 创建my.cnf文件,其中文件路径(包括软件安装路径basedir、数据路径datadir等)根据实际情况修改。
+ 1. 在root权限下创建my.cnf文件,其中文件路径(包括软件安装路径basedir、数据路径datadir等)根据实际情况修改。
```
- #vi /etc/my.cnf
+ # vi /etc/my.cnf
```
编辑my.cnf内容如下:
@@ -1673,7 +1674,7 @@ MySQL所使用的SQL语言是用于访问数据库的最常用标准化语言。
2. 确保my.cnf配置文件修改正确。
```
- #cat /etc/my.cnf
+ $ cat /etc/my.cnf
```

@@ -1681,35 +1682,35 @@ MySQL所使用的SQL语言是用于访问数据库的最常用标准化语言。
> **注意:**
>其中basedir为软件安装路径,请根据实际情况修改。
- 3. 修改/etc/my.cnf文件的组和用户为mysql:mysql
+ 3. 在root权限下修改/etc/my.cnf文件的组和用户为mysql:mysql
```
- #chown mysql:mysql /etc/my.cnf
+ # chown mysql:mysql /etc/my.cnf
```
2. 配置环境变量。
- 1. 安装完成后,将MySQL二进制文件路径到PATH。
+ 1. 安装完成后,在root权限下将MySQL二进制文件路径到PATH。
```
- #echo export PATH=$PATH:/usr/local/mysql/bin >> /etc/profile
+ # echo export PATH=$PATH:/usr/local/mysql/bin >> /etc/profile
```
> **注意:**
>其中PATH中的“/usr/local/mysql/bin“路径,为MySQL软件安装目录下的bin文件的绝对路径。请根据实际情况修改。
- 2. 使环境变量配置生效。
+ 2. 在root权限下使环境变量配置生效。
```
- #source /etc/profile
+ # source /etc/profile
```
-3. 初始化数据库。
+3. 在root权限下初始化数据库。
> **说明:**
>本步骤倒数第2行中有初始密码,请注意保存,登录数据库时需要使用。
```
- #mysqld --defaults-file=/etc/my.cnf --initialize
+ # mysqld --defaults-file=/etc/my.cnf --initialize
2020-03-18T03:27:13.702385Z 0 [System] [MY-013169] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.17) initializing of server in progress as process 34014
2020-03-18T03:27:24.112453Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: iNat=)#V2tZu
2020-03-18T03:27:28.576003Z 0 [System] [MY-013170] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.17) initializing of server has completed
@@ -1722,24 +1723,24 @@ MySQL所使用的SQL语言是用于访问数据库的最常用标准化语言。
> **注意:**
>如果第一次启动数据库服务,以root用户启动数据库,则启动时会提示缺少mysql.log文件而导致失败。使用mysql用户启动之后,会在/data/mysql/log目录下生成mysql.log文件,再次使用root用户启动则不会报错。
- 1. 修改文件权限。
+ 1. 在root权限下修改文件权限。
```
- #chmod 777 /usr/local/mysql/support-files/mysql.server
+ # chmod 777 /usr/local/mysql/support-files/mysql.server
```
- 2. 启动MySQL。
+ 2. 在root权限下启动MySQL。
```
- #cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
- #chkconfig mysql on
+ # cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
+ # chkconfig mysql on
```
以mysql用户启动数据库。
```
- #su - mysql
- $service mysql start
+ # su - mysql
+ $ service mysql start
```
5. 登录数据库。
@@ -1749,7 +1750,7 @@ MySQL所使用的SQL语言是用于访问数据库的最常用标准化语言。
>- 如果采用官网RPM安装方式,则mysql文件在/usr/bin目录下。登录数据库的命令根据实际情况修改。
```
- $/usr/local/mysql/bin/mysql -uroot -p -S /data/mysql/run/mysql.sock
+ $ /usr/local/mysql/bin/mysql -uroot -p -S /data/mysql/run/mysql.sock
```

@@ -1758,20 +1759,20 @@ MySQL所使用的SQL语言是用于访问数据库的最常用标准化语言。
1. 登录数据库以后,修改通过root用户登录数据库的密码。
```
- mysql>alter user 'root'@'localhost' identified by "123456";
+ mysql> alter user 'root'@'localhost' identified by "123456";
```
2. 创建全域root用户(允许root从其他服务器访问)。
```
- mysql>create user 'root'@'%' identified by '123456';
+ mysql> create user 'root'@'%' identified by '123456';
```
3. 进行授权。
```
- mysql>grant all privileges on *.* to 'root'@'%';
- mysql>flush privileges;
+ mysql> grant all privileges on *.* to 'root'@'%';
+ mysql> flush privileges;
```

@@ -1781,7 +1782,7 @@ MySQL所使用的SQL语言是用于访问数据库的最常用标准化语言。
执行 **\\q** 或者 **exit** 退出数据库。
```
- mysql>exit
+ mysql> exit
```

@@ -1789,17 +1790,17 @@ MySQL所使用的SQL语言是用于访问数据库的最常用标准化语言。
#### 卸载
-1. 关闭数据库进程。
+1. 在root权限下关闭数据库进程。
```
- #ps -ef | grep mysql
- #kill -9 进程ID
+ $ ps -ef | grep mysql
+ # kill -9 进程ID
```
-2. 执行**dnf remove mysql**命令卸载MySQL。
+2. 在root权限下执行**dnf remove mysql**命令卸载MySQL。
```
- #dnf remove mysql
+ # dnf remove mysql
```
@@ -2091,7 +2092,7 @@ DROP SCHEMA是DROP DATABASE的同义词。
#### 备份数据库
-可以使用mysqldump命令备份数据库。
+可以在root权限下使用mysqldump命令备份数据库。
备份一个或多个表:
@@ -2160,7 +2161,7 @@ mysqldump [options] -all-databases > outputfile
#### 恢复数据库
-可以使用mysqldump命令恢复数据库。
+可以在root权限下使用mysql命令恢复数据库。
备份一个或多个表:
--
Gitee
From 9da19683d285cba02f4e0bff1ef0b387adfd818a Mon Sep 17 00:00:00 2001
From: fhxing168
Date: Tue, 2 Jun 2020 17:44:27 +0800
Subject: [PATCH 12/22] Modify the root user.
---
.../ApplicationDev/building-an-rpm-package.md | 60 ++++-----
content/en/docs/ApplicationDev/preparation.md | 80 ++++++------
.../using-gcc-for-compilation.md | 118 +++++++++---------
.../using-jdk-for-compilation.md | 55 ++++----
.../using-make-for-compilation.md | 16 +--
...po\346\234\215\345\212\241\345\231\250.md" | 2 +-
...347\224\250GCC\347\274\226\350\257\221.md" | 118 +++++++++---------
...347\224\250JDK\347\274\226\350\257\221.md" | 55 ++++----
...47\224\250make\347\274\226\350\257\221.md" | 16 +--
...57\345\242\203\345\207\206\345\244\207.md" | 80 ++++++------
...346\236\204\345\273\272RPM\345\214\205.md" | 62 ++++-----
11 files changed, 328 insertions(+), 334 deletions(-)
diff --git a/content/en/docs/ApplicationDev/building-an-rpm-package.md b/content/en/docs/ApplicationDev/building-an-rpm-package.md
index 70e2262d7..5ab6079aa 100644
--- a/content/en/docs/ApplicationDev/building-an-rpm-package.md
+++ b/content/en/docs/ApplicationDev/building-an-rpm-package.md
@@ -25,13 +25,13 @@ This section describes how to build an RPM software package on a local PC or usi
During RPM packaging, the source code needs to be compiled. The compiled configuration files and binary command files need to be placed in proper positions. The RPM packages need to be tested as required. A workspace is required for these operations. The **rpmbuild** command uses a set of standard workspaces.
```
-# rpmdev-setuptree
+$ rpmdev-setuptree
```
The **rpmdev-setuptree** command is used to install rpmdevtools. After the command is executed, the **rpmbuild** folder is generated in the **/root** directory \(or the **/home/**_username_ directory for non-root users\). The directory structure is as follows:
```
-# tree rpmbuild
+$ tree rpmbuild
rpmbuild
├── BUILD
├── RPMS
@@ -388,8 +388,8 @@ The following uses the packaging process of the GNU Hello World project as an ex
Run the following command to download the source code of the official example:
```
-# cd ~/rpmbuild/SOURCES
-# wget http://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz
+$ cd ~/rpmbuild/SOURCES
+$ wget http://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz
```
#### Editing the SPEC File
@@ -397,7 +397,7 @@ Run the following command to download the source code of the official example:
Run the following command to create the .spec file:
```
-# vi hello.spec
+$ vi hello.spec
```
Write the corresponding content to the file and save the file. The following is an example of the file content. Modify the corresponding fields based on the actual requirements.
@@ -470,13 +470,13 @@ fi
Run the following command in the directory where the .spec file is located to build the source code, binary files, and software packages that contain debugging information:
```
-# rpmbuild -ba hello.spec
+$ rpmbuild -ba hello.spec
```
Run the following command to view the execution result:
```
-# tree ~/rpmbuild/*RPMS
+$ tree ~/rpmbuild/*RPMS
/home/testUser/rpmbuild/RPMS
└── aarch64
@@ -639,7 +639,7 @@ You have obtained the **root** permission, and have configured a repo source f
1. Run the following command to open the **\~/.oscrc** file:
```
- # vi ~/.oscrc
+ $ vi ~/.oscrc
```
2. Add the **user** and **pass** fields to **\~/.oscrc**. The values of _userName_ and _passWord_ are the account and password registered on the OBS website \([http://openeuler-build.huawei.com/](http://openeuler-build.huawei.com/)\).
@@ -660,7 +660,7 @@ You have obtained the **root** permission, and have configured a repo source f
1. You can copy an existing project to create a subproject of your own. For example, to copy the **zlib** software package in the **openEuler:Mainline** project to the new branch, run the following command:
```
- # osc branch openEuler:Mainline zlib
+ $ osc branch openEuler:Mainline zlib
```
If the following information is displayed, a new branch project **home:testUser:branches:openEuler:Mainline** is created for user **testUser**.
@@ -673,7 +673,7 @@ You have obtained the **root** permission, and have configured a repo source f
2. Download the configuration file \(for example, **\_service**\) of the software package to be modified to the local directory. In the preceding command, _testUser_ indicates the account name configured in the **\~/.oscrc** configuration file. Change it based on the actual requirements.
```
- # osc co home:testUser:branches:openEuler:Mainline/zlib
+ $ osc co home:testUser:branches:openEuler:Mainline/zlib
```
Information similar to the following is displayed:
@@ -687,8 +687,8 @@ You have obtained the **root** permission, and have configured a repo source f
3. Go to the local subproject directory and synchronize the remote code of the software package to the local host.
```
- # cd home:testUser:branches:openEuler:Mainline/zlib
- # osc up -S
+ $ cd home:testUser:branches:openEuler:Mainline/zlib
+ $ osc up -S
```
Information similar to the following is displayed:
@@ -709,26 +709,26 @@ You have obtained the **root** permission, and have configured a repo source f
1. Rename the source file and add the renamed source file to the temporary storage of OBS.
```
- # rm -f _service;for file in `ls | grep -v .osc`;do new_file=${file##*:};mv $file $new_file;done
- # osc addremove *
+ $ rm -f _service;for file in `ls | grep -v .osc`;do new_file=${file##*:};mv $file $new_file;done
+ $ osc addremove *
```
2. Modify the source code and .spec file, and synchronize all modifications of the corresponding software package to the OBS server. The following is a command example. The information after the **-m** parameter is the commission record.
```
- # osc ci -m "commit log"
+ $ osc ci -m "commit log"
```
3. Run the following command to obtain the repository name and architecture of the current project:
```
- # osc repos home:testUser:branches:openEuler:Mainline
+ $ osc repos home:testUser:branches:openEuler:Mainline
```
4. After the modification is committed, OBS automatically compiles the software package. You can run the following command to view the compilation logs of the corresponding repository. In the command, *standard\_aarch64* and _aarch64_ indicate the repository name and architecture obtained in the command output.
```
- # osc buildlog standard_aarch64 aarch64
+ $ osc buildlog standard_aarch64 aarch64
```
> **NOTE:**
@@ -744,22 +744,22 @@ To use the OSC tool of OBS to add a new software package, perform the following
1. Create a project based on the dependency of the new software package and a proper project. For example, to create a project based on **zlib** of the **openEuler:Mainline** project, run the following command \(**zlib** is any software package in the project\):
```
- # osc branch openEuler:Mainline zlib
+ $ osc branch openEuler:Mainline zlib
```
2. Delete unnecessary software packages added during project creation. For example, to delete the **zlib** software package, run the following command:
```
- # cd home:testUser:branches:openEuler:Mainline
- # osc rm zlib
- # osc commit -m "commit log"
+ $ cd home:testUser:branches:openEuler:Mainline
+ $ osc rm zlib
+ $ osc commit -m "commit log"
```
3. Create a software package in your own project. For example, to add the **my-first-obs-package** software package, run the following command:
```
- # mkdir my-first-obs-package
- # cd my-first-obs-package
+ $ mkdir my-first-obs-package
+ $ cd my-first-obs-package
```
@@ -769,22 +769,22 @@ To use the OSC tool of OBS to add a new software package, perform the following
2. Modify the source code and .spec file, and upload all files of the corresponding software package to the OBS server. The following is a command example. The information after the **-m** parameter is the commission record.
```
- # cd home:testUser:branches:openEuler:Mainline
- # osc add my-first-obs-package
- # osc ci -m "commit log"
+ $ cd home:testUser:branches:openEuler:Mainline
+ $ osc add my-first-obs-package
+ $ osc ci -m "commit log"
```
3. Run the following command to obtain the repository name and architecture of the current project:
```
- # osc repos home:testUser:branches:openEuler:Mainline
+ $ osc repos home:testUser:branches:openEuler:Mainline
```
4. After the modification is committed, OBS automatically compiles the software package. You can run the following command to view the compilation logs of the corresponding repository. In the command, _standard\_aarch64_ and _aarch64_ indicate the repository name and architecture obtained in the command output.
```
- # cd home:testUser:branches:openEuler:Mainline/my-first-obs-package
- # osc buildlog standard_aarch64 aarch64
+ $ cd home:testUser:branches:openEuler:Mainline/my-first-obs-package
+ $ osc buildlog standard_aarch64 aarch64
```
> **NOTE:**
@@ -796,7 +796,7 @@ To use the OSC tool of OBS to add a new software package, perform the following
After the RPM software package is built, run the following command to obtain the RPM software package using the OSC:
```
-# osc getbinaries home:testUser:branches:openEuler:Mainline my-first-obs-package standard_aarch64 aarch64
+$ osc getbinaries home:testUser:branches:openEuler:Mainline my-first-obs-package standard_aarch64 aarch64
```
The parameters in the command are described as follows. You can modify the parameters according to the actual situation.
diff --git a/content/en/docs/ApplicationDev/preparation.md b/content/en/docs/ApplicationDev/preparation.md
index 10db10bc8..826f07f00 100644
--- a/content/en/docs/ApplicationDev/preparation.md
+++ b/content/en/docs/ApplicationDev/preparation.md
@@ -130,13 +130,13 @@ You can configure a repo source by directly obtaining the repo source file or by
1. Go to the yum source directory.
```
- cd /etc/yum.repos.d
+ $ cd /etc/yum.repos.d
```
-2. Create and edit the **local.repo** file. Configure the repo source file as the yum source.
+2. Create and edit the **local.repo** file as the **root** user. Configure the repo source file as the yum source.
```
- vi local.repo
+ # vi local.repo
```
Edit the **local.repo** file as follows:
@@ -172,10 +172,10 @@ You can configure a repo source by directly obtaining the repo source file or by
6. Click **aarch64**.
7. Click **openEuler-20.03-LTS-aarch64-dvd.iso** to download the openEuler release package to the local host.
8. Click **openEuler-20.03-LTS-aarch64-dvd.iso.sha256sum** to download the openEuler verification file to the local host.
- 9. Log in to the openEuler OS and create a directory for storing the release package and verification file, for example, **/home/iso**.
+ 9. Log in to the openEuler OS and create a directory for storing the release package and verification file, for example, ~/iso**.
```
- mkdir /home/iso
+ $ mkdir ~/iso
```
10. Use a cross-platform file transfer tool \(such as WinSCP\) to upload the local openEuler release package and verification file to the target openEuler OS.
@@ -193,18 +193,18 @@ You can configure a repo source by directly obtaining the repo source file or by
6. Click **aarch64**.
7. Right-click **openEuler-20.03-LTS-aarch64-dvd.iso** and choose **Copy URL** from the shortcut menu to copy the address of the openEuler release package.
8. Right-click **openEuler-20.03-LTS-aarch64-dvd.iso.sha256sum** and choose **Copy URL** from the shortcut menu to copy the address of the openEuler verification file.
- 9. Log in to the openEuler OS, create a directory \(for example, **/home/iso**\) for storing the release package and verification file, and switch to the directory.
+ 9. Log in to the openEuler OS, create a directory \(for example, **~/iso**\) for storing the release package and verification file, and switch to the directory.
```
- mkdir /home/iso
- cd /home/iso
+ $ mkdir ~/iso
+ $ cd ~/iso
```
10. Run the **wget** command to remotely download the release package and verification file. In the command, **ipaddriso** and **ipaddrisosum** are the addresses copied in [1.g](#li62369349505) and [1.h](#li9236203405015).
```
- wget ipaddriso
- wget ipaddrisosum
+ $ wget ipaddriso
+ $ wget ipaddrisosum
```
@@ -212,13 +212,13 @@ You can configure a repo source by directly obtaining the repo source file or by
1. Obtain the verification value in the verification file.
```
- cat openEuler-20.03-LTS-aarch64-dvd.iso.sha256sum
+ $ cat openEuler-20.03-LTS-aarch64-dvd.iso.sha256sum
```
2. Calculate the SHA256 verification value of the openEuler release package.
```
- sha256sum openEuler-20.03-LTS-aarch64-dvd.iso
+ $ sha256sum openEuler-20.03-LTS-aarch64-dvd.iso
```
After the command is run, the verification value is displayed.
@@ -229,7 +229,7 @@ You can configure a repo source by directly obtaining the repo source file or by
3. Mount the ISO image file and configure it as a repo source.
- Run the **mount** command to mount the image file.
+ Run the **mount** command as the **root** user to mount the image file.
The following is an example:
@@ -286,7 +286,7 @@ Install the software required for development. The software required varies in d
1. Run the **dnf list installed | grep jdk** command to check whether the JDK software is installed.
```
- dnf list installed | grep jdk
+ $ dnf list installed | grep jdk
```
Check the command output. If the command output contains "jdk", the JDK has been installed. If no such information is displayed, the software is not installed.
@@ -294,33 +294,33 @@ Install the software required for development. The software required varies in d
2. Clear the cache.
```
- dnf clean all
+ $ dnf clean all
```
3. Create a cache.
```
- dnf makecache
+ $ dnf makecache
```
4. Query the JDK software package that can be installed.
```
- dnf search jdk | grep jdk
+ $ dnf search jdk | grep jdk
```
View the command output and install the **java-x.x.x-openjdk-devel.aarch64** software package. **x.x.x** indicates the version number.
-5. Install the JDK software package. The following uses the **java-1.8.0-openjdk-devel** software package as an example.
+5. Install the JDK software package as the **root** user. The following uses the **java-1.8.0-openjdk-devel** software package as an example.
```
- dnf install java-1.8.0-openjdk-devel.aarch64
+ # dnf install java-1.8.0-openjdk-devel.aarch64
```
6. Query information about the JDK software.
```
- java -version
+ $ java -version
```
Check the command output. If the command output contains "openjdk version "1.8.0\_232"", the JDK has been correctly installed. In the command output, **1.8.0\_232** indicates the JDK version.
@@ -331,7 +331,7 @@ Install the software required for development. The software required varies in d
1. Run the **dnf list installed | grep rpm-build** command to check whether the rpm-build software is installed.
```
- dnf list installed | grep rpm-build
+ $ dnf list installed | grep rpm-build
```
Check the command output. If the command output contains "rpm-build", the software has been installed. If no such information is displayed, the software is not installed.
@@ -339,25 +339,25 @@ Install the software required for development. The software required varies in d
2. Clear the cache.
```
- dnf clean all
+ $ dnf clean all
```
3. Create a cache.
```
- dnf makecache
+ $ dnf makecache
```
-4. Install the rpm-build package.
+4. Install the rpm-build package as the **root** user.
```
- dnf install rpm-build
+ # dnf install rpm-build
```
5. Query the rpm-build software version.
```
- rpmbuild --version
+ $ rpmbuild --version
```
@@ -384,35 +384,35 @@ Before setting JAVA\_HOME, you need to find the installation path of the JDK. Yo
Run the following command to view the Java path:
```
-# which java
+$ which java
/usr/bin/java
```
Run the following command to check the directory to which the soft link points:
```
-# ls -la /usr/bin/java
+$ ls -la /usr/bin/java
lrwxrwxrwx. 1 root root 22 Mar 6 20:28 /usr/bin/java -> /etc/alternatives/java
-# ls -la /etc/alternatives/java
+$ ls -la /etc/alternatives/java
lrwxrwxrwx. 1 root root 83 Mar 6 20:28 /etc/alternatives/java -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-1.h2.aarch64/jre/bin/java
```
The actual path is **/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-1.h2.aarch64**. Run the following command to set **JAVA\_HOME** and **PATH**:
```
-# export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-1.h2.aarch64
-# export PATH=$JAVA_HOME/bin:$PATH
+$ export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-1.h2.aarch64
+$ export PATH=$JAVA_HOME/bin:$PATH
```
### Downloading and Installing the GTK Library
-Ensure that you have the **root** permission and run the following command:
+Run the following command:
```
-# dnf list installed | grep gtk
+$ dnf list installed | grep gtk
```
-If **gtk2** or **gtk3** is displayed, the GTK library has been installed. In this case, skip this step. Otherwise, run the following command to automatically download and install the GTK library:
+If **gtk2** or **gtk3** is displayed, the GTK library has been installed. In this case, skip this step. Otherwise, run the following command as the **root** user to automatically download and install the GTK library:
```
# dnf -y install gtk2 libXtst libXrender xauth
@@ -423,13 +423,13 @@ If **gtk2** or **gtk3** is displayed, the GTK library has been installed. In
Switch to the SSHD configuration directory.
```
-# cd ~/.ssh
+$ cd ~/.ssh
```
If the directory does not exist, run the following command to create the directory and then switch to the directory:
```
-# mkdir ~/.ssh
+$ mkdir ~/.ssh
```
Edit the configuration file in the **.ssh** directory and save the file.
@@ -437,7 +437,7 @@ Edit the configuration file in the **.ssh** directory and save the file.
1. Run the **vim** command to open the configuration file.
```
- # vim config
+ $ vim config
```
2. Add the following content to the end of the file and save the file:
@@ -454,12 +454,12 @@ Edit the configuration file in the **.ssh** directory and save the file.
After the preceding environment configuration is complete, you can download and run the IntelliJ IDEA. The latest version of IntelliJ IDEA is incompatible with openEuler in some functions. You are advised to click [here](https://www.jetbrains.com/idea/download/other.html) and download the Linux package of the 2018 version. Move the downloaded package to the directory where you want to install the software and decompress the package.
```
-# tar xf ideaIC-2018.3.tar.gz
+$ tar xf ideaIC-2018.3.tar.gz
```
Decompress the package, switch to the IntelliJ IDEA directory, and run the IntelliJ IDEA.
```
-# cd ./idea-IC-183.4284.148
-# bin/idea.sh &
+$ cd ./idea-IC-183.4284.148
+$ bin/idea.sh &
```
diff --git a/content/en/docs/ApplicationDev/using-gcc-for-compilation.md b/content/en/docs/ApplicationDev/using-gcc-for-compilation.md
index eb596a947..173ff7bd2 100644
--- a/content/en/docs/ApplicationDev/using-gcc-for-compilation.md
+++ b/content/en/docs/ApplicationDev/using-gcc-for-compilation.md
@@ -238,7 +238,7 @@ There are two methods provided for compiling multiple source files.
Example: Compile **test1.c** and **test2.c** and link them to the executable file **test**.
```
- gcc test1.c test2.c -o test
+ $ gcc test1.c test2.c -o test
```
- Compile each source file, and then link the target files generated after compilation. During compilation, only modified files need to be recompiled.
@@ -246,9 +246,9 @@ There are two methods provided for compiling multiple source files.
For example, compile **test1.c** and **test2.c**, and link the target files **test1.o** and **test2.o** to the executable file **test**.
```
- gcc -c test1.c
- gcc -c test2.c
- gcc -o test1.o test2.o -o test
+ $ gcc -c test1.c
+ $ gcc -c test2.c
+ $ gcc -o test1.o test2.o -o test
```
@@ -285,14 +285,14 @@ You can use the **-shared** and **-fPIC** options to create a dynamic link l
Example 1: Generate a DLL from the source file.
```
-gcc -fPIC -shared test.c -o libtest.so
+$ gcc -fPIC -shared test.c -o libtest.so
```
Example 2: Generate a DLL from the target file.
```
-gcc -fPIC -c test.c -o test.o
-gcc -shared test.o -o libtest.so
+$ gcc -fPIC -c test.c -o test.o
+$ gcc -shared test.o -o libtest.so
```
To link a DLL to an executable file, you need to list the name of the DLL in the command line.
@@ -300,7 +300,7 @@ To link a DLL to an executable file, you need to list the name of the DLL in the
Example: Compile **main.c** and **libtest.so** into **app.out**. When **app.out** is running, the link library **libtest.so** is dynamically loaded.
```
-gcc main.c libtest.so -o app.out
+$ gcc main.c libtest.so -o app.out
```
In this mode, the **libtest.so** file in the current directory is used.
@@ -310,7 +310,7 @@ If you choose to search for a DLL, to ensure that the DLL can be linked when the
- Save the DLL to a standard directory, for example, **/usr/lib**.
- Add the DLL path **libaryDIR** to the environment variable **LD\_LIBRARY\_PATH**.
- export LD\_LIBRARY\_PATH=libraryDIR:$LD\_LIBRARY\_PATH
+ $ export LD\_LIBRARY\_PATH=libraryDIR:$LD\_LIBRARY\_PATH
> **NOTE:**
>**LD\_LIBRARY\_PATH** is an environment variable of the DLL. If the DLL is not in the default directories \(**/lib** and **/usr/lib**\), you need to specify the environment variable **LD\_LIBRARY\_PATH**.
@@ -318,8 +318,8 @@ If you choose to search for a DLL, to ensure that the DLL can be linked when the
- Add the DLL path **libaryDIR** to **/etc/ld.so.conf** and run **ldconfig**, or use the DLL path **libaryDIR** as a parameter to run **ldconfig**.
```
-gcc main.c -L libraryDIR -ltest -o app.out
-export LD_LIBRARY_PATH=libraryDIR:$LD_LIBRARY_PATH
+$ gcc main.c -L libraryDIR -ltest -o app.out
+$ export LD_LIBRARY_PATH=libraryDIR:$LD_LIBRARY_PATH
```
### Static Link Library
@@ -329,8 +329,8 @@ To create a static link library \(SLL\), you need to compile the source file to
Example: Compile and compress source files **test1.c**, **test2.c**, and **test3.c** into an SLL.
```
-gcc -c test1.c test2.c test3.c
-ar rcs libtest.a test1.o test2.o test3.o
+$ gcc -c test1.c test2.c test3.c
+$ ar rcs libtest.a test1.o test2.o test3.o
```
The **ar** command is a backup compression command. You can compress multiple files into a backup file \(also called an archive file\) or extract member files from the backup file. The most common use of **ar** is to compress the target files into an SLL.
@@ -348,7 +348,7 @@ ar rcs _Sllfilename_ _Targetfilelist_
Example: Create a main.c file to use the SLL.
```
-gcc main.c -L libraryDIR -ltest -o test.out
+$ gcc main.c -L libraryDIR -ltest -o test.out
```
In the preceding command, **libraryDIR** indicates the path of the libtest.a library.
@@ -359,16 +359,16 @@ In the preceding command, **libraryDIR** indicates the path of the libtest.a l
### Example for Using GCC to Compile C Programs
-1. Run the **cd** command to go to the code directory. The **/home/code** directory is used as an example. The command is as follows:
+1. Run the **cd** command to go to the code directory. The **~/code** directory is used as an example. The command is as follows:
```
- cd /home/code
+ $ cd ~/code
```
2. Compile the Hello World program and save it as **helloworld.c**. The following uses the Hello World program as an example. The command is as follows:
```
- vi helloworld.c
+ $ vi helloworld.c
```
Code example:
@@ -385,7 +385,7 @@ In the preceding command, **libraryDIR** indicates the path of the libtest.a l
3. Run the following command to compile the code in the code directory:
```
- gcc helloworld.c -o helloworld
+ $ gcc helloworld.c -o helloworld
```
If no error is reported, the execution is successful.
@@ -393,28 +393,26 @@ In the preceding command, **libraryDIR** indicates the path of the libtest.a l
4. After the compilation is complete, the helloworld file is generated. Check the compilation result. The following is an example:
```
- # ./helloworld
+ $ ./helloworld
Hello World!
```
### Example for Creating and Using a DLL Using GCC
-1. Run the **cd** command to go to the code directory. The **/home/code** directory is used as an example. Create the **src**, **lib**, and **include** subdirectories in the directory to store the source file, DLL file, and header file, respectively.
+1. Run the **cd** command to go to the code directory. The **~/code** directory is used as an example. Create the **src**, **lib**, and **include** subdirectories in the directory to store the source file, DLL file, and header file, respectively.
```
- cd /home/code
- mkdir src
- mkdir lib
- mkdir include
+ $ cd ~/code
+ $ mkdir src lib include
```
-
-2. Run the **cd** command to go to the **/home/code/src** directory and create two functions **add.c** and **sub.c** to implement addition and subtraction, respectively.
+
+2. Run the **cd** command to go to the **~/code/src** directory and create two functions **add.c** and **sub.c** to implement addition and subtraction, respectively.
```
- cd /home/code/src
- vi add.c
- vi sub.c
+ $ cd ~/code/src
+ $ vi add.c
+ $ vi sub.c
```
The following is an example of the **add.c** code:
@@ -437,17 +435,17 @@ In the preceding command, **libraryDIR** indicates the path of the libtest.a l
}
```
-3. Compile the source files add.c and sub.c into the DLL libmath.so, and store the DLL in the **/home/code/lib** directory.
+3. Compile the source files add.c and sub.c into the DLL libmath.so, and store the DLL in the **~/code/lib** directory.
```
- gcc -fPIC -shared add.c sub.c -o /home/code/lib/libmath.so
+ $ gcc -fPIC -shared add.c sub.c -o ~/code/lib/libmath.so
```
-4. Go to the **/home/code/include** directory, create a header file **math.h**, and declare the header file of the function.
+4. Go to the **~/code/include** directory, create a header file **math.h**, and declare the header file of the function.
```
- cd /home/code/include
- vi math.h
+ $ cd ~/code/include
+ $ vi math.h
```
The following is an example of the **math.h** code:
@@ -460,11 +458,11 @@ In the preceding command, **libraryDIR** indicates the path of the libtest.a l
#endif
```
-5. Run the **cd** command to go to the **/home/code/src** directory and create a **main.c** function that invokes add\(\) and sub\(\).
+5. Run the **cd** command to go to the **~/code/src** directory and create a **main.c** function that invokes add\(\) and sub\(\).
```
- cd /home/code/src
- vi main.c
+ $ cd ~/code/src
+ $ vi main.c
```
The following is an example of the **math.c** code:
@@ -486,19 +484,19 @@ In the preceding command, **libraryDIR** indicates the path of the libtest.a l
6. Compile **main.c** and **libmath.so** into **math.out**.
```
- gcc main.c -I /home/code/include -L /home/code/lib -lmath -o math.out
+ $ gcc main.c -I ~/code/include -L ~/code/lib -lmath -o math.out
```
7. Add the path of the DLL to the environment variable.
```
- export LD_LIBRARY_PATH=/home/code/lib:$LD_LIBRARY_PATH
+ $ export LD_LIBRARY_PATH=~/code/lib:$LD_LIBRARY_PATH
```
8. Run the following command to execute **math.out**:
```
- ./math.out
+ $ ./math.out
```
The command output is as follows:
@@ -513,21 +511,19 @@ In the preceding command, **libraryDIR** indicates the path of the libtest.a l
### Example for Creating and Using an SLL Using GCC
-1. Run the **cd** command to go to the code directory. The **/home/code** directory is used as an example. Create the **src**, **lib**, and **include** subdirectories in the directory to store the source file, SLL file, and header file respectively.
+1. Run the **cd** command to go to the code directory. The **~/code** directory is used as an example. Create the **src**, **lib**, and **include** subdirectories in the directory to store the source file, SLL file, and header file respectively.
```
- cd /home/code
- mkdir src
- mkdir lib
- mkdir include
+ $ cd ~/code
+ $ mkdir src lib include
```
-
-2. Run the **cd** command to go to the **/home/code/src** directory and create two functions **add.c** and **sub.c** to implement addition and subtraction, respectively.
+
+2. Run the **cd** command to go to the **~/code/src** directory and create two functions **add.c** and **sub.c** to implement addition and subtraction, respectively.
```
- cd /home/code/src
- vi add.c
- vi sub.c
+ $ cd ~/code/src
+ $ vi add.c
+ $ vi sub.c
```
The following is an example of the **add.c** code:
@@ -553,20 +549,20 @@ In the preceding command, **libraryDIR** indicates the path of the libtest.a l
3. Compile the source files **add.c** and **sub.c** into the target files **add.o** and **sub.o**.
```
- gcc -c add.c sub.c
+ $ gcc -c add.c sub.c
```
-4. Run the **ar** command to compress the **add.o** and **sub.o** target files into the SLL **libmath.a** and save the SLL to the **/home/code/lib** directory.
+4. Run the **ar** command to compress the **add.o** and **sub.o** target files into the SLL **libmath.a** and save the SLL to the **~/code/lib** directory.
```
- ar rcs /home/code/lib/libmath.a add.o sub.o
+ $ ar rcs ~/code/lib/libmath.a add.o sub.o
```
-5. Go to the **/home/code/include** directory, create a header file **math.h**, and declare the header file of the function.
+5. Go to the **~/code/include** directory, create a header file **math.h**, and declare the header file of the function.
```
- cd /home/code/include
- vi math.h
+ $ cd ~/code/include
+ $ vi math.h
```
The following is an example of the **math.h** code:
@@ -579,11 +575,11 @@ In the preceding command, **libraryDIR** indicates the path of the libtest.a l
#endif
```
-6. Run the **cd** command to go to the **/home/code/src** directory and create a **main.c** function that invokes add\(\) and sub\(\).
+6. Run the **cd** command to go to the **~/code/src** directory and create a **main.c** function that invokes add\(\) and sub\(\).
```
- cd /home/code/src
- vi main.c
+ $ cd ~/code/src
+ $ vi main.c
```
The following is an example of the **math.c** code:
@@ -605,13 +601,13 @@ In the preceding command, **libraryDIR** indicates the path of the libtest.a l
7. Compile **main.c** and **libmath.a** into **math.out**.
```
- gcc main.c -I /home/code/include -L /home/code/lib -lmath -o math.out
+ $ gcc main.c -I ~/code/include -L ~/code/lib -lmath -o math.out
```
8. Run the following command to execute **math.out**:
```
- ./math.out
+ $ ./math.out
```
The command output is as follows:
diff --git a/content/en/docs/ApplicationDev/using-jdk-for-compilation.md b/content/en/docs/ApplicationDev/using-jdk-for-compilation.md
index be343ae87..4946b917d 100644
--- a/content/en/docs/ApplicationDev/using-jdk-for-compilation.md
+++ b/content/en/docs/ApplicationDev/using-jdk-for-compilation.md
@@ -399,16 +399,16 @@ In Java, there are two methods to use the common classes in the package provided
### Compiling a Java Program Without a Package
-1. Run the **cd** command to go to the code directory. The **/home/code** directory is used as an example. The command is as follows:
+1. Run the **cd** command to go to the code directory. The **~/code** directory is used as an example. The command is as follows:
```
- # cd /home/code
+ $ cd ~/code
```
2. Compile the Hello World program and save it as **HelloWorld.java**. The following uses the Hello World program as an example. The command is as follows:
```
- # vi HelloWorld.java
+ $ vi HelloWorld.java
```
Code example:
@@ -424,7 +424,7 @@ In Java, there are two methods to use the common classes in the package provided
3. Run the following command to compile the code in the code directory:
```
- # javac HelloWorld.java
+ $ javac HelloWorld.java
```
If no error is reported, the execution is successful.
@@ -432,28 +432,27 @@ In Java, there are two methods to use the common classes in the package provided
4. After the compilation is complete, the HelloWorld.class file is generated. You can run the **java** command to view the result. The following is an example:
```
- # java HelloWorld
+ $ java HelloWorld
Hello World
```
### Compiling a Java Program with a Package
-1. Run the **cd** command to go to the code directory. The **/home/code** directory is used as an example. Create the **/home/code/Test/my/example**, **/home/code/Hello/world/developers**, and **/home/code/Hi/openos/openeuler** subdirectories in the directory to store source files.
+1. Run the **cd** command to go to the code directory. The **~/code** directory is used as an example. Create the **~/code/Test/my/example**, **~/code/Hello/world/developers**, and **~/code/Hi/openos/openeuler** subdirectories in the directory to store source files.
```
- cd /home/code
-
- mkdir -p Test/my/example
- mkdir -p Hello/world/developers
- mkdir -p Hi/openos/openeuler
+ $ cd ~/code
+ $ mkdir -p Test/my/example
+ $ mkdir -p Hello/world/developers
+ $ mkdir -p Hi/openos/openeuler
```
-
-2. Run the **cd** command to go to the **/home/code/Test/my/example** directory and create **Test.java**.
+
+2. Run the **cd** command to go to the **~/code/Test/my/example** directory and create **Test.java**.
```
- cd /home/code/Test/my/example
- vi Test.java
+ $ cd ~/code/Test/my/example
+ $ vi Test.java
```
The following is an example of the Test.java code:
@@ -472,11 +471,11 @@ In Java, there are two methods to use the common classes in the package provided
}
```
-3. Run the **cd** command to go to the **/home/code/Hello/world/developers** directory and create **Hello.java**.
+3. Run the **cd** command to go to the **~/code/Hello/world/developers** directory and create **Hello.java**.
```
- cd /home/code/Hello/world/developers
- vi Hello.java
+ $ cd ~/code/Hello/world/developers
+ $ vi Hello.java
```
The following is an example of the Hello.java code:
@@ -490,11 +489,11 @@ In Java, there are two methods to use the common classes in the package provided
}
```
-4. Run the **cd** command to go to the **/home/code/Hi/openos/openeuler** directory and create **Hi.java**.
+4. Run the **cd** command to go to the **~/code/Hi/openos/openeuler** directory and create **Hi.java**.
```
- cd /home/code/Hi/openos/openeuler
- vi Hi.java
+ $ cd ~/code/Hi/openos/openeuler
+ $ vi Hi.java
```
The following is an example of the Hi.java code:
@@ -508,20 +507,20 @@ In Java, there are two methods to use the common classes in the package provided
}
```
-5. Run the **cd** command to go to the **/home/code** directory and use javac to compile the source file.
+5. Run the **cd** command to go to the **~/code** directory and use javac to compile the source file.
```
- cd /home/code
- javac -classpath Hello:Hi Test/my/example/Test.java
+ $ cd ~/code
+ $ javac -classpath Hello:Hi Test/my/example/Test.java
```
- After the command is executed, the **Test.class**, **Hello.class**, and **Hi.class** files are generated in the **/home/code/Test/my/example**, **/home/code/Hello/world/developers**, and **/home/code/Hi/openos/openeuler** directories.
+ After the command is executed, the **Test.class**, **Hello.class**, and **Hi.class** files are generated in the **~/code/Test/my/example**, **~/code/Hello/world/developers**, and **~/code/Hi/openos/openeuler** directories.
-6. Run the **cd** command to go to the **/home/code** directory and run the **Test** program using Java.
+6. Run the **cd** command to go to the **~/code** directory and run the **Test** program using Java.
```
- cd /home/code
- java -classpath Test:Hello:Hi my/example/Test
+ $ cd ~/code
+ $ java -classpath Test:Hello:Hi my/example/Test
```
The command output is as follows:
diff --git a/content/en/docs/ApplicationDev/using-make-for-compilation.md b/content/en/docs/ApplicationDev/using-make-for-compilation.md
index 9c2f7dc16..199f76d06 100644
--- a/content/en/docs/ApplicationDev/using-make-for-compilation.md
+++ b/content/en/docs/ApplicationDev/using-make-for-compilation.md
@@ -277,16 +277,18 @@ A makefile file consists of the following contents:
### Example of Using Makefile to Implement Compilation
-1. Run the **cd** command to go to the code directory. The **/home/code** directory is used as an example.
+1. Run the **cd** command to go to the code directory. The **~/code** directory is used as an example.
```
- cd /home/code
+ $ cd ~/code
```
-2. Create a header file **hello.h** and two functions **hello.c** and **main.c**.
+2. Create a header file **hello.h** and two functions **hello.c** and **main.c**.
```
- cd /home/code/
+ $ vi hello.h
+ $ vi hello.c
+ $ vi main.c
```
The following is an example of the **hello.h** code:
@@ -328,7 +330,7 @@ A makefile file consists of the following contents:
3. Create the makefile.
```
- vi Makefile
+ $ vi Makefile
```
The following provides an example of the makefile content:
@@ -347,7 +349,7 @@ A makefile file consists of the following contents:
4. Run the **make** command.
```
- make
+ $ make
```
After the command is executed, the commands executed in makefile are printed. If you do not need to print the information, add the **-s** option to the **make** command.
@@ -361,7 +363,7 @@ A makefile file consists of the following contents:
5. Execute the ./main target.
```
- ./main
+ $ ./main
```
After the command is executed, the following information is displayed:
diff --git "a/content/zh/docs/Administration/\346\220\255\345\273\272repo\346\234\215\345\212\241\345\231\250.md" "b/content/zh/docs/Administration/\346\220\255\345\273\272repo\346\234\215\345\212\241\345\231\250.md"
index d46a7ee41..589f40478 100644
--- "a/content/zh/docs/Administration/\346\220\255\345\273\272repo\346\234\215\345\212\241\345\231\250.md"
+++ "b/content/zh/docs/Administration/\346\220\255\345\273\272repo\346\234\215\345\212\241\345\231\250.md"
@@ -114,7 +114,7 @@ Packages为rpm包所在的目录,repodata为repo源元数据所在的目录,
>文档中的配置内容仅供参考,请用户根据实际情况(例如安全加固需要)进行配置。
```
- user openEuler;
+ user nginx;
worker_processes auto; # 建议设置为core-1
error_log /var/log/nginx/error.log warn; # log存放位置
pid /var/run/nginx.pid;
diff --git "a/content/zh/docs/ApplicationDev/\344\275\277\347\224\250GCC\347\274\226\350\257\221.md" "b/content/zh/docs/ApplicationDev/\344\275\277\347\224\250GCC\347\274\226\350\257\221.md"
index c15b6bb20..6a987cb35 100644
--- "a/content/zh/docs/ApplicationDev/\344\275\277\347\224\250GCC\347\274\226\350\257\221.md"
+++ "b/content/zh/docs/ApplicationDev/\344\275\277\347\224\250GCC\347\274\226\350\257\221.md"
@@ -238,7 +238,7 @@ GCC是一个功能强大的编译器,其 _options_ 参数取值很多,但有
示例:将test1.c和tes2.c分别编译后链接成test可执行文件。
```
- gcc test1.c test2.c -o test
+ $ gcc test1.c test2.c -o test
```
- 分别编译各个源文件,之后对编译后输出的目标文件链接。编译时只重新编译修改的文件,未修改的文件不用重新编译。
@@ -246,9 +246,9 @@ GCC是一个功能强大的编译器,其 _options_ 参数取值很多,但有
示例:分别编译test1.c,test2.c,在将二者的目标文件test1.o,test2.o链接成test可执行文件。
```
- gcc -c test1.c
- gcc -c test2.c
- gcc -o test1.o test2.o -o test
+ $ gcc -c test1.c
+ $ gcc -c test2.c
+ $ gcc -o test1.o test2.o -o test
```
@@ -284,14 +284,14 @@ GCC是一个功能强大的编译器,其 _options_ 参数取值很多,但有
示例1:从源文件生成动态链接库。
```
-gcc -fPIC -shared test.c -o libtest.so
+$ gcc -fPIC -shared test.c -o libtest.so
```
示例2:从目标文件生成动态链接库。
```
-gcc -fPIC -c test.c -o test.o
-gcc -shared test.o -o libtest.so
+$ gcc -fPIC -c test.c -o test.o
+$ gcc -shared test.o -o libtest.so
```
将一个动态库链接到可执行文件,需要在命令行中列出动态库的名称。
@@ -299,7 +299,7 @@ gcc -shared test.o -o libtest.so
示例:将main.c和libtest.so一起编译成 app.out,当 app.out 运行时,会动态地加载链接库 libtest.so。
```
-gcc main.c libtest.so -o app.out
+$ gcc main.c libtest.so -o app.out
```
这种方式是直接指定使用当前目录下的libtest.so文件。
@@ -309,7 +309,7 @@ gcc main.c libtest.so -o app.out
- 将动态库保存在标准目录下,例如 /usr/lib。
- 把动态库所在路径libaryDIR增加到环境变量LD\_LIBRARY\_PATH中
- export LD\_LIBRARY\_PATH=libraryDIR:$LD\_LIBRARY\_PATH
+ $ export LD\_LIBRARY\_PATH=libraryDIR:$LD\_LIBRARY\_PATH
> **说明:**
>LD\_LIBRARY\_PATH为动态库的环境变量。当运行动态库时,若动态库不在缺省文件夹(/lib 和/usr/lib)下,则需要指定环境变量LD\_LIBRARY\_PATH。
@@ -317,8 +317,8 @@ gcc main.c libtest.so -o app.out
- 把动态库所在路径libaryDIR增加 /etc/ld.so.conf中然后执行ldconfig或者以动态库所在路径libaryDIR为参数执行ldconfig。
```
-gcc main.c -L libraryDIR -ltest -o app.out
-export LD_LIBRARY_PATH=libraryDIR:$LD_LIBRARY_PATH
+$ gcc main.c -L libraryDIR -ltest -o app.out
+$ export LD_LIBRARY_PATH=libraryDIR:$LD_LIBRARY_PATH
```
### 静态链接库
@@ -328,8 +328,8 @@ export LD_LIBRARY_PATH=libraryDIR:$LD_LIBRARY_PATH
示例:将源文件test1.c,test2.c,test3.c编译并打包成静态库。
```
-gcc -c test1.c test2.c test3.c
-ar rcs libtest.a test1.o test2.o test3.o
+$ gcc -c test1.c test2.c test3.c
+$ ar rcs libtest.a test1.o test2.o test3.o
```
其中ar是一个备份压缩命令,可以将多个文件打包成一个备份文件(也叫归档文件),也可以从备份文件中提取成员文件。ar最常见的用法是将目标文件打包为静态链接库。
@@ -347,7 +347,7 @@ ar rcs _Sllfilename_ _Targetfilelist_
示例:创建一个main.c文件来使用静态库
```
-gcc main.c -L libraryDIR -ltest -o test.out
+$ gcc main.c -L libraryDIR -ltest -o test.out
```
其中libraryDIR为libtest.a库的路径。
@@ -357,16 +357,16 @@ gcc main.c -L libraryDIR -ltest -o test.out
### 使用GCC编译C程序示例
-1. cd到代码目录,此处以用户“/home/code”进行举例。如下所示:
+1. cd到代码目录,此处以用户“~/code”进行举例。如下所示:
```
- cd /home/code
+ $ cd ~/code
```
2. 编写Hello World程序,保存为helloworld.c,此处以编译Hello World程序进行举例说明。示例如下:
```
- vi helloworld.c
+ $ vi helloworld.c
```
代码内容示例:
@@ -383,7 +383,7 @@ gcc main.c -L libraryDIR -ltest -o test.out
3. 在代码目录,执行编译,使用命令:
```
- gcc helloworld.c -o helloworld
+ $ gcc helloworld.c -o helloworld
```
编译执行未报错,表明执行通过。
@@ -391,28 +391,26 @@ gcc main.c -L libraryDIR -ltest -o test.out
4. 编译完成后,会生成helloworld文件,查看编译结果,示例如下:
```
- # ./helloworld
+ $ ./helloworld
Hello World!
```
### 使用GCC创建和使用动态链接库示例
-1. cd到代码目录,此处以用户“/home/code”进行举例。并在该目录下创建src,lib,include子目录,分别用于存放源文件,动态库文件和头文件。
+1. cd到代码目录,此处以用户“~/code”进行举例。并在该目录下创建src,lib,include子目录,分别用于存放源文件,动态库文件和头文件。
```
- cd /home/code
- mkdir src
- mkdir lib
- mkdir include
+ $ cd ~/code
+ $ mkdir src lib include
```
-
-2. cd到/home/code/src目录,创建2个函数add.c、sub.c,分别实现加、减。
+
+2. cd到~/code/src目录,创建2个函数add.c、sub.c,分别实现加、减。
```
- cd /home/code/src
- vi add.c
- vi sub.c
+ $ cd ~/code/src
+ $ vi add.c
+ $ vi sub.c
```
add.c代码内容示例:
@@ -435,17 +433,17 @@ gcc main.c -L libraryDIR -ltest -o test.out
}
```
-3. 将add.c、sub.c源文件创建为动态库libmath.so,并将该动态库存放在/home/code/lib目录。
+3. 将add.c、sub.c源文件创建为动态库libmath.so,并将该动态库存放在~/code/lib目录。
```
- gcc -fPIC -shared add.c sub.c -o /home/code/lib/libmath.so
+ $ gcc -fPIC -shared add.c sub.c -o ~/code/lib/libmath.so
```
-4. cd到/home/code/include目录,创建1个头文件math.h,声明函数的头文件。
+4. cd到~/code/include目录,创建1个头文件math.h,声明函数的头文件。
```
- cd /home/code/include
- vi math.h
+ $ cd ~/code/include
+ $ vi math.h
```
math.h代码内容示例:
@@ -458,11 +456,11 @@ gcc main.c -L libraryDIR -ltest -o test.out
#endif
```
-5. cd到/home/code/src目录,创建一个调用add\(\)和sub\(\)的main.c函数。
+5. cd到~/code/src目录,创建一个调用add\(\)和sub\(\)的main.c函数。
```
- cd /home/code/src
- vi main.c
+ $ cd ~/code/src
+ $ vi main.c
```
math.c代码内容示例:
@@ -484,19 +482,19 @@ gcc main.c -L libraryDIR -ltest -o test.out
6. 将main.c和libmath.so一起编译成math.out。
```
- gcc main.c -I /home/code/include -L /home/code/lib -lmath -o math.out
+ $ gcc main.c -I ~/code/include -L ~/code/lib -lmath -o math.out
```
7. 将动态链接库所在的路径加入到环境变量中。
```
- export LD_LIBRARY_PATH=/home/code/lib:$LD_LIBRARY_PATH
+ $ export LD_LIBRARY_PATH=~/code/lib:$LD_LIBRARY_PATH
```
8. 执行math.out。
```
- ./math.out
+ $ ./math.out
```
执行结果如下所示:
@@ -511,21 +509,19 @@ gcc main.c -L libraryDIR -ltest -o test.out
### 使用GCC创建和使用静态链接库示例
-1. cd到代码目录,此处以用户“/home/code”进行举例。并在该目录下创建src,lib,include子目录,分别用于存放源文件,静态库文件和头文件。
+1. cd到代码目录,此处以用户“~/code”进行举例。并在该目录下创建src,lib,include子目录,分别用于存放源文件,静态库文件和头文件。
```
- cd /home/code
- mkdir src
- mkdir lib
- mkdir include
+ $ cd ~/code
+ $ mkdir src lib include
```
-
-2. cd到/home/code/src目录,创建2个函数add.c、sub.c,分别实现加、减。
+
+2. cd到~/code/src目录,创建2个函数add.c、sub.c,分别实现加、减。
```
- cd /home/code/src
- vi add.c
- vi sub.c
+ $ cd ~/code/src
+ $ vi add.c
+ $ vi sub.c
```
add.c代码内容示例:
@@ -551,20 +547,20 @@ gcc main.c -L libraryDIR -ltest -o test.out
3. 将add.c、sub.c源文件编译为目标文件add.o、sub.o。
```
- gcc -c add.c sub.c
+ $ gcc -c add.c sub.c
```
-4. 将add.o、sub.o目标文件通过ar命令打包成静态库libmath.a,并将该动态库存放在/home/code/lib目录。
+4. 将add.o、sub.o目标文件通过ar命令打包成静态库libmath.a,并将该动态库存放在~/code/lib目录。
```
- ar rcs /home/code/lib/libmath.a add.o sub.o
+ $ ar rcs ~/code/lib/libmath.a add.o sub.o
```
-5. cd到/home/code/include目录,创建1个头文件math.h,声明函数的头文件。
+5. cd到~/code/include目录,创建1个头文件math.h,声明函数的头文件。
```
- cd /home/code/include
- vi math.h
+ $ cd ~/code/include
+ $ vi math.h
```
math.h代码内容示例:
@@ -577,11 +573,11 @@ gcc main.c -L libraryDIR -ltest -o test.out
#endif
```
-6. cd到/home/code/src目录,创建一个调用add\(\)和sub\(\)的main.c函数。
+6. cd到~/code/src目录,创建一个调用add\(\)和sub\(\)的main.c函数。
```
- cd /home/code/src
- vi main.c
+ $ cd ~/code/src
+ $ vi main.c
```
math.c代码内容示例:
@@ -603,13 +599,13 @@ gcc main.c -L libraryDIR -ltest -o test.out
7. 将main.c和libmath.a一起编译成math.out。
```
- gcc main.c -I /home/code/include -L /home/code/lib -lmath -o math.out
+ $ gcc main.c -I ~/code/include -L ~/code/lib -lmath -o math.out
```
8. 执行math.out。
```
- ./math.out
+ $ ./math.out
```
执行结果如下所示:
diff --git "a/content/zh/docs/ApplicationDev/\344\275\277\347\224\250JDK\347\274\226\350\257\221.md" "b/content/zh/docs/ApplicationDev/\344\275\277\347\224\250JDK\347\274\226\350\257\221.md"
index d08a464eb..04b393703 100644
--- "a/content/zh/docs/ApplicationDev/\344\275\277\347\224\250JDK\347\274\226\350\257\221.md"
+++ "b/content/zh/docs/ApplicationDev/\344\275\277\347\224\250JDK\347\274\226\350\257\221.md"
@@ -397,16 +397,16 @@ java类库是以包的形式实现的,包是类和接口的集合。java编译
### 编译不带包的java程序示例
-1. cd到代码目录,此处以用户“/home/code”进行举例。如下所示:
+1. cd到代码目录,此处以用户“~/code”进行举例。如下所示:
```
- # cd /home/code
+ $ cd ~/code
```
2. 编写Hello World程序,保存为HelloWorld.java,此处以编译Hello World程序进行举例说明。示例如下:
```
- # vi HelloWorld.java
+ $ vi HelloWorld.java
```
代码内容示例:
@@ -422,7 +422,7 @@ java类库是以包的形式实现的,包是类和接口的集合。java编译
3. 在代码目录,执行编译,使用命令:
```
- # javac HelloWorld.java
+ $ javac HelloWorld.java
```
编译执行未报错,表明执行通过。
@@ -430,28 +430,27 @@ java类库是以包的形式实现的,包是类和接口的集合。java编译
4. 编译完成后,会生成 HelloWorld.class 文件,通过java命令可执行查看结果,示例如下:
```
- # java HelloWorld
+ $ java HelloWorld
Hello World
```
### 编译带包的java程序示例
-1. cd到代码目录,此处以用户“/home/code”进行举例。并在该目录下创建“/home/code/Test/my/example”、“/home/code/Hello/world/developers”、“/home/code/Hi/openos/openeuler”子目录,分别用于存放源文件。
+1. cd到代码目录,此处以用户“~/code”进行举例。并在该目录下创建“~/code/Test/my/example”、“~/code/Hello/world/developers”、“~/code/Hi/openos/openeuler”子目录,分别用于存放源文件。
```
- cd /home/code
-
- mkdir -p Test/my/example
- mkdir -p Hello/world/developers
- mkdir -p Hi/openos/openeuler
+ $ cd ~/code
+ $ mkdir -p Test/my/example
+ $ mkdir -p Hello/world/developers
+ $ mkdir -p Hi/openos/openeuler
```
-
-2. cd到/home/code/Test/my/example目录,创建Test.java。
+
+2. cd到~/code/Test/my/example目录,创建Test.java。
```
- cd /home/code/Test/my/example
- vi Test.java
+ $ cd ~/code/Test/my/example
+ $ vi Test.java
```
Test.java代码内容示例:
@@ -470,11 +469,11 @@ java类库是以包的形式实现的,包是类和接口的集合。java编译
}
```
-3. cd到/home/code/Hello/world/developers目录,创建Hello.java。
+3. cd到~/code/Hello/world/developers目录,创建Hello.java。
```
- cd /home/code/Hello/world/developers
- vi Hello.java
+ $ cd ~/code/Hello/world/developers
+ $ vi Hello.java
```
Hello.java代码内容示例:
@@ -488,11 +487,11 @@ java类库是以包的形式实现的,包是类和接口的集合。java编译
}
```
-4. cd到/home/code/Hi/openos/openeuler目录,创建Hi.java。
+4. ~/code/Hi/openos/openeuler目录,创建Hi.java。
```
- cd /home/code/Hi/openos/openeuler
- vi Hi.java
+ $ cd ~/code/Hi/openos/openeuler
+ $ vi Hi.java
```
Hi.java代码内容示例:
@@ -506,20 +505,20 @@ java类库是以包的形式实现的,包是类和接口的集合。java编译
}
```
-5. cd到/home/code,使用javac编译源文件。
+5. cd到~/code,使用javac编译源文件。
```
- cd /home/code
- javac -classpath Hello:Hi Test/my/example/Test.java
+ $ cd ~/code
+ $ javac -classpath Hello:Hi Test/my/example/Test.java
```
- 执行完命令后,会在“/home/code/Test/my/example”、“/home/code/Hello/world/developers”、“/home/code/Hi/openos/openeuler”目录下分别生成Test.class、Hello.class、Hi.class文件。
+ 执行完命令后,会在“~/code/Test/my/example”、“~/code/Hello/world/developers”、“~/code/Hi/openos/openeuler”目录下分别生成Test.class、Hello.class、Hi.class文件。
-6. cd到/home/code,使用java运行Test程序。
+6. cd到~/code,使用java运行Test程序。
```
- cd /home/code
- java -classpath Test:Hello:Hi my/example/Test
+ $ cd ~/code
+ $ java -classpath Test:Hello:Hi my/example/Test
```
执行结果如下所示:
diff --git "a/content/zh/docs/ApplicationDev/\344\275\277\347\224\250make\347\274\226\350\257\221.md" "b/content/zh/docs/ApplicationDev/\344\275\277\347\224\250make\347\274\226\350\257\221.md"
index f10d9cc1e..69fbf68de 100644
--- "a/content/zh/docs/ApplicationDev/\344\275\277\347\224\250make\347\274\226\350\257\221.md"
+++ "b/content/zh/docs/ApplicationDev/\344\275\277\347\224\250make\347\274\226\350\257\221.md"
@@ -277,16 +277,18 @@ Makefile文件结构表明了输出的目标,输出目标的依赖对象和生
### 使用Makefile实现编译的示例
-1. cd到代码目录,此处以用户“/home/code”进行举例。
+1. cd到代码目录,此处以用户“~/code”进行举例。
```
- cd /home/code
+ $ cd ~/code
```
-2. 创建1个头文件hello.h和2个函数hello.c、main.c。
+2. 创建1个头文件hello.h和2个函数hello.c、main.c。
```
- cd /home/code/
+ $ vi hello.h
+ $ vi hello.c
+ $ vi main.c
```
hello.h代码内容示例:
@@ -328,7 +330,7 @@ Makefile文件结构表明了输出的目标,输出目标的依赖对象和生
3. 创建Makefile文件。
```
- vi Makefile
+ $ vi Makefile
```
Makefile文件内容示例:
@@ -347,7 +349,7 @@ Makefile文件结构表明了输出的目标,输出目标的依赖对象和生
4. 执行make命令。
```
- make
+ $ make
```
命令执行后,会打印Makefile中执行的命令。如果不需要打印该信息,可以在执行make命令是加上参数-s。
@@ -361,7 +363,7 @@ Makefile文件结构表明了输出的目标,输出目标的依赖对象和生
5. 执行./main目标。
```
- ./main
+ $ ./main
```
命令执行后,打印如下信息:
diff --git "a/content/zh/docs/ApplicationDev/\345\274\200\345\217\221\347\216\257\345\242\203\345\207\206\345\244\207.md" "b/content/zh/docs/ApplicationDev/\345\274\200\345\217\221\347\216\257\345\242\203\345\207\206\345\244\207.md"
index 4140f2ddb..c16154d6e 100644
--- "a/content/zh/docs/ApplicationDev/\345\274\200\345\217\221\347\216\257\345\242\203\345\207\206\345\244\207.md"
+++ "b/content/zh/docs/ApplicationDev/\345\274\200\345\217\221\347\216\257\345\242\203\345\207\206\345\244\207.md"
@@ -129,13 +129,13 @@ openEuler操作系统具体安装方法请参考《openEuler 20.03 LTS 安装指
1. 进入到yum源目录。
```
- cd /etc/yum.repos.d
+ $ cd /etc/yum.repos.d
```
-2. 新建local.repo文件并编辑local.repo,将repo源文件配置为yum源。
+2. 在root权限下新建local.repo文件并编辑local.repo,将repo源文件配置为yum源。
```
- vi local.repo
+ # vi local.repo
```
编辑local.repo文件的内容如下:
@@ -171,10 +171,10 @@ openEuler操作系统具体安装方法请参考《openEuler 20.03 LTS 安装指
6. 单击“aarch64”。
7. 单击“openEuler-20.03-LTS-aarch64-dvd.iso”,将openEuler发布包下载到本地。
8. 单击“openEuler-20.03-LTS-aarch64-dvd.iso.sha256sum”,将openEuler校验文件下载到本地。
- 9. 登录openEuler操作系统,新建用于存放发布包和检验文件的目录,如“/home/iso”。
+ 9. 登录openEuler操作系统,新建用于存放发布包和检验文件的目录,如“~/iso”。
```
- mkdir /home/iso
+ $ mkdir ~/iso
```
10. 使用跨平台文件传输工具(如WinSCP)将本地的openEuler发布包和校验文件上传到openEuler操作系统。
@@ -192,18 +192,18 @@ openEuler操作系统具体安装方法请参考《openEuler 20.03 LTS 安装指
6. 单击“aarch64”。
7. 右键单击“openEuler-20.03-LTS-aarch64-dvd.iso”,单击“复制链接地址”,将openEuler发布包地址记录好。
8. 右键单击“openEuler-20.03-LTS-aarch64-dvd.iso.sha256sum”,单击“复制链接地址”,将openEuler校验文件地址记录好。
- 9. 登录openEuler操作系统,新建用于存放发布包和检验文件的目录,如“/home/iso”,并切换到该目录。
+ 9. 登录openEuler操作系统,新建用于存放发布包和检验文件的目录,如“~/iso”,并切换到该目录。
```
- mkdir /home/iso
- cd /home/iso
+ $ mkdir ~/iso
+ $ cd ~/iso
```
10. 使用**wget**命令远程下载发布包和检验文件,命令中的 _ipaddriso_ 和 _ipaddrisosum_ 分别为[1.g](#li62369349505)和[1.h](#li9236203405015)中记录的地址。
```
- wget ipaddriso
- wget ipaddrisosum
+ $ wget ipaddriso
+ $ wget ipaddrisosum
```
@@ -211,13 +211,13 @@ openEuler操作系统具体安装方法请参考《openEuler 20.03 LTS 安装指
1. 获取校验文件中的校验值。
```
- cat openEuler-20.03-LTS-aarch64-dvd.iso.sha256sum
+ $ cat openEuler-20.03-LTS-aarch64-dvd.iso.sha256sum
```
2. 计算openEuler发布包的sha256校验值。
```
- sha256sum openEuler-20.03-LTS-aarch64-dvd.iso
+ $ sha256sum openEuler-20.03-LTS-aarch64-dvd.iso
```
命令执行完成后,输出校验值。
@@ -228,7 +228,7 @@ openEuler操作系统具体安装方法请参考《openEuler 20.03 LTS 安装指
3. 挂载ISO并配置为repo源。
- 使用mount命令挂载镜像文件。
+ 在root权限下使用mount命令挂载镜像文件。
示例如下:
@@ -284,7 +284,7 @@ openEuler操作系统具体安装方法请参考《openEuler 20.03 LTS 安装指
1. 执行**dnf list installed | grep jdk** 查询JDK软件是否已安装。
```
- dnf list installed | grep jdk
+ $ dnf list installed | grep jdk
```
查看命令打印信息,若打印信息中包含“jdk”,表示该软件已经安装了,则不需要再安装。若无任何打印信息,则表示该软件未安装。
@@ -292,33 +292,33 @@ openEuler操作系统具体安装方法请参考《openEuler 20.03 LTS 安装指
2. 清除缓存。
```
- dnf clean all
+ $ dnf clean all
```
3. 创建缓存。
```
- dnf makecache
+ $ dnf makecache
```
4. 查询可安装的JDK软件包。
```
- dnf search jdk | grep jdk
+ $ dnf search jdk | grep jdk
```
查看命令打印信息,选择安装java-x.x.x-openjdk-devel.aarch64软件包。其中x.x.x为版本号。
-5. 安装JDK软件包,以安装java-1.8.0-openjdk-devel软件包为例。
+5. 在root权限下安装JDK软件包,以安装java-1.8.0-openjdk-devel软件包为例。
```
- dnf install java-1.8.0-openjdk-devel.aarch64
+ # dnf install java-1.8.0-openjdk-devel.aarch64
```
6. 查询JDK软件版本。
```
- java -version
+ $ java -version
```
查看打印信息,若打印信息中包括“openjdk version "1.8.0\_232"”信息,表示已正确安装,其中1.8.0\_232为版本号。
@@ -329,7 +329,7 @@ openEuler操作系统具体安装方法请参考《openEuler 20.03 LTS 安装指
1. 执行**dnf list installed | grep rpm-build** 查询rpm-build软件是否已安装。
```
- dnf list installed | grep rpm-build
+ $ dnf list installed | grep rpm-build
```
查看命令打印信息,若打印信息中包含“rpm-build”,表示该软件已经安装了,则不需要再安装。若无任何打印信息,则表示该软件未安装。
@@ -337,25 +337,25 @@ openEuler操作系统具体安装方法请参考《openEuler 20.03 LTS 安装指
2. 清除缓存。
```
- dnf clean all
+ $ dnf clean all
```
3. 创建缓存。
```
- dnf makecache
+ $ dnf makecache
```
-4. 安装rpm-build软件包。
+4. 在root权限下安装rpm-build软件包。
```
- dnf install rpm-build
+ # dnf install rpm-build
```
5. 查询rpm-build软件版本。
```
- rpmbuild --version
+ $ rpmbuild --version
```
@@ -382,35 +382,35 @@ MobaXterm是一款非常优秀的SSH客户端,其自带X Server,可以轻松
查看java路径,命令如下:
```
-# which java
+$ which java
/usr/bin/java
```
查看软链接的实际指向目录,命令如下:
```
-# ls -la /usr/bin/java
+$ ls -la /usr/bin/java
lrwxrwxrwx. 1 root root 22 Mar 6 20:28 /usr/bin/java -> /etc/alternatives/java
-# ls -la /etc/alternatives/java
+$ ls -la /etc/alternatives/java
lrwxrwxrwx. 1 root root 83 Mar 6 20:28 /etc/alternatives/java -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-1.h2.aarch64/jre/bin/java
```
发现JDK的真实路径为/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-1.h2.aarch64,设置JAVA\_HOME和PATH,命令如下:
```
-# export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-1.h2.aarch64
-# export PATH=$JAVA_HOME/bin:$PATH
+$ export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-1.h2.aarch64
+$ export PATH=$JAVA_HOME/bin:$PATH
```
### 下载安装GTK库
-请确认您具有root权限后,运行如下命令:
+运行如下命令:
```
-# dnf list installed | grep gtk
+$ dnf list installed | grep gtk
```
-如果显示gtk2或者gtk3,则表示您已安装该库,可以直接跳过进入下一步,否则运行如下命令自动下载安装gtk库。
+如果显示gtk2或者gtk3,则表示您已安装该库,可以直接跳过进入下一步,否则在root权限西下运行如下命令自动下载安装gtk库。
```
# dnf -y install gtk2 libXtst libXrender xauth
@@ -421,13 +421,13 @@ lrwxrwxrwx. 1 root root 83 Mar 6 20:28 /etc/alternatives/java -> /usr/lib/jvm/j
切换到sshd配置目录
```
-# cd ~/.ssh
+$ cd ~/.ssh
```
如果该目录不存在,则创建目录后再进行切换,创建目录命令如下:
```
-# mkdir ~/.ssh
+$ mkdir ~/.ssh
```
然后在.ssh目录下编辑config文件并保存:
@@ -435,7 +435,7 @@ lrwxrwxrwx. 1 root root 83 Mar 6 20:28 /etc/alternatives/java -> /usr/lib/jvm/j
1. 使用vim打卡config文件
```
- # vim config
+ $ vim config
```
2. 将以下内容添加到文件末尾并保存:
@@ -452,12 +452,12 @@ lrwxrwxrwx. 1 root root 83 Mar 6 20:28 /etc/alternatives/java -> /usr/lib/jvm/j
在执行如上环境配置后,您就可以下载使用IntelliJ IDEA了。鉴于最新版的IntelliJ IDEA和openEuler系统在部分功能上有兼容性问题,建议您从此[链接](https://www.jetbrains.com/idea/download/other.html)下载2018版本linux压缩包。下载好后把压缩包移到您想要安装该软件的目录,对压缩包进行解压:
```
-# tar xf ideaIC-2018.3.tar.gz
+$ tar xf ideaIC-2018.3.tar.gz
```
解压后切换到IntelliJ IDEA的目录下并运行。
```
-# cd ./idea-IC-183.4284.148
-# bin/idea.sh &
+$ cd ./idea-IC-183.4284.148
+$ bin/idea.sh &
```
diff --git "a/content/zh/docs/ApplicationDev/\346\236\204\345\273\272RPM\345\214\205.md" "b/content/zh/docs/ApplicationDev/\346\236\204\345\273\272RPM\345\214\205.md"
index 29f36c617..e77dab84c 100644
--- "a/content/zh/docs/ApplicationDev/\346\236\204\345\273\272RPM\345\214\205.md"
+++ "b/content/zh/docs/ApplicationDev/\346\236\204\345\273\272RPM\345\214\205.md"
@@ -24,13 +24,13 @@
RPM打包的时候需要编译源码,需要把编译好的配置文件、二进制命令文件等放到合适的位置,还要根据需要对RPM的包进行测试,这些都需要先有一个“工作空间”。rpmbuild命令使用一套标准化的“工作空间”:
```
-# rpmdev-setuptree
+$ rpmdev-setuptree
```
rpmdev-setuptree这个命令就是安装 rpmdevtools 带来的。可以看到运行了这个命令之后,在“/root“目录(非root用户为“/home/用户名“目录)下多了一个 rpmbuild 的文件夹,目录结构如下:
```
-# tree rpmbuild
+$ tree rpmbuild
rpmbuild
├── BUILD
├── RPMS
@@ -378,7 +378,7 @@ rpmbuild命令格式为:rpmbuild \[_option_...\]
### 创建Hello World RPM包
-这里以GNU“Hello World” 项目的打包过程作为示例,包含了典型的FOSS(Free and Open Source Software) 软件项目相关的最常用的外围组件,其中包括配置/编译/安装环境、文档、国际化等等。
+这里以GNU “Hello World” 项目的打包过程作为示例,包含了典型的FOSS(Free and Open Source Software) 软件项目相关的最常用的外围组件,其中包括配置/编译/安装环境、文档、国际化等等。
#### 下载源码
@@ -386,8 +386,8 @@ rpmbuild命令格式为:rpmbuild \[_option_...\]
我们直接下载官方例子的源码,使用如下命令:
```
-# cd ~/rpmbuild/SOURCES
-# wget http://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz
+$ cd ~/rpmbuild/SOURCES
+$ wget http://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz
```
#### 编辑SPEC文件
@@ -395,7 +395,7 @@ rpmbuild命令格式为:rpmbuild \[_option_...\]
新建spec文件,参考命令如下:
```
-# vi hello.spec
+$ vi hello.spec
```
在文件中写入对应内容后保存文件。文件内容示例如下,请根据实际情况修改相应字段。
@@ -468,13 +468,13 @@ fi
构建源码、二进制和包含调试信息的软件包,在spec文件所在目录执行如下命令:
```
-# rpmbuild -ba hello.spec
+$ rpmbuild -ba hello.spec
```
执行成功后,查看结果,使用如下命令:
```
-# tree ~/rpmbuild/*RPMS
+$ tree ~/rpmbuild/*RPMS
/home/testUser/rpmbuild/RPMS
└── aarch64
@@ -636,7 +636,7 @@ RPM软件包构建完成后,通过网页端获取对应RPM软件包的方法
1. 打开\~/.oscrc,命令如下:
```
- # vi ~/.oscrc
+ $ vi ~/.oscrc
```
2. 在\~/.oscrc中添加user和pass字段,如下所示,它们的取值 _userName_ 和 _passWord_ 分别是用户在OBS网页([http://openeuler-build.huawei.com/](http://openeuler-build.huawei.com/))上已经注册的账号和密码。
@@ -657,7 +657,7 @@ RPM软件包构建完成后,通过网页端获取对应RPM软件包的方法
1. 通过拷贝已有工程,创建属于用户自己的子工程。例如将openEuler:Mainline工程下的zlib软件包到新分支,参考命令如下:
```
- # osc branch openEuler:Mainline zlib
+ $ osc branch openEuler:Mainline zlib
```
回显如下所示,说明在用户testUser下创建了新的分支工程home:testUser:branches:openEuler:Mainline。
@@ -670,7 +670,7 @@ RPM软件包构建完成后,通过网页端获取对应RPM软件包的方法
2. 将需要修改软件包的相关配置文件(例如\_service)下载到本地当前路径。其中 _testUser_ 为\~/.oscrc配置文件中配置的账户名称,请根据实际情况修改。
```
- # osc co home:testUser:branches:openEuler:Mainline/zlib
+ $ osc co home:testUser:branches:openEuler:Mainline/zlib
```
回显如下所示:
@@ -684,8 +684,8 @@ RPM软件包构建完成后,通过网页端获取对应RPM软件包的方法
3. 进入本地子工程目录,并将软件包远程代码同步到本地。
```
- # cd home:testUser:branches:openEuler:Mainline/zlib
- # osc up -S
+ $ cd home:testUser:branches:openEuler:Mainline/zlib
+ $ osc up -S
```
回显如下所示:
@@ -706,26 +706,26 @@ RPM软件包构建完成后,通过网页端获取对应RPM软件包的方法
1. 重命名源文件,然后将重命名后的源文件添加到OBS暂存中。
```
- # rm -f _service;for file in `ls | grep -v .osc`;do new_file=${file##*:};mv $file $new_file;done
- # osc addremove *
+ $ rm -f _service;for file in `ls | grep -v .osc`;do new_file=${file##*:};mv $file $new_file;done
+ $ osc addremove *
```
2. 修改源代码和spec文件,并将对应软件包的所有修改同步到OBS服务器。参考命令如下,-m参数后的信息为提交记录。
```
- # osc ci -m "commit log"
+ $ osc ci -m "commit log"
```
3. 获取当前工程的仓库名称和架构,参考命令如下:
```
- # osc repos home:testUser:branches:openEuler:Mainline
+ $ osc repos home:testUser:branches:openEuler:Mainline
```
4. 修改提交成功后,OBS会自动开始编译软件包。可以通过如下命令,查看对应仓库的编译日志,其中 _standard_aarch64_ 、 _aarch64_ 分别为查询所得仓库名称和架构。
```
- # osc buildlog standard_aarch64 aarch64
+ $ osc buildlog standard_aarch64 aarch64
```
> **说明:**
@@ -741,22 +741,22 @@ RPM软件包构建完成后,通过网页端获取对应RPM软件包的方法
1. 根据新增软件包的依赖情况,基于合适的工程,创建属于用户自己的个人工程。例如基于 _openEuler:Mainline_ 工程的 zlib 创建工程的参考命令如下,zlib 为工程下的任一软件包。
```
- # osc branch openEuler:Mainline zlib
+ $ osc branch openEuler:Mainline zlib
```
2. 删除创建工程时新增的无用软件包。例如删除zlib软件包的参考命令如下:
```
- # cd home:testUser:branches:openEuler:Mainline
- # osc rm zlib
- # osc commit -m "commit log"
+ $ cd home:testUser:branches:openEuler:Mainline
+ $ osc rm zlib
+ $ osc commit -m "commit log"
```
3. 在个人工程下创建新增的软件包。例如新增软件包 my-first-obs-package命令如下:
```
- # mkdir my-first-obs-package
- # cd my-first-obs-package
+ $ mkdir my-first-obs-package
+ $ cd my-first-obs-package
```
@@ -766,22 +766,22 @@ RPM软件包构建完成后,通过网页端获取对应RPM软件包的方法
2. 修改源代码和spec文件,并将对应软件包的所有文件上传到OBS服务器。参考命令如下,-m 参数后的信息为提交记录。
```
- # cd home:testUser:branches:openEuler:Mainline
- # osc add my-first-obs-package
- # osc ci -m "commit log"
+ $ cd home:testUser:branches:openEuler:Mainline
+ $ osc add my-first-obs-package
+ $ osc ci -m "commit log"
```
3. 获取当前工程的仓库名称和架构,参考命令如下:
```
- # osc repos home:testUser:branches:openEuler:Mainline
+ $ osc repos home:testUser:branches:openEuler:Mainline
```
4. 修改提交成功后,OBS会自动开始编译软件包。可以通过如下命令,查看对应仓库的编译日志,其中 _standard_aarch64_ 、 _aarch64_ 分别为查询所得仓库名称和架构。
```
- # cd home:testUser:branches:openEuler:Mainline/my-first-obs-package
- # osc buildlog standard_aarch64 aarch64
+ $ cd home:testUser:branches:openEuler:Mainline/my-first-obs-package
+ $ osc buildlog standard_aarch64 aarch64
```
> **说明:**
@@ -793,7 +793,7 @@ RPM软件包构建完成后,通过网页端获取对应RPM软件包的方法
RPM软件包构建完成后,使用osc获取对应RPM软件包的命令如下:
```
-# osc getbinaries home:testUser:branches:openEuler:Mainline my-first-obs-package standard_aarch64 aarch64
+$ osc getbinaries home:testUser:branches:openEuler:Mainline my-first-obs-package standard_aarch64 aarch64
```
命令中的各参数含义如下,请用户根据实际情况修改:
--
Gitee
From a84701d6efb8c6a276634e727ecfa7e0ff102540 Mon Sep 17 00:00:00 2001
From: fhxing168
Date: Fri, 5 Jun 2020 16:15:09 +0800
Subject: [PATCH 13/22] Slove issues.
---
.../configuring-the-repo-server.md | 63 +-
.../configuring-the-web-server.md | 10 +-
.../en/docs/Administration/user-management.md | 135 ++++-
.../ApplicationDev/building-an-rpm-package.md | 8 +-
...po\346\234\215\345\212\241\345\231\250.md" | 60 +-
...eb\346\234\215\345\212\241\345\231\250.md" | 6 +-
...14\347\224\250\346\210\267\347\273\204.md" | 554 ++++++++++--------
...346\236\204\345\273\272RPM\345\214\205.md" | 8 +-
8 files changed, 505 insertions(+), 339 deletions(-)
rename "content/zh/docs/Administration/\347\256\241\347\220\206\347\224\250\346\210\267.md" => "content/zh/docs/Administration/\347\256\241\347\220\206\347\224\250\346\210\267\345\222\214\347\224\250\346\210\267\347\273\204.md" (72%)
diff --git a/content/en/docs/Administration/configuring-the-repo-server.md b/content/en/docs/Administration/configuring-the-repo-server.md
index 72a12fc16..4fa5736ab 100644
--- a/content/en/docs/Administration/configuring-the-repo-server.md
+++ b/content/en/docs/Administration/configuring-the-repo-server.md
@@ -95,13 +95,14 @@ You can update the repo source in either of the following ways:
- Add rpm packages to the Packages directory of the repo source and update the repo source. You can run the createrepo command to update the repo source.
```
- $ createrepo --update --workers=10 /srv/repo
+ $ createrepo --update --workers=10 ~/srv/repo
```
+
In this command, \-\-update indicates the update, and \-\-workers indicates the number of threads, which can be customized.
> **NOTE:**
- >If the command output contains "createrepo: command not found", run the **dnf install createrepo** command as the **root** user to install the **createrepo** softeware.
+>If the command output contains "createrepo: command not found", run the **dnf install createrepo** command as the **root** user to install the **createrepo** softeware.
## Deploying the Remote Repo Source
@@ -119,7 +120,7 @@ Install openEuler OS and deploy the repo source using Nginx on openEuler OS.
>The configuration content in this document is for reference only. You can configure the content based on the site requirements \(for example, security hardening requirements\).
```
- user openEuler;
+ user nginx;
worker_processes auto; # You are advised to set this parameter to core-1.
error_log /var/log/nginx/error.log warn; # log storage location
pid /var/run/nginx.pid;
@@ -142,12 +143,12 @@ Install openEuler OS and deploy the repo source using Nginx on openEuler OS.
server {
listen 80;
- server_name localhost; #Server name (URL)
+ server_name localhost; #Server name (URL)
client_max_body_size 4G;
- root /home/openEuler/srv/repo; #Default service directory
+ root /usr/share/nginx/repo; #Default service directory
location / {
- autoindex on; # Enable the access to lower-layer files in the directory.
+ autoindex on; # Enable the access to lower-layer files in the directory.
autoindex_exact_size on;
autoindex_localtime on;
}
@@ -173,19 +174,19 @@ Install openEuler OS and deploy the repo source using Nginx on openEuler OS.
$ systemctl status nginx
```
- - [Figure 1](#en-us_topic_0151920971_fd25e3f1d664b4087ae26631719990a71) indicates that the Nginx service is started successfully.
+ - [Figure 1](#en-us_topic_0151920971_fd25e3f1d664b4087ae26631719990a71) indicates that the Nginx service is started successfully.
- **Figure 1** The Nginx service is successfully started.
- 
+ **Figure 1** The Nginx service is successfully started.
+ 
- - If the Nginx service fails to be started, view the error information.
+ - If the Nginx service fails to be started, view the error information.
```
$ systemctl status nginx.service --full
```
- **Figure 2** Nginx startup failure
- 
+ **Figure 2** Nginx startup failure
+ 
As shown in [Figure 2](#en-us_topic_0151920971_f1f9f3d086e454b9cba29a7cae96a4c54), the Nginx service fails to be created because the /var/spool/nginx/tmp/client\_body directory fails to be created. You need to manually create the directory as the **root** user. Similar problems are solved as follows:
@@ -200,21 +201,18 @@ Install openEuler OS and deploy the repo source using Nginx on openEuler OS.
### Deploying the Repo Source
-1. Run the following command to create the /home/openEuler/srv/repo directory specified in the Nginx configuration file /etc/nginx/nginx.conf:
+1. Run the following command as the **root** user to create the /usr/share/nginx/repo directory specified in the Nginx configuration file /etc/nginx/nginx.conf:
```
- $ mkdir -p /home/openEuler/srv/repo
+ # mkdir -p /usr/share/nginx/repo
```
-2. Set the SELinux working mode to the permissive mode as the **root** user:
+2. Run the followding command as the **root** user to modify the /usr/share/nginx/repo directory permission:
```
- # setenforce permissive
+ # chmod -R 755 /usr/share/nginx/repo
```
- > **NOTE:**
- >After the repo server is restarted, you need to configure the repo server again.
-
3. Configure firewall rules as the **root** user to enable the port \(port 80\) configured for Nginx.
```
@@ -239,25 +237,26 @@ Install openEuler OS and deploy the repo source using Nginx on openEuler OS.
**Figure 3** Nginx deployment succeeded

-5. Use either of the following methods to add the repo source to the /home/openEuler/srv/repo directory:
- - Copy related files in the image to the /home/openEuler/srv/repo directory.
+5. Use either of the following methods to add the repo source to the /usr/share/nginx/repo directory:
+ - Copy related files in the image to the /usr/share/nginx/repo directory as the **root** user.
```
# mount /home/openEuler/openEuler-20.03-LTS-aarch64-dvd.iso /mnt/
- $ cp -r /mnt/Packages /home/openEuler/srv/repo/
- $ cp -r /mnt/repodata /home/openEuler/srv/repo/
- $ cp -r /mnt/RPM-GPG-KEY-openEuler /home/openEuler/srv/repo/
+ # cp -r /mnt/Packages /usr/share/nginx/repo/
+ # cp -r /mnt/repodata /usr/share/nginx/repo/
+ # cp -r /mnt/RPM-GPG-KEY-openEuler /usr/share/nginx/repo/
+ # chmod -R 755 /usr/share/nginx/repo
```
The **openEuler-20.03-LTS-aarch64-dvd.iso** file is stored in the **/home/openEuler** directory.
- - Create a soft link for the repo source in the /home/openEuler/srv/repo directory.
+ - Create a soft link for the repo source in the /usr/share/nginx/repo directory as the **root** user.
```
- $ ln -s /home/openEuler/os /home/openEuler/srv/repo/os
+ # ln -s /mnt /usr/share/nginx/repo/os
```
- /home/openEuler/os is the created repo source, and /home/openEuler/srv/repo/os points to /home/openEuler/os.
+ /mnt is the created repo source, and /usr/share/nginx/repo/os points to /mnt.
@@ -294,14 +293,14 @@ You can configure the built repo as the yum source and create the \*\*\*.repo co
```
[base]
name=base
- baseurl=http://192.168.1.2/
+ baseurl=http://192.168.139.209/
enabled=1
gpgcheck=1
- gpgkey=http://192.168.1.2/RPM-GPG-KEY-openEuler
+ gpgkey=http://192.168.139.209/RPM-GPG-KEY-openEuler
```
> **NOTE:**
- >192.168.1.2 is an example. Replace it with the actual IP address.
+ >192.168.139.209 is an example. Replace it with the actual IP address.
### repo Priority
@@ -311,11 +310,11 @@ If there are multiple repo sources, you can set the repo priority in the .repo f
```
[base]
name=base
-baseurl=http://192.168.1.2/
+baseurl=http://192.168.139.209/
enabled=1
priority=2
gpgcheck=1
-gpgkey=http://192.168.1.2/RPM-GPG-KEY-openEuler
+gpgkey=http://192.168.139.209/RPM-GPG-KEY-openEuler
```
> **NOTE:**
diff --git a/content/en/docs/Administration/configuring-the-web-server.md b/content/en/docs/Administration/configuring-the-web-server.md
index e4e375aa1..0903e98c2 100644
--- a/content/en/docs/Administration/configuring-the-web-server.md
+++ b/content/en/docs/Administration/configuring-the-web-server.md
@@ -282,7 +282,7 @@ After the web server is set up, perform the following operations to check whethe
Run the following command to check whether the web page can be accessed. If the service is successfully set up, the web page can be accessed.
```
- $ curl https://192.168.1.60
+ $ curl http://192.168.1.60
```
Run the following command to check whether the command output is 0. If the command output is 0, the httpd server is successfully set up.
@@ -295,11 +295,11 @@ After the web server is set up, perform the following operations to check whethe
Open the browser and enter the following address in the address box. If the web page can be accessed, the httpd server is successfully set up.
- https://192.168.1.60_
+ http://192.168.1.60
If the port number is changed, enter the address in the following format:
- https://192.168.1.60: port number_
+ http://192.168.1.60: port number
@@ -538,8 +538,8 @@ After the web server is set up, perform the following operations to check whethe
Open the browser and enter the following address in the address box. If the web page can be accessed, the Nginx server is successfully set up.
- http://192.168.1.60_
+ http://192.168.1.60
If the port number is changed, enter the address in the following format:
- http://192.168.1.60: port number_
+ http://192.168.1.60: port number
diff --git a/content/en/docs/Administration/user-management.md b/content/en/docs/Administration/user-management.md
index ebf819d90..75285b653 100644
--- a/content/en/docs/Administration/user-management.md
+++ b/content/en/docs/Administration/user-management.md
@@ -1,4 +1,4 @@
-# User Management
+# User and User Group Management
In Linux, each common user has an account, including the user name, password, and home directory. There are also special users created for specific purposes, and the most important special user is the admin account whose default user name is root. In addition, Linux provides user groups so that each user belongs to at least one group, facilitating permission management.
@@ -21,17 +21,18 @@ The control of users and user groups is a core element of openEuler security man
+## Managing Users
-## Adding a User
+### Adding a User
-### useradd Command
-Run the **useradd** command as the user **root** to add user information to the system. In the command, _options_ indicates related parameters and _user\_name_ indicates the user name.
+#### useradd Command
+Run the **useradd** command as the user **root** to add user information to the system. In the command, _options_ indicates related parameters and _username_ indicates the user name.
```
-useradd [options] user_name
+useradd [options] username
```
-### User Information Files
+#### User Information Files
The following files contain user account information:
- /etc/passwd: user account information
@@ -41,11 +42,11 @@ The following files contain user account information:
- /etc/login.defs: system wide settings
- /etc/skel: default directory that holds initial configuration files
-### Example
-For example, to create a user named user\_example, run the following command as the user **root**:
+#### Example
+For example, to create a user named userexample, run the following command as the user **root**:
```
-# useradd user_example
+# useradd userexample
```
> **NOTE:**
@@ -54,21 +55,21 @@ For example, to create a user named user\_example, run the following command as
To view information about the new user, run the **id** command:
```
-# id user_example
-uid=502(user_example) gid=502(user_example) groups=502(user_example)
+# id userexample
+uid=502(userexample) gid=502(userexample) groups=502(userexample)
```
-To change the password of the user\_example, run the following command:
+To change the password of the userexample, run the following command:
```
-# passwd user_example
+# passwd userexample
```
Then, enter the password and confirm it as prompted:
```
-# passwd user_example
-Changing password for user user_example.
+# passwd userexample
+Changing password for user userexample.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
@@ -77,27 +78,27 @@ passwd: all authentication tokens updated successfully.
> **NOTE:**
>If the command output contains **BAD PASSWORD: The password fails the dictionary check - it is too simplistic/sytematic**, the password is too simple and needs to be reset.
-## Modifying a User Account
+### Modifying a User Account
-### Changing a Password
+#### Changing a Password
Common users can change their passwords using the **passwd** command. Only the admin is allowed to use the **passwd username** command to change passwords for other users.
-### Changing User's Login Shell
+#### Changing User's Login Shell
Common users can use the **chsh** command to change their login shell. Only the admin is allowed to run the **chsh username** command to change login shell for other users.
-Users can also run the **usermod** command as the user **root** to modify the shell information. In the command, _new\_shell\_path_ indicates the target shell path, and _username_ indicates the user name to be modified. Change them based on the site requirements.
+Users can also run the **usermod** command as the user **root** to modify the shell information. In the command, _new_shell_path_ indicates the target shell path, and _username_ indicates the user name to be modified. Change them based on the site requirements.
```
usermod -s new_shell_path username
```
-For example, to change the shell of user\_example to csh, run the following command:
+For example, to change the shell of userexample to csh, run the following command:
```
-# usermod -s /bin/csh user_example
+# usermod -s /bin/csh userexample
```
-### Changing the Home Directory
+#### Changing the Home Directory
- To change the home directory, run the following command as the user **root**. In the command, _new\_home\_directory_ indicates the created target home directory, and _username_ indicates the user name to be changed. Change them based on the site requirements.
```
@@ -111,7 +112,7 @@ For example, to change the shell of user\_example to csh, run the following comm
```
-### Changing a UID
+#### Changing a UID
To change the user ID, run the following command as the user **root**. In the command, _UID_ indicates the target user ID and _username_ indicates the user name. Change them based on the site requirements.
```
@@ -120,14 +121,14 @@ usermod -u UID username
The usermod command can change a user's UID in all files and directories under the user's home directory. However, for files outside the user's home directory, their owners can only be changed using the **chown** command.
-### Changing Account Expiry Date
+#### Changing Account Expiry Date
If the shadow password is used, run the following command as the user **root** to change the validity period of an account. In the command, _MM_, _DD_, and _YY_ indicate the month, day, and year, respectively, and _username_ indicates the user name. Change them based on the site requirements.
```
usermod -e MM/DD/YY username
```
-## Deleting Users
+### Deleting a User
Run the **userdel** command as the user **root** to delete an existing user.
@@ -140,9 +141,9 @@ For example, run the following command to delete user Test:
If you also need to delete the user's home directory and all contents in the directory, run the **userdel** command with the -r option to delete them recursively.
> **NOTE:**
->You are not advised to directly delete a user who has logged in to the system. To forcibly delete a user, run the **userdel -f** _Test_ command.
+>You are not advised to directly delete a user who has logged in to the system. To forcibly delete a user, run the **userdel -f** _Test_ command.
-## Granting Rights to a Common User
+### Granting Rights to a Common User
The **sudo** command allows common users to execute commands that can be executed only by administrator accounts.
@@ -223,3 +224,83 @@ In the preceding information:
POWERUSER can run all commands except the **su** command as the user **root** on all hosts.
+
+## Managing User Groups
+
+### Adding a User Group
+
+#### groupadd Command
+Run the **groupadd** command as the **root** user to add user group information to the system. In the command, _options_ indicates related parameters and _groupname_ indicates the group name.
+
+```
+groupadd [options] groupname
+```
+
+#### User Group Information Files
+The following files contain user group information:
+
+- /etc/gshadow file: user group encryption information
+- /etc/group file: group information
+- /etc/login.defs: system wide settings
+
+#### Example
+For example, to create a user group named groupexample, run the following command as the **root** user:
+
+```
+# groupadd groupexample
+```
+
+### Modifying a User Group
+
+#### Changing a GID
+To change the user group ID, run the following command as the **root** user. In the command, _GID_ indicates the target user group ID and _groupname_ indicates the user group name. Change them based on the site requirements.
+
+```
+groupmod -g GID groupname
+```
+
+#### Changing a User Group Name
+To change the user group name, run the following command as the **root** user. In the command, _newgroupname_ indicates the user group new name and _oldgroupname_ indicates the user group name. Change them based on the site requirements.
+
+```
+groupmod -n newgroupname oldgroupname
+```
+
+### Deleting a User Group
+
+Run the **groupdel** command as the **root** user to delete an existing user group.
+
+For example, run the following command to delete user group Test:
+
+```
+# groupdel Test
+```
+
+> **NOTE:**
+>The user's primary group cannot be directly deleted. To forcibly delete a user's primary group, run the **groupdel -f** _Test_ command.
+
+### Adding a User to a Group or Removing a User from a Group
+
+Run the **gpasswd** command as the **root** user to add a user to a group or remove a user from a group.
+
+For example, run the following command to add the user userexample to the user group Test:
+
+```
+# gpasswd -a userexample Test
+```
+
+For example, run the following command to remove the user userexample from the user group Test:
+
+```
+# gpasswd -d userexample Test
+```
+
+### Changing the Current Group of a User to a Specified Group
+
+When a user belongs to more than one user group at the same time, run the **newgrp** command to change the current group of the user to other user groups, so as to have the permissions of other user groups.
+
+For example, run the following command to change the current group of the user userexample to the user group Test:
+
+```
+$ newgrp Test
+```
diff --git a/content/en/docs/ApplicationDev/building-an-rpm-package.md b/content/en/docs/ApplicationDev/building-an-rpm-package.md
index 5ab6079aa..d54428023 100644
--- a/content/en/docs/ApplicationDev/building-an-rpm-package.md
+++ b/content/en/docs/ApplicationDev/building-an-rpm-package.md
@@ -518,7 +518,7 @@ This section describes how to build an RPM software package online on OBS.
To modify the source code of the existing software and build the modified source file into an RPM software package on the OBS web client, perform the following steps:
-1. Log in to OBS at [http://openeuler-build.huawei.com/](http://openeuler-build.huawei.com/).
+1. Log in to OBS at [https://build.openeuler.org/](https://build.openeuler.org/).
2. Click **All Projects**. The **All Projects** page is displayed.
3. Click the project to be modified. The project details page is displayed. For example, click **openEuler:Mainline**.
4. On the project details page, search for the software package to be modified and click the software package name. The software package details page is displayed.
@@ -642,12 +642,12 @@ You have obtained the **root** permission, and have configured a repo source f
$ vi ~/.oscrc
```
- 2. Add the **user** and **pass** fields to **\~/.oscrc**. The values of _userName_ and _passWord_ are the account and password registered on the OBS website \([http://openeuler-build.huawei.com/](http://openeuler-build.huawei.com/)\).
+ 2. Add the **user** and **pass** fields to **\~/.oscrc**. The values of _userName_ and _passWord_ are the account and password registered on the OBS website \([https://build.openeuler.org/](https://build.openeuler.org/)\).
```
[general]
- apiurl = http://openeuler-build.huawei.com/
- [http://openeuler-build.huawei.com/]
+ apiurl = https://build.openeuler.org/
+ [https://build.openeuler.org/]
user=userName
pass=passWord
```
diff --git "a/content/zh/docs/Administration/\346\220\255\345\273\272repo\346\234\215\345\212\241\345\231\250.md" "b/content/zh/docs/Administration/\346\220\255\345\273\272repo\346\234\215\345\212\241\345\231\250.md"
index 589f40478..ee458e049 100644
--- "a/content/zh/docs/Administration/\346\220\255\345\273\272repo\346\234\215\345\212\241\345\231\250.md"
+++ "b/content/zh/docs/Administration/\346\220\255\345\273\272repo\346\234\215\345\212\241\345\231\250.md"
@@ -139,7 +139,7 @@ Packages为rpm包所在的目录,repodata为repo源元数据所在的目录,
listen 80;
server_name localhost; # 服务器名(url)
client_max_body_size 4G;
- root /home/openEuler/srv/repo; # 服务默认目录
+ root /usr/share/nginx/repo; # 服务默认目录
location / {
autoindex on; # 开启访问目录下层文件
@@ -168,19 +168,19 @@ Packages为rpm包所在的目录,repodata为repo源元数据所在的目录,
$ systemctl status nginx
```
- - [图1](#zh-cn_topic_0151920971_fd25e3f1d664b4087ae26631719990a71)表示nginx服务启动成功
+ - [图1](#zh-cn_topic_0151920971_fd25e3f1d664b4087ae26631719990a71)表示nginx服务启动成功
- **图 1** nginx服务启动成功
- 
+ **图 1** nginx服务启动成功
+ 
- - 若nginx服务启动失败,查看错误信息:
+ - 若nginx服务启动失败,查看错误信息:
```
$ systemctl status nginx.service --full
```
- **图 2** nginx服务启动失败
- 
+ **图 2** nginx服务启动失败
+ 
如[图2](#zh-cn_topic_0151920971_f1f9f3d086e454b9cba29a7cae96a4c54)所示nginx服务创建失败,是由于目录/var/spool/nginx/tmp/client\_body创建失败,在root权限下手动进行创建,类似的问题也这样处理:
@@ -195,21 +195,18 @@ Packages为rpm包所在的目录,repodata为repo源元数据所在的目录,
### repo源部署
-1. 创建nginx配置文件/etc/nginx/nginx.conf中指定的目录/home/openEuler/srv/repo:
+1. 在root权限下创建nginx配置文件/etc/nginx/nginx.conf中指定的目录/usr/share/nginx/repo:
```
- $ mkdir -p /home/openEuler/srv/repo
+ # mkdir -p /usr/share/nginx/repo
```
-2. 在root权限下将SELinux设置为宽容模式:
+2. 在root权限下修改目录/usr/share/nginx/repo的权限:
```
- # setenforce permissive
+ # chmod -R 755 /usr/share/nginx/repo
```
- > **说明:**
- >repo server重启后,需要重新设置。
-
3. 设置防火墙规则,开启nginx设置的端口(此处为80端口),在root权限下通过firewall设置端口开启:
```
@@ -234,25 +231,26 @@ Packages为rpm包所在的目录,repodata为repo源元数据所在的目录,
**图 3** nginx部署成功

-5. 通过下面几种方式将repo源放入到/home/openEuler/srv/repo下:
- - 拷贝镜像中相关文件至在/home/openEuler/srv/repo下
+5. 通过下面几种方式将repo源放入到/usr/share/nginx/repo下:
+ - 在root权限下拷贝镜像中相关文件至/usr/share/nginx/repo下,并修改目录权限。
```
# mount /home/openEuler/openEuler-20.03-LTS-aarch64-dvd.iso /mnt/
- $ cp -r /mnt/Packages /home/openEuler/srv/repo/
- $ cp -r /mnt/repodata /home/openEuler/srv/repo/
- $ cp -r /mnt/RPM-GPG-KEY-openEuler /home/openEuler/srv/repo/
+ # cp -r /mnt/Packages /usr/share/nginx/repo
+ # cp -r /mnt/repodata /usr/share/nginx/repo
+ # cp -r /mnt/RPM-GPG-KEY-openEuler /usr/share/nginx/repo
+ # chmod -R 755 /usr/share/nginx/repo
```
-
+
openEuler-20.03-LTS-aarch64-dvd.iso存放在/home/openEuler目录下。
-
- - 在/home/openEuler/srv/repo下创建repo源的软链接
-
+
+ - 使用root在/usr/share/nginx/repo下创建repo源的软链接。
+
```
- $ ln -s /home/openEuler/os /home/openEuler/srv/repo/os
+ # ln -s /mnt /usr/share/nginx/repo/os
```
-
- /home/openEuler/os为已经创建好的repo源,/home/openEuler/srv/repo/os将指向/home/openEuler/os。
+
+ /mnt为已经创建好的repo源,/usr/share/nginx/repo/os将指向/mnt。
@@ -287,14 +285,14 @@ repo可配置为yum源,yum(全称为 Yellow dog Updater, Modified)是一
```
[base]
name=base
- baseurl=http://192.168.1.2/
+ baseurl=http://192.168.139.209/
enabled=1
gpgcheck=1
- gpgkey=http://192.168.1.2/RPM-GPG-KEY-openEuler
+ gpgkey=http://192.168.139.209/RPM-GPG-KEY-openEuler
```
> **说明:**
- >“192.168.1.2”为示例地址,请用户根据实际情况进行配置。
+ >“192.168.139.209”为示例地址,请用户根据实际情况进行配置。
### repo优先级
@@ -304,11 +302,11 @@ repo可配置为yum源,yum(全称为 Yellow dog Updater, Modified)是一
```
[base]
name=base
-baseurl=http://192.168.1.2/
+baseurl=http://192.168.139.209/
enabled=1
priority=2
gpgcheck=1
-gpgkey=http://192.168.1.2/RPM-GPG-KEY-openEuler
+gpgkey=http://192.168.139.209/RPM-GPG-KEY-openEuler
```
> **说明:**
diff --git "a/content/zh/docs/Administration/\346\220\255\345\273\272web\346\234\215\345\212\241\345\231\250.md" "b/content/zh/docs/Administration/\346\220\255\345\273\272web\346\234\215\345\212\241\345\231\250.md"
index 3ed3aa10e..71d110b61 100644
--- "a/content/zh/docs/Administration/\346\220\255\345\273\272web\346\234\215\345\212\241\345\231\250.md"
+++ "b/content/zh/docs/Administration/\346\220\255\345\273\272web\346\234\215\345\212\241\345\231\250.md"
@@ -301,11 +301,11 @@ Web服务器搭建完成后,可以通过如下方式验证是否搭建成功
打开浏览器,在地址栏输入如下地址,如果能正常访问网页,说明httpd服务器搭建成功。
- https://192.168.1.60_
+ http://192.168.1.60
如果修改了端口号,输入地址格式如下:
- https://192.168.1.60:端口号
+ http://192.168.1.60:端口号
@@ -549,7 +549,7 @@ Web服务器搭建完成后,可以通过如下方式验证是否搭建成功
打开浏览器,在地址栏输入如下地址,如果能正常访问网页,说明nginx服务器搭建成功。
- http://192.168.1.60_
+ http://192.168.1.60
如果修改了端口号,输入地址格式如下:
diff --git "a/content/zh/docs/Administration/\347\256\241\347\220\206\347\224\250\346\210\267.md" "b/content/zh/docs/Administration/\347\256\241\347\220\206\347\224\250\346\210\267\345\222\214\347\224\250\346\210\267\347\273\204.md"
similarity index 72%
rename from "content/zh/docs/Administration/\347\256\241\347\220\206\347\224\250\346\210\267.md"
rename to "content/zh/docs/Administration/\347\256\241\347\220\206\347\224\250\346\210\267\345\222\214\347\224\250\346\210\267\347\273\204.md"
index b6bbf692c..137e75285 100644
--- "a/content/zh/docs/Administration/\347\256\241\347\220\206\347\224\250\346\210\267.md"
+++ "b/content/zh/docs/Administration/\347\256\241\347\220\206\347\224\250\346\210\267\345\222\214\347\224\250\346\210\267\347\273\204.md"
@@ -1,233 +1,321 @@
-# 管理用户
-
-在Linux中,每个普通用户都有一个账户,包括用户名、密码和主目录等信息。除此之外,还有一些系统本身创建的特殊用户,它们具有特殊的意义,其中最重要的是管理员账户,默认用户名是root。同时Linux也提供了用户组,使每一个用户至少属于一个组,从而便于权限管理。
-
-用户和用户组管理是系统安全管理的重要组成部分,本章主要介绍openEuler提供的用户管理和组管理命令,以及为普通用户分配特权的方法。
-
-
-
-- [管理用户](#管理用户)
- - [增加用户](#增加用户)
- - [useradd命令](#useradd命令)
- - [用户信息文件](#用户信息文件)
- - [创建用户实例](#创建用户实例)
- - [修改用户账号](#修改用户账号)
- - [修改密码](#修改密码)
- - [修改用户shell设置](#修改用户shell设置)
- - [修改主目录](#修改主目录)
- - [修改UID](#修改uid)
- - [修改账号的有效期](#修改账号的有效期)
- - [删除用户](#删除用户)
- - [管理员账户授权](#管理员账户授权)
-
-
-
-## 增加用户
-
-### useradd命令
-
-在root权限下,通过useradd命令可以为系统添加新用户信息,其中 _options_ 为相关参数,_user\_name_ 为用户名称。
-
-```
-useradd [options] user_name
-```
-
-### 用户信息文件
-
-与用户账号信息有关的文件如下:
-
-- /etc/passwd:用户账号信息文件。
-- /etc/shadow:用户账号信息加密文件。
-- /etc/group:组信息文件。
-- /etc/default/useradd:定义默认设置文件。
-- /etc/login.defs:系统广义设置文件。
-- /etc/skel:默认的初始配置文件目录。
-
-### 创建用户实例
-
-例如新建一个用户名为user\_example的用户,在root权限下执行如下命令:
-
-```
-# useradd user_example
-```
-
-> **说明:**
->没有任何提示,表明用户建立成功。这时并没有设置用户的口令,请使用passwd命令修改用户的密码,没有设置密码的新账号不能登录系统。
-
-使用id命令查看新建的用户信息,命令如下:
-
-```
-# id user_example
-uid=502(user_example) gid=502(user_example) groups=502(user_example)
-```
-
-修改用户user\_example的密码:
-
-```
-# passwd user_example
-```
-
-根据提示两次输入新用户的密码,完成密码更改。过程如下:
-
-```
-# passwd user_example
-Changing password for user user_example.
-New password:
-Retype new password:
-passwd: all authentication tokens updated successfully.
-```
-
-> **说明:**
->若打印信息中出现“BAD PASSWORD: The password fails the dictionary check - it is too simplistic/sytematic”,表示设置的密码过于简单,建议设置复杂度较高的密码。
-
-## 修改用户账号
-
-### 修改密码
-
-普通用户可以用passwd修改自己的密码,只有管理员才能用passwd username为其他用户修改密码。
-
-### 修改用户shell设置
-
-使用chsh命令可以修改自己的shell,只有管理员才能用chsh username为其他用户修改shell设置。
-
-用户也可以使用usermod命令修改shell信息,在root权限下执行如下命令,其中 _new\_shell\_path_ 为目标shell路径,_username_ 为要修改用户的用户名,请根据实际情况修改:
-
-```
-usermod -s new_shell_path username
-```
-
-例如,将用户user\_example的shell改为csh,命令如下:
-
-```
-# usermod -s /bin/csh user_example
-```
-
-### 修改主目录
-
-- 修改主目录,可以在root权限下执行如下命令,其中 _new\_home\_directory_ 为已创建的目标主目录的路径,_username_ 为要修改用户的用户名,请根据实际情况修改:
-
- ```
- usermod -d new_home_directory username
- ```
-
-- 如果想将现有主目录的内容转移到新的目录,应该使用-m选项,命令如下:
-
- ```
- usermod -d new_home_directory -m username
- ```
-
-
-### 修改UID
-
-修改用户ID,在root权限下执行如下命令,其中 _UID_ 代表目标用户ID,_username_ 代表用户名,请根据实际情况修改:
-
-```
-usermod -u UID username
-```
-
-该用户主目录中所拥有的文件和目录都将自动修改UID设置。但是,对于主目录外所拥有的文件,只能使用chown命令手动修改所有权。
-
-### 修改账号的有效期
-
-如果使用了影子口令,则可以在root权限下,执行如下命令来修改一个账号的有效期,其中 _MM_ 代表月份,_DD_ 代表某天,_YY_ 代表年份,_username_ 代表用户名,请根据实际情况修改:
-
-```
-usermod -e MM/DD/YY username
-```
-
-## 删除用户
-
-在root权限下,使用userdel命令可删除现有用户。
-
-例如,删除用户Test,命令如下:
-
-```
-# userdel Test
-```
-
-如果想同时删除该用户的主目录以及其中所有内容,要使用-r参数递归删除。
-
-> **说明:**
->不建议直接删除已经进入系统的用户,如果需要强制删除,请使用 userdel -f _Test_ 命令。
-
-## 管理员账户授权
-
-使用sudo命令可以允许普通用户执行管理员账户才能执行的命令。
-
-sudo命令允许已经在/etc/sudoers文件中指定的用户运行管理员账户命令。例如,一个已经获得许可的普通用户可以运行如下命令:
-
-```
-sudo /usr/sbin/useradd newuserl
-```
-
-实际上,sudo的配置完全可以指定某个已经列入/etc/sudoers文件的普通用户可以做什么,不可以做什么。
-
-/etc/sudoers的配置行如下所示。
-
-- 空行或注释行(以\#字符打头):无具体功能的行。
-- 可选的主机别名行:用来创建主机列表的简称。必须以Host\_Alias关键词开头,列表中的主机必须用逗号隔开,如:
-
- ```
- Host_Alias linux=ted1,ted2
- ```
-
- 其中ted1和ted2是两个主机名,可使用linux(别名)称呼它们。
-
-
-- 可选的用户别名行:用来创建用户列表的简称。用户别名行必须以User\_Alias关键词开头,列表中的用户名必须以逗号隔开。其格式同主机别名行。
-- 可选的命令别名行:用来创建命令列表的简称。必须以Cmnd\_Alias开头,列表中的命令必须用逗号隔开。
-- 可选的运行方式别名行:用来创建用户列表的简称。不同的是,使用这样的别名可以告诉sudo程序以列表中某一用户的身份来运行程序。
-- 必要的用户访问说明行。
-
- 用户访问的说明语法如下:
-
- ```
- user host = [ run as user ] command list
- ```
-
- 在user处指定一个真正的用户名或定义过的别名,host也可以是一个真正的主机名或者定义过的主机别名。默认情况下,sudo执行的所有命令都是以root身份执行。如果您想使用其他身份可以指定。command list可以是以逗号分隔的命令列表,也可以是一个已经定义过的别名,如:
-
- ```
- ted1 ted2=/sbin/shutdown
- ```
-
- 这一句说明ted1可以在ted2主机上运行关机命令。
-
- ```
- newuser1 ted1=(root) /usr/sbin/useradd,/usr/sbin/userdel
- ```
-
- 这一句说明ted1主机上的newuser1具有以root用户权限执行useradd,userdel命令的功能。
-
- > **说明:**
- >- 可以在一行定义多个别名,中间用冒号 \(:\) 隔开。
- >- 可在命令或命令别名之前加上感叹号 \(!\),使该命令或命令别名无效。
- >- 有两个关键词:ALL和NOPASSWD。ALL意味着“所有”(所有文件、所有主机或所有命令),NOPASSWD意味着不用密码。
- >- 通过修改用户访问,将普通用户的访问权限修改为同root一样,则可以给普通用户分配特权。
-
-
-下面是一个sudoers文件的例子:
-
-```
-#sudoers files
-#User alias specification
-User_Alias ADMIN=ted1:POWERUSER=globus,ted2
-#user privilege specification
-ADMIN ALL=ALL
-POWERUSER ALL=ALL,!/bin/su
-```
-
-其中:
-
-- User\_Alias ADMIN=ted1:POWERUSER=globus,ted2
-
- 定义了两个别名ADMIN和POWERUSER
-
-- ADMIN ALL=ALL
-
- 说明在所有主机上,ADMIN用户都可以以root身份执行所有命令
-
-- POWERUSER ALL=ALL,!/bin/su
-
- 给POWERUSER用户除了运行su命令外等同ADMIN的权限
-
+# 管理用户
+
+在Linux中,每个普通用户都有一个账户,包括用户名、密码和主目录等信息。除此之外,还有一些系统本身创建的特殊用户,它们具有特殊的意义,其中最重要的是管理员账户,默认用户名是root。同时Linux也提供了用户组,使每一个用户至少属于一个组,从而便于权限管理。
+
+用户和用户组管理是系统安全管理的重要组成部分,本章主要介绍openEuler提供的用户管理和组管理命令,以及为普通用户分配特权的方法。
+
+
+
+- [管理用户](#管理用户)
+ - [增加用户](#增加用户)
+ - [useradd命令](#useradd命令)
+ - [用户信息文件](#用户信息文件)
+ - [创建用户实例](#创建用户实例)
+ - [修改用户账号](#修改用户账号)
+ - [修改密码](#修改密码)
+ - [修改用户shell设置](#修改用户shell设置)
+ - [修改主目录](#修改主目录)
+ - [修改UID](#修改uid)
+ - [修改账号的有效期](#修改账号的有效期)
+ - [删除用户](#删除用户)
+ - [管理员账户授权](#管理员账户授权)
+
+
+
+## 管理用户
+
+### 增加用户
+
+#### useradd命令
+
+在root权限下,通过useradd命令可以为系统添加新用户信息,其中 _options_ 为相关参数, _username_ 为用户名称。
+
+```
+useradd [options] username
+```
+
+#### 用户信息文件
+
+与用户账号信息有关的文件如下:
+
+- /etc/passwd:用户账号信息文件。
+- /etc/shadow:用户账号信息加密文件。
+- /etc/group:组信息文件。
+- /etc/default/useradd:定义默认设置文件。
+- /etc/login.defs:系统广义设置文件。
+- /etc/skel:默认的初始配置文件目录。
+
+#### 创建用户实例
+
+例如新建一个用户名为userexample的用户,在root权限下执行如下命令:
+
+```
+# useradd userexample
+```
+
+> **说明:**
+>没有任何提示,表明用户建立成功。这时并没有设置用户的口令,请使用passwd命令修改用户的密码,没有设置密码的新账号不能登录系统。
+
+使用id命令查看新建的用户信息,命令如下:
+
+```
+# id userexample
+uid=502(userexample) gid=502(userexample) groups=502(userexample)
+```
+
+修改用户userexample的密码:
+
+```
+# passwd userexample
+```
+
+根据提示两次输入新用户的密码,完成密码更改。过程如下:
+
+```
+# passwd userexample
+Changing password for user userexample.
+New password:
+Retype new password:
+passwd: all authentication tokens updated successfully.
+```
+
+> **说明:**
+>若打印信息中出现“BAD PASSWORD: The password fails the dictionary check - it is too simplistic/sytematic”,表示设置的密码过于简单,建议设置复杂度较高的密码。
+
+### 修改用户账号
+
+#### 修改密码
+
+普通用户可以用passwd修改自己的密码,只有管理员才能用passwd username为其他用户修改密码。
+
+#### 修改用户shell设置
+
+使用chsh命令可以修改自己的shell,只有管理员才能用chsh username为其他用户修改shell设置。
+
+用户也可以使用usermod命令修改shell信息,在root权限下执行如下命令,其中 _new\_shell\_path_ 为目标shell路径,_username_ 为要修改用户的用户名,请根据实际情况修改:
+
+```
+usermod -s new_shell_path username
+```
+
+例如,将用户userexample的shell改为csh,命令如下:
+
+```
+# usermod -s /bin/csh userexample
+```
+
+#### 修改主目录
+
+- 修改主目录,可以在root权限下执行如下命令,其中 _new\_home\_directory_ 为已创建的目标主目录的路径,_username_ 为要修改用户的用户名,请根据实际情况修改:
+
+ ```
+ usermod -d new_home_directory username
+ ```
+
+- 如果想将现有主目录的内容转移到新的目录,应该使用-m选项,命令如下:
+
+ ```
+ usermod -d new_home_directory -m username
+ ```
+
+
+#### 修改UID
+
+修改用户ID,在root权限下执行如下命令,其中 _UID_ 代表目标用户ID,_username_ 代表用户名,请根据实际情况修改:
+
+```
+usermod -u UID username
+```
+
+该用户主目录中所拥有的文件和目录都将自动修改UID设置。但是,对于主目录外所拥有的文件,只能使用chown命令手动修改所有权。
+
+#### 修改账号的有效期
+
+如果使用了影子口令,则可以在root权限下,执行如下命令来修改一个账号的有效期,其中 _MM_ 代表月份,_DD_ 代表某天,_YY_ 代表年份,_username_ 代表用户名,请根据实际情况修改:
+
+```
+usermod -e MM/DD/YY username
+```
+
+### 删除用户
+
+在root权限下,使用userdel命令可删除现有用户。
+
+例如,删除用户Test,命令如下:
+
+```
+# userdel Test
+```
+
+如果想同时删除该用户的主目录以及其中所有内容,要使用-r参数递归删除。
+
+> **说明:**
+>不建议直接删除已经进入系统的用户,如果需要强制删除,请使用 userdel -f _Test_ 命令。
+
+### 管理员账户授权
+
+使用sudo命令可以允许普通用户执行管理员账户才能执行的命令。
+
+sudo命令允许已经在/etc/sudoers文件中指定的用户运行管理员账户命令。例如,一个已经获得许可的普通用户可以运行如下命令:
+
+```
+sudo /usr/sbin/useradd newuserl
+```
+
+实际上,sudo的配置完全可以指定某个已经列入/etc/sudoers文件的普通用户可以做什么,不可以做什么。
+
+/etc/sudoers的配置行如下所示。
+
+- 空行或注释行(以\#字符打头):无具体功能的行。
+- 可选的主机别名行:用来创建主机列表的简称。必须以Host\_Alias关键词开头,列表中的主机必须用逗号隔开,如:
+
+ ```
+ Host_Alias linux=ted1,ted2
+ ```
+
+ 其中ted1和ted2是两个主机名,可使用linux(别名)称呼它们。
+
+
+- 可选的用户别名行:用来创建用户列表的简称。用户别名行必须以User\_Alias关键词开头,列表中的用户名必须以逗号隔开。其格式同主机别名行。
+- 可选的命令别名行:用来创建命令列表的简称。必须以Cmnd\_Alias开头,列表中的命令必须用逗号隔开。
+- 可选的运行方式别名行:用来创建用户列表的简称。不同的是,使用这样的别名可以告诉sudo程序以列表中某一用户的身份来运行程序。
+- 必要的用户访问说明行。
+
+ 用户访问的说明语法如下:
+
+ ```
+ user host = [ run as user ] command list
+ ```
+
+ 在user处指定一个真正的用户名或定义过的别名,host也可以是一个真正的主机名或者定义过的主机别名。默认情况下,sudo执行的所有命令都是以root身份执行。如果您想使用其他身份可以指定。command list可以是以逗号分隔的命令列表,也可以是一个已经定义过的别名,如:
+
+ ```
+ ted1 ted2=/sbin/shutdown
+ ```
+
+ 这一句说明ted1可以在ted2主机上运行关机命令。
+
+ ```
+ newuser1 ted1=(root) /usr/sbin/useradd,/usr/sbin/userdel
+ ```
+
+ 这一句说明ted1主机上的newuser1具有以root用户权限执行useradd,userdel命令的功能。
+
+ > **说明:**
+ >- 可以在一行定义多个别名,中间用冒号 \(:\) 隔开。
+ >- 可在命令或命令别名之前加上感叹号 \(!\),使该命令或命令别名无效。
+ >- 有两个关键词:ALL和NOPASSWD。ALL意味着“所有”(所有文件、所有主机或所有命令),NOPASSWD意味着不用密码。
+ >- 通过修改用户访问,将普通用户的访问权限修改为同root一样,则可以给普通用户分配特权。
+
+
+下面是一个sudoers文件的例子:
+
+```
+#sudoers files
+#User alias specification
+User_Alias ADMIN=ted1:POWERUSER=globus,ted2
+#user privilege specification
+ADMIN ALL=ALL
+POWERUSER ALL=ALL,!/bin/su
+```
+
+其中:
+
+- User\_Alias ADMIN=ted1:POWERUSER=globus,ted2
+
+ 定义了两个别名ADMIN和POWERUSER
+
+- ADMIN ALL=ALL
+
+ 说明在所有主机上,ADMIN用户都可以以root身份执行所有命令
+
+- POWERUSER ALL=ALL,!/bin/su
+
+ 给POWERUSER用户除了运行su命令外等同ADMIN的权限
+
+## 管理用户组
+
+### 增加用户组
+
+#### groupadd命令
+
+在root权限下,通过groupadd命令可以为系统添加新用户组信息,其中 _options_ 为相关参数, _groupname_ 为用户组名称。
+
+```
+groupadd [options] groupname
+```
+
+#### 用户组信息文件
+
+与用户组信息有关的文件如下:
+
+- /etc/gshadow:用户组信息加密文件。
+- /etc/group:组信息文件。
+- /etc/login.defs:系统广义设置文件。
+
+#### 创建用户组实例
+
+例如新建一个用户组名为groupexample的用户,在root权限下执行如下命令:
+
+```
+# groupadd groupexample
+```
+
+### 修改用户组
+
+#### 修改GID
+
+修改用户组ID,在root权限下执行如下命令,其中 _GID_ 代表目标用户组ID, _groupname_ 代表用户组,请根据实际情况修改:
+
+```
+groupmod -g GID groupname
+```
+
+
+#### 修改用户组名
+
+修改用户组名,在root权限下执行如下命令,其中 _newgroupname_ 代表新用户组名, _oldgroupname_ 代表已经存在的待修改的用户组名,请根据实际情况修改:
+
+```
+groupmod -n newgroupname oldgroupname
+```
+
+### 删除用户组
+
+在root权限下,使用groupdel命令可删除用户组。
+
+例如,删除用户组Test,命令如下:
+
+```
+# groupdel Test
+```
+
+> **说明:**
+>groupdel不能直接删除用户的主组,如果需要强制删除用户主组,请使用 groupdel -f _Test_ 命令。
+
+### 将用户加入用户组或从用户组中移除
+
+在root权限下,使用gpasswd命令将用户加入用户组或从用户组中移除。
+
+例如,将用户 _userexample_ 加入用户组 _Test_ ,命令如下:
+
+```
+# gpasswd -a userexample Test
+```
+例如,将用户 _userexample_ 从 _Test_ 用户组中移除,命令如下:
+
+```
+# gpasswd -d userexample Test
+```
+
+### 切换用户组
+
+一个用户同时属于多个用户组时,则在用户登录后,使用newgrp命令可以切换到其他用户组,以便具有其他用户组的权限。
+
+例如,将用户 _userexample_ 切换到 _Test_ 用户组,命令如下:
+
+```
+$ newgrp Test
+```
+
+
diff --git "a/content/zh/docs/ApplicationDev/\346\236\204\345\273\272RPM\345\214\205.md" "b/content/zh/docs/ApplicationDev/\346\236\204\345\273\272RPM\345\214\205.md"
index e77dab84c..4fb7fbeac 100644
--- "a/content/zh/docs/ApplicationDev/\346\236\204\345\273\272RPM\345\214\205.md"
+++ "b/content/zh/docs/ApplicationDev/\346\236\204\345\273\272RPM\345\214\205.md"
@@ -515,7 +515,7 @@ OBS使用工程组织软件包。基础的权限控制、相关的存仓库和
使用OBS网页端,修改已有软件的源代码,并将修改后的源文件构建为RPM软件包的操作方法如下:
-1. 登录OBS界面,地址为:[http://openeuler-build.huawei.com/](http://openeuler-build.huawei.com/)。
+1. 登录OBS界面,地址为:[https://build.openeuler.org/](https://build.openeuler.org/)。
2. 单击“All Projects”进入所有工程页面。
3. 单击需要修改的对应工程,进入该工程的详情页面,例如单击“openEuler:Mainline”。
4. 在工程详情页面的搜索框查找需要修改的软件包,然后单击该软件包包名,进入该软件包详请页面。
@@ -639,12 +639,12 @@ RPM软件包构建完成后,通过网页端获取对应RPM软件包的方法
$ vi ~/.oscrc
```
- 2. 在\~/.oscrc中添加user和pass字段,如下所示,它们的取值 _userName_ 和 _passWord_ 分别是用户在OBS网页([http://openeuler-build.huawei.com/](http://openeuler-build.huawei.com/))上已经注册的账号和密码。
+ 2. 在\~/.oscrc中添加user和pass字段,如下所示,它们的取值 _userName_ 和 _passWord_ 分别是用户在OBS网页([https://build.openeuler.org/](https://build.openeuler.org/))上已经注册的账号和密码。
```
[general]
- apiurl = http://openeuler-build.huawei.com/
- [http://openeuler-build.huawei.com/]
+ apiurl = https://build.openeuler.org/
+ [https://build.openeuler.org/]
user=userName
pass=passWord
```
--
Gitee
From 61158abe63a37dddc310339557d44a559beb9d71 Mon Sep 17 00:00:00 2001
From: fhxing168
Date: Sat, 6 Jun 2020 16:38:00 +0800
Subject: [PATCH 14/22] Slove issues.
---
...t.md => user-and-user-group-management.md} | 47 ++++++++++++++-----
...14\347\224\250\346\210\267\347\273\204.md" | 46 +++++++++++++-----
2 files changed, 68 insertions(+), 25 deletions(-)
rename content/en/docs/Administration/{user-management.md => user-and-user-group-management.md} (84%)
diff --git a/content/en/docs/Administration/user-management.md b/content/en/docs/Administration/user-and-user-group-management.md
similarity index 84%
rename from content/en/docs/Administration/user-management.md
rename to content/en/docs/Administration/user-and-user-group-management.md
index 75285b653..b374c4fcf 100644
--- a/content/en/docs/Administration/user-management.md
+++ b/content/en/docs/Administration/user-and-user-group-management.md
@@ -5,19 +5,18 @@ In Linux, each common user has an account, including the user name, password, an
The control of users and user groups is a core element of openEuler security management. This topic introduces the user and group management commands and explains how to assign privileges to common users in graphical user interface and on command lines.
-- [User Management](#user-management)
- - [Adding a User](#adding-a-user)
- - [useradd Command](#useradd-command)
- - [User Information Files](#user-information-files)
- - [Example](#example)
- - [Modifying a User Account](#modifying-a-user-account)
- - [Changing a Password](#changing-a-password)
- - [Changing User's Login Shell](#changing-users-login-shell)
- - [Changing the Home Directory](#changing-the-home-directory)
- - [Changing a UID](#changing-a-uid)
- - [Changing Account Expiry Date](#changing-account-expiry-date)
- - [Deleting Users](#deleting-users)
- - [Granting Rights to a Common User](#granting-rights-to-a-common-user)
+- [User and User Group Management](#user-and-user-group-management)
+ - [Managing Users](#managing-users)
+ - [Adding a User](#adding-a-user)
+ - [Modifying a User Account](#modifying-a-user-account)
+ - [Deleting a User](#deleting-a-user)
+ - [Granting Rights to a Common User](#granting-rights-to-a-common-user)
+ - [Managing User Groups](#managing-user-groups)
+ - [Adding a User Group](#adding-a-user-group)
+ - [Modifying a User Group](#modifying-a-user-group)
+ - [Deleting a User Group](#deleting-a-user-group)
+ - [Adding a User to a Group or Removing a User from a Group](#adding-a-user-to-a-group-or-removing-a-user-from-a-group)
+ - [Changing the Current Group of a User to a Specified Group](#changing-the-current-group-of-a-user-to-a-specified-group)
@@ -65,6 +64,28 @@ To change the password of the userexample, run the following command:
# passwd userexample
```
+
+The password of the user must meet the password complexity requirements. The password complexity requirements are as follows:
+
+1. A password must contain at least eight characters.
+2. A password must contain at least three of the following types: uppercase letters, lowercase letters, digits, and special characters.
+3. A password must be different from the account name.
+4. A password cannot contain words in the dictionary.
+ - Querying a dictionary
+ In the installed openEuler environment, you can run the following command to export the dictionary library file **dictionary.txt**, and then check whether the password is in the dictionary.
+ ```
+ cracklib-unpacker /usr/share/cracklib/pw_dict > dictionary.txt
+ ```
+ - Modifying a dictionary
+ 1. Modify the exported dictionary library file, and then run the following command to update the dictionary library:
+ ```
+ # create-cracklib-dict dictionary.txt
+ ```
+ 2. Run the following command to add another dictionary file **custom.txt** to the original dictionary library.
+ ```
+ # create-cracklib-dict dictionary.txt custom.txt
+ ```
+
Then, enter the password and confirm it as prompted:
```
diff --git "a/content/zh/docs/Administration/\347\256\241\347\220\206\347\224\250\346\210\267\345\222\214\347\224\250\346\210\267\347\273\204.md" "b/content/zh/docs/Administration/\347\256\241\347\220\206\347\224\250\346\210\267\345\222\214\347\224\250\346\210\267\347\273\204.md"
index 137e75285..f207145e2 100644
--- "a/content/zh/docs/Administration/\347\256\241\347\220\206\347\224\250\346\210\267\345\222\214\347\224\250\346\210\267\347\273\204.md"
+++ "b/content/zh/docs/Administration/\347\256\241\347\220\206\347\224\250\346\210\267\345\222\214\347\224\250\346\210\267\347\273\204.md"
@@ -7,18 +7,17 @@
- [管理用户](#管理用户)
- - [增加用户](#增加用户)
- - [useradd命令](#useradd命令)
- - [用户信息文件](#用户信息文件)
- - [创建用户实例](#创建用户实例)
- - [修改用户账号](#修改用户账号)
- - [修改密码](#修改密码)
- - [修改用户shell设置](#修改用户shell设置)
- - [修改主目录](#修改主目录)
- - [修改UID](#修改uid)
- - [修改账号的有效期](#修改账号的有效期)
- - [删除用户](#删除用户)
- - [管理员账户授权](#管理员账户授权)
+ - [管理用户](#管理用户-1)
+ - [增加用户](#增加用户)
+ - [修改用户账号](#修改用户账号)
+ - [删除用户](#删除用户)
+ - [管理员账户授权](#管理员账户授权)
+ - [管理用户组](#管理用户组)
+ - [增加用户组](#增加用户组)
+ - [修改用户组](#修改用户组)
+ - [删除用户组](#删除用户组)
+ - [将用户加入用户组或从用户组中移除](#将用户加入用户组或从用户组中移除)
+ - [切换用户组](#切换用户组)
@@ -56,6 +55,7 @@ useradd [options] username
> **说明:**
>没有任何提示,表明用户建立成功。这时并没有设置用户的口令,请使用passwd命令修改用户的密码,没有设置密码的新账号不能登录系统。
+
使用id命令查看新建的用户信息,命令如下:
```
@@ -69,6 +69,28 @@ uid=502(userexample) gid=502(userexample) groups=502(userexample)
# passwd userexample
```
+修改用户密码时需要满足密码复杂度要求,密码的复杂度的要求如下:
+
+1. 口令长度至少8个字符。
+2. 口令至少包含大写字母、小写字母、数字和特殊字符中的任意3种。
+3. 口令不能和账号一样。
+4. 口令不能使用字典词汇。
+ - 查询字典
+ 在已装好的openEuler环境中,可以通过如下命令导出字典库文件dictionary.txt,用户可以查询密码是否在该字典中。
+ ```
+ cracklib-unpacker /usr/share/cracklib/pw_dict > dictionary.txt
+ ```
+ - 修改字典
+ 1. 修改上面导出的字典文件,执行如下命令更新系统字典库。
+ ```
+ # create-cracklib-dict dictionary.txt
+ ```
+ 2. 在原字典库基础上新增其他字典内容custom.txt。
+ ```
+ # create-cracklib-dict dictionary.txt custom.txt
+ ```
+
+
根据提示两次输入新用户的密码,完成密码更改。过程如下:
```
--
Gitee
From 0ab32f99616f2ec4a7a06162880e67987df69f39 Mon Sep 17 00:00:00 2001
From: fhxing168
Date: Mon, 8 Jun 2020 14:36:44 +0800
Subject: [PATCH 15/22] Slove issues.
---
.../en/docs/Administration/user-and-user-group-management.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/content/en/docs/Administration/user-and-user-group-management.md b/content/en/docs/Administration/user-and-user-group-management.md
index b374c4fcf..a63178022 100644
--- a/content/en/docs/Administration/user-and-user-group-management.md
+++ b/content/en/docs/Administration/user-and-user-group-management.md
@@ -318,7 +318,7 @@ For example, run the following command to remove the user userexample from the u
### Changing the Current Group of a User to a Specified Group
-When a user belongs to more than one user group at the same time, run the **newgrp** command to change the current group of the user to other user groups, so as to have the permissions of other user groups.
+If a user belongs to multiple user groups, run the **newgrp** command to switch the user to another user group after logging in to the system. Then, the user has the permission of other user groups.
For example, run the following command to change the current group of the user userexample to the user group Test:
--
Gitee
From fc0f935272825802e7f2aca1dbc334ea6cbeecb1 Mon Sep 17 00:00:00 2001
From: fhxing168
Date: Mon, 8 Jun 2020 17:12:34 +0800
Subject: [PATCH 16/22] Slove issues.
---
content/en/menu/index.md | 2 +-
content/zh/menu/index.md | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/content/en/menu/index.md b/content/en/menu/index.md
index e5fa8da14..8904c6085 100644
--- a/content/en/menu/index.md
+++ b/content/en/menu/index.md
@@ -28,7 +28,7 @@ headless: true
- [Administrator Guide]({{< relref "./docs/Administration/administration.md" >}})
- [Viewing System Information]({{< relref "./docs/Administration/viewing-system-information.md" >}})
- [Basic Configuration]({{< relref "./docs/Administration/basic-configuration.md" >}})
- - [User Management]({{< relref "./docs/Administration/user-management.md" >}})
+ - [User and User Group Management]({{< relref "./docs/Administration/user-and-user-group-management.md" >}})
- [Using the DNF to Manage Software Packages]({{< relref "./docs/Administration/using-the-dnf-to-manage-software-packages.md" >}})
- [Service Management]({{< relref "./docs/Administration/service-management.md" >}})
- [Process Management]({{< relref "./docs/Administration/process-management.md" >}})
diff --git a/content/zh/menu/index.md b/content/zh/menu/index.md
index 2a748f0fe..9883614d3 100644
--- a/content/zh/menu/index.md
+++ b/content/zh/menu/index.md
@@ -26,7 +26,7 @@ headless: true
- [管理员指南]({{< relref "./docs/Administration/administration.md" >}})
- [查看系统信息]({{< relref "./docs/Administration/查看系统信息.md" >}})
- [基础配置]({{< relref "./docs/Administration/基础配置.md" >}})
- - [管理用户]({{< relref "./docs/Administration/管理用户.md" >}})
+ - [管理用户和用户组]({{< relref "./docs/Administration/管理用户和用户组.md" >}})
- [使用DNF管理软件包]({{< relref "./docs/Administration/使用DNF管理软件包.md" >}})
- [管理服务]({{< relref "./docs/Administration/管理服务.md" >}})
- [管理进程]({{< relref "./docs/Administration/管理进程.md" >}})
--
Gitee
From 76294162c1fd3ee9d78c32c8f55561f02edab4fd Mon Sep 17 00:00:00 2001
From: Xiang Zheng
Date: Fri, 12 Jun 2020 15:27:26 +0800
Subject: [PATCH 17/22] docs: Virtualization: Delete redundant suffix string
Signed-off-by: Xiang Zheng
---
.../\347\256\241\347\220\206\350\256\276\345\244\207.md" | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git "a/content/zh/docs/Virtualization/\347\256\241\347\220\206\350\256\276\345\244\207.md" "b/content/zh/docs/Virtualization/\347\256\241\347\220\206\350\256\276\345\244\207.md"
index b214eaf89..075464821 100644
--- "a/content/zh/docs/Virtualization/\347\256\241\347\220\206\350\256\276\345\244\207.md"
+++ "b/content/zh/docs/Virtualization/\347\256\241\347\220\206\350\256\276\345\244\207.md"
@@ -285,7 +285,7 @@ PCI直通是指将host上的物理PCI设备直接呈现给一台虚拟机,供
> **说明:**
>VFIO直通方式的最小直通单位是iommu\_group,host根据硬件上的ACS位,来划分iommu\_group。同一个iommu\_group中的设备只允许直通给同一台虚拟机(一个PCI设备上的若干个function,如果属于同一个iommu\_group,只允许直通给一个虚拟机使用)。
-### SR-IOV直通">SR-IOV直通
+### SR-IOV直通
#### 概述
--
Gitee
From 63ad1f6e6a839672054ccafbb5af5e222651d8bb Mon Sep 17 00:00:00 2001
From: Xiang Zheng
Date: Fri, 12 Jun 2020 16:27:11 +0800
Subject: [PATCH 18/22] docs: Virtualization: Add HPRE SR-IOV pass-through
decription
Signed-off-by: Xiang Zheng
---
...41\347\220\206\350\256\276\345\244\207.md" | 23 +++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git "a/content/zh/docs/Virtualization/\347\256\241\347\220\206\350\256\276\345\244\207.md" "b/content/zh/docs/Virtualization/\347\256\241\347\220\206\350\256\276\345\244\207.md"
index 075464821..25ef2a6f9 100644
--- "a/content/zh/docs/Virtualization/\347\256\241\347\220\206\350\256\276\345\244\207.md"
+++ "b/content/zh/docs/Virtualization/\347\256\241\347\220\206\350\256\276\345\244\207.md"
@@ -455,6 +455,29 @@ SR-IOV(Single Root I/O Virtualizaiton)是一种基于硬件的虚拟化解
>echo 0 > /sys/class/net/eth0/device/sriov_numvfs
>```
+#### HPRE加速器SR-IOV直通
+
+加速器引擎是TaiShan 200服务器基于Kunpeng 920服务器提供的硬件加速解决方案。HPRE加速器用于加速SSL/TLS应用,可以显著降低处理器消耗,提高处理器效率。
+在鲲鹏服务器上,需要把主机Host上的HPRE加速器的VF直通给虚拟机,供虚拟机内部业务使用。
+
+**表 1** HPRE加速器说明
+
+| | 说明 |
+|-------------|-----------------------------------------------------------------------------------------------------|
+| 设备名称 | Hi1620 on-chip RSA/DH security algorithm accelerator (HPRE engine) |
+| 功能 | 模幂运算、RSA密钥对运算、DH计算、部分大数辅助运算(模幂、模乘、取模、乘法、模逆、素数测试、互质测试) |
+| VendorID | 0x19E5 |
+| PF DeviceID | 0xA258 |
+| VF DeviceID | 0xA259 |
+| 最大VF数量 | 一个HPRE PF最多支持创建63个VF |
+
+
+> **说明:**
+>当虚拟机正在使用VF设备时,不允许卸载Host上的驱动,加速器不支持热插拔。
+>VF操作(VFNUMS为0表示关闭VF,hpre_num用来标识具体的加速器设备):
+>```
+>echo $VFNUMS > /sys/class/uacce/hisi_hpre-$hpre_num/device/sriov_numvfs
+>```
## 管理虚拟机USB
--
Gitee
From 43889b55ac23718de68eb6f491df71b012d5499c Mon Sep 17 00:00:00 2001
From: fhxing168
Date: Mon, 15 Jun 2020 15:03:47 +0800
Subject: [PATCH 19/22] Slove issue.
---
.../configuring-the-web-server.md | 4 ++--
.../docs/Administration/process-management.md | 24 +++++++++----------
.../setting-up-the-database-server.md | 8 +++----
...eb\346\234\215\345\212\241\345\231\250.md" | 4 ++--
...23\346\234\215\345\212\241\345\231\250.md" | 10 ++++----
...41\347\220\206\350\277\233\347\250\213.md" | 24 +++++++++----------
...15\347\275\256\347\275\221\347\273\234.md" | 2 +-
7 files changed, 38 insertions(+), 38 deletions(-)
diff --git a/content/en/docs/Administration/configuring-the-web-server.md b/content/en/docs/Administration/configuring-the-web-server.md
index 0903e98c2..080c8e167 100644
--- a/content/en/docs/Administration/configuring-the-web-server.md
+++ b/content/en/docs/Administration/configuring-the-web-server.md
@@ -349,7 +349,7 @@ You can use the systemctl tool to manage the Nginx service, including starting,
For more information about service management, see [Service Management](service-management.html).
-- To start, stop, and restart the httpd service, you must have the **root** permission.
+- To start, stop, and restart the Nginx service, you must have the **root** permission.
#### Starting a Service
- Run the following command to start and run the Nginx service:
@@ -371,7 +371,7 @@ You can use the systemctl tool to manage the Nginx service, including starting,
>If the running Nginx server functions as a secure server, a password is required after the system is started. The password is an encrypted private SSL key.
#### Stopping the Service
-- Run the following command to stop the httpd service:
+- Run the following command to stop the Nginx service:
```
# systemctl stop nginx
diff --git a/content/en/docs/Administration/process-management.md b/content/en/docs/Administration/process-management.md
index 84567f35b..e745e2271 100644
--- a/content/en/docs/Administration/process-management.md
+++ b/content/en/docs/Administration/process-management.md
@@ -26,7 +26,7 @@ The who command is used to display system user information. For example, before
The following is an example output of the who command, where system users and their status are displayed: The use of the **who** command is as follows:
```
-# who
+$ who
admin tty1 Jul 28 15:55
admin pts/0 Aug 5 15:46 (192.168.0.110)
admin pts/2 Jul 29 19:52 (192.168.0.110)
@@ -97,7 +97,7 @@ A common scenario is using the ps command to monitor background processes, which
For example, to list all processes on a terminal, run the following command:
```
-# ps -a
+$ ps -a
PID TTY TIME CMD
12175 pts/6 00:00:00 bash
24526 pts/0 00:00:00 vsftpd
@@ -127,7 +127,7 @@ kill -l [signal]
The process ID is retrieved from the ps command. The **-s** option indicates the signal sent to specified program. The signal details can be viewed by running the **kill -l** command. The **-p** option indicates the specified process IDs.
-For example, to terminate the process with ID 1409, run the following command:
+For example, to terminate the process with ID 1409, run the following command as the **root** user:
```
# kill -9 1409
@@ -136,7 +136,7 @@ For example, to terminate the process with ID 1409, run the following command:
Example output of the kill command with the -l option
```
-# kill -l
+$ kill -l
1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP
6) SIGABRT 7) SIGBUS 8) SIGFPE 9) SIGKILL 10) SIGUSR1
11) SIGSEGV 12) SIGUSR2 13) SIGPIPE 14) SIGALRM 15) SIGTERM
@@ -197,7 +197,7 @@ Although you can select any of the preceding examples according to your preferen
#### Privileges
Only commands from standard input or from the file specified by the -f option can be scheduled by the at command to be executed. If the su command is executed to switch the operating system from user A to user B and then the at command is executed at the shell prompt of user B, the at command execution result is sent to user B. whereas emails \(if any\) are sent to user A.
-For example, to run the slocate -u command at 10 am on June 8, 2019, perform the following steps:
+For example, to run the slocate -u command at 10 am on June 8, 2019, perform the following steps as the **root** user:
```
# at 10:00 6/8/19
@@ -215,7 +215,7 @@ The administrator is authorized to run the at command unconditionally. For other
The at command can run commands at the scheduled time but only once. It means that after the running command is specified, the system completes the task at the specified time. If you need to run commands repeatedly, the cron service is a good helper.
#### Cron Service
-The **cron** service searches the **/var/spool/cron** directory for **crontab** files named by the user name in the /etc/passwd file and loads the search results into memory to execute the commands in the **crontab** files. Each user has a crontab file, with the file name being the same as the user name. For example, the **crontab** file of the **globus** user is **/var/spool/cron/globus**.
+The **cron** service searches the **/var/spool/cron** directory for **crontab** files named by the user name in the /etc/passwd file and loads the search results into memory to execute the commands in the **crontab** files. Each user has a crontab file, with the file name being the same as the user name. For example, the **crontab** file of the **userexample** user is **/var/spool/cron/userexample**.
The **cron** service also reads the cron configuration file **/etc/crontab** every minute, which can be edited in various formats. If no crontab files are found, the **cron** service enters sleep mode and releases system resources. One minute later, the **cron** service is awoken to repeat the search work and command execution. Therefore, the background process occupies few resources and is wakened up every minute to check whether there are commands to be executed.
@@ -234,7 +234,7 @@ Here are common crontab command options:
For example, to list cron service settings of the user **root**, run the following command:
```
-crontab -u root -l
+# crontab -u root -l
```
#### crontab Files
@@ -298,17 +298,17 @@ For example, to allow the operating system to add sleepy to the /tmp/test.txt fi
Each time the cron service settings of a user are edited, the cron service generates in the /var/spool/cron directory a crontab file named after the user. The crontab file can be edited only using the crontab -e command. Alternatively, the user can create a file and run the crontab _filename_ command to import its cron settings into the new file.
-For example, to create a crontab file for the globus user, perform the following steps: The procedure is as follows:
+For example, to create a crontab file for the userexample user, perform the following steps: The procedure is as follows:
-1. Create a file using any text editor. Add the commands that need to be executed periodically and the command execution interval to the new file. In this example, the new file is **\~/globus.cron**.
-2. Run the following command to install the new file as the crontab file of the globus user: run the following command:
+1. Create a file using any text editor. Add the commands that need to be executed periodically and the command execution interval to the new file. In this example, the new file is **\~/userexample.cron**.
+2. Run the following command as the **root** user to install the new file as the crontab file of the userexample user:
```
- crontab globus. ~/globus.cron
+ # crontab -u userexample ~/userexample.cron
```
-After the new file is installed, you will find a file named globus in the **/var/spool/cron** directory. This file is the required crontab file.
+After the new file is installed, you will find a file named userexample in the **/var/spool/cron** directory. This file is the required crontab file.
> **NOTE:**
>Do not restart the cron service after a crontab file is modified, because the cron service, once started, reads the crontab file every minute to check whether there are commands that need to be executed periodically. You do not need to restart the **cron** service after modifying the **crontab** file.
diff --git a/content/en/docs/Administration/setting-up-the-database-server.md b/content/en/docs/Administration/setting-up-the-database-server.md
index d016c74c2..c88049f01 100644
--- a/content/en/docs/Administration/setting-up-the-database-server.md
+++ b/content/en/docs/Administration/setting-up-the-database-server.md
@@ -1095,7 +1095,7 @@ A new user has few permissions and can perform only operations that do not requi
\#Create a user whose password is 123456, username is userexample2, and hostname is 192.168.1.100.
```
-> CREATE USER 'userexample2'@'192.168.1.100' IDENDIFIED BY '123456';
+> CREATE USER 'userexample2'@'192.168.1.100' IDENTIFIED BY '123456';
```
#### Viewing Users
@@ -1408,7 +1408,7 @@ In the preceding information:
\#Back up only the data of the db1 database of the user **root** on the host **192.168.202.144** through port **3306** to the **db1.sql** file.
```
-# mysqldump -h 192.168.202.144 -P 3306 -uroot -p123456 -t db1 > db1.sq
+# mysqldump -h 192.168.202.144 -P 3306 -uroot -p123456 -t db1 > db1.sql
```
#### Restoring a Database
@@ -1843,7 +1843,7 @@ A new user has few permissions and can perform only operations that do not requi
\#Create a user whose password is **123456**, username is **userexample2**, and hostname is **192.168.1.100**.
```
-> CREATE USER 'userexample2'@'192.168.1.100' IDENDIFIED BY '123456';
+> CREATE USER 'userexample2'@'192.168.1.100' IDENTIFIED BY '123456';
```
#### Viewing Users
@@ -2152,7 +2152,7 @@ In the preceding information:
\#Back up only the table structure of the db1 database of user **root** on port **3306** of the host whose IP address is **192.168.202.144** to the **db1.sql** file.
```
-# mysqldump -h 192.168.202.144 -P 3306 -uroot -p123456 -t db1 > db1.sq
+# mysqldump -h 192.168.202.144 -P 3306 -uroot -p123456 -t db1 > db1.sql
```
#### Restoring a Database
diff --git "a/content/zh/docs/Administration/\346\220\255\345\273\272web\346\234\215\345\212\241\345\231\250.md" "b/content/zh/docs/Administration/\346\220\255\345\273\272web\346\234\215\345\212\241\345\231\250.md"
index 71d110b61..b0878f072 100644
--- "a/content/zh/docs/Administration/\346\220\255\345\273\272web\346\234\215\345\212\241\345\231\250.md"
+++ "b/content/zh/docs/Administration/\346\220\255\345\273\272web\346\234\215\345\212\241\345\231\250.md"
@@ -354,7 +354,7 @@ Nginx 是一款轻量级的 Web 服务器/反向代理服务器及电子邮件
更多关于管理服务的内容,请参见[管理服务](管理服务.html)。
-- 启动、停止和重启httpd服务,需要使用root权限。
+- 启动、停止和重启nginx服务,需要使用root权限。
#### 启动服务
@@ -378,7 +378,7 @@ Nginx 是一款轻量级的 Web 服务器/反向代理服务器及电子邮件
#### 停止服务
-- 停止运行的httpd服务,命令如下:
+- 停止运行的nginx服务,命令如下:
```
# systemctl stop nginx
diff --git "a/content/zh/docs/Administration/\346\220\255\345\273\272\346\225\260\346\215\256\345\272\223\346\234\215\345\212\241\345\231\250.md" "b/content/zh/docs/Administration/\346\220\255\345\273\272\346\225\260\346\215\256\345\272\223\346\234\215\345\212\241\345\231\250.md"
index 91a104f5c..a6a66a238 100644
--- "a/content/zh/docs/Administration/\346\220\255\345\273\272\346\225\260\346\215\256\345\272\223\346\234\215\345\212\241\345\231\250.md"
+++ "b/content/zh/docs/Administration/\346\220\255\345\273\272\346\225\260\346\215\256\345\272\223\346\234\215\345\212\241\345\231\250.md"
@@ -1086,7 +1086,7 @@ CREATE USER 'username'@'hostname' IDENTIFIED BY 'password';
\#创建密码为123456,用户名为userexample2,主机名为192.168.1.100的用户。
```
-> CREATE USER 'userexample2'@'192.168.1.100' IDENDIFIED BY '123456';
+> CREATE USER 'userexample2'@'192.168.1.100' IDENTIFIED BY '123456';
```
#### 查看用户
@@ -1409,7 +1409,7 @@ mysqldump [options] -all-databases > outputfile
\#只备份主机为192.168.202.144,端口为3306,root用户下的db1数据库的数据到db1.sql中。
```
-# mysqldump -h 192.168.202.144 -P 3306 -uroot -p123456 -t db1 > db1.sq
+# mysqldump -h 192.168.202.144 -P 3306 -uroot -p123456 -t db1 > db1.sql
```
#### 恢复数据库
@@ -1466,7 +1466,7 @@ MySQL所使用的SQL语言是用于访问数据库的最常用标准化语言。
2. 在root权限下关闭防火墙。
```
- #s ystemctl disable firewalld
+ # systemctl disable firewalld
```
> **说明:**
@@ -1836,7 +1836,7 @@ CREATE USER 'username'@'hostname' IDENTIFIED BY 'password';
\#创建密码为123456,用户名为userexample2,主机名为192.168.1.100的用户。
```
-> CREATE USER 'userexample2'@'192.168.1.100' IDENDIFIED BY '123456';
+> CREATE USER 'userexample2'@'192.168.1.100' IDENTIFIED BY '123456';
```
#### 查看用户
@@ -2156,7 +2156,7 @@ mysqldump [options] -all-databases > outputfile
\#只备份主机为192.168.202.144,端口为3306,root用户下的db1数据库的数据到db1.sql中。
```
-# mysqldump -h 192.168.202.144 -P 3306 -uroot -p123456 -t db1 > db1.sq
+# mysqldump -h 192.168.202.144 -P 3306 -uroot -p123456 -t db1 > db1.sql
```
#### 恢复数据库
diff --git "a/content/zh/docs/Administration/\347\256\241\347\220\206\350\277\233\347\250\213.md" "b/content/zh/docs/Administration/\347\256\241\347\220\206\350\277\233\347\250\213.md"
index 5a796ed61..e966f9c0d 100644
--- "a/content/zh/docs/Administration/\347\256\241\347\220\206\350\277\233\347\250\213.md"
+++ "b/content/zh/docs/Administration/\347\256\241\347\220\206\350\277\233\347\250\213.md"
@@ -26,7 +26,7 @@ who命令主要用于查看当前系统中的用户情况。如果用户想和
例如查看系统中的用户及其状态。使用如下:
```
-# who
+$ who
admin tty1 Jul 28 15:55
admin pts/0 Aug 5 15:46 (192.168.0.110)
admin pts/2 Jul 29 19:52 (192.168.0.110)
@@ -98,7 +98,7 @@ ps命令最常用的还是用来监控后台进程的工作情况,因为后台
例如显示系统中终端上的所有进行进程。命令如下:
```
-# ps -a
+$ ps -a
PID TTY TIME CMD
12175 pts/6 00:00:00 bash
24526 pts/0 00:00:00 vsftpd
@@ -130,7 +130,7 @@ kill -l [信号]
其中进程号可以通过ps命令的输出得到。-s选项是给程序发送指定的信号,详细的信号可以用“kill -l”命令查看;-p选项只显示指定进程的ID号。
-杀死pid为1409的进程,示例如下:
+杀死pid为1409的进程,在root权限下执行如下命令:
```
# kill -9 1409
@@ -139,7 +139,7 @@ kill -l [信号]
显示所有的信号及其编号对应关系,示例如下:
```
-# kill -l
+$ kill -l
1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP
6) SIGABRT 7) SIGBUS 8) SIGFPE 9) SIGKILL 10) SIGUSR1
11) SIGSEGV 12) SIGUSR2 13) SIGPIPE 14) SIGALRM 15) SIGTERM
@@ -204,7 +204,7 @@ at允许使用一套相当复杂的时间指定方法,比如:
对于at命令来说,需要定时执行的命令是从标准输入或者使用-f选项指定的文件中读取并执行的。如果at命令是从一个使用su命令切换到用户shell中执行的,那么当前用户被认为是执行用户,所有的错误和输出结果都会送给这个用户。但是如果有邮件送出的话,收到邮件的将是原来的用户,也就是登录时shell的所有者。
-例如在6月8日上午10点执行slocate -u命令。命令如下:
+例如在6月8日上午10点执行slocate -u命令。在root权限下执行命令如下:
```
# at 10:00 6/8/19
@@ -223,7 +223,7 @@ at>
#### 运行机制
-首先cron命令会搜索/var/spool/cron目录,寻找以/etc/passwd文件中的用户名命名的crontab文件,被找到的这种文件将装入内存。比如一个用户名为globus的用户,对应的crontab文件应该是/var/spool/cron/globus,即以该用户命名的crontab文件存放在/var/spool/cron目录下面。
+首先cron命令会搜索/var/spool/cron目录,寻找以/etc/passwd文件中的用户名命名的crontab文件,被找到的这种文件将装入内存。比如一个用户名为userexample的用户,对应的crontab文件应该是/var/spool/cron/userexample,即以该用户命名的crontab文件存放在/var/spool/cron目录下面。
cron命令还将搜索/etc/crontab文件,这个文件是用不同的格式写成的。cron启动以后,它将首先检查是否有用户设置了crontab文件,如果没有就转入睡眠状态,释放系统资源。所以该后台进程占用资源极少,它每分钟被换醒一次,查看当前是否有需要运行的命令。
@@ -243,7 +243,7 @@ crontab命令的常用方法如下:
例如root查看自己的cron设置。命令如下:
```
-crontab -u root -l
+# crontab -u root -l
```
#### crontab文件
@@ -308,17 +308,17 @@ minute hour day-of-month month-of-year day-of-week commands
每次编辑完某个用户的cron设置后,cron自动在/var/spool/cron下生成一个与此用户同名的文件。此用户的cron信息都记录在这个文件中,这个文件是不可以直接编辑的,只可以用crontab -e来编辑。用户也可以另外建立一个文件,使用“cron文件名”命令导入cron设置。
-假设有个用户名为globus,它需要为自己创建的一个crontab文件。步骤如下:
+假设有个用户名为userexample,它需要为自己创建的一个crontab文件。步骤如下:
-1. 首先可以使用任何文本编辑器建立一个新文件,并将向该文件加入需要运行的命令和要定期执行的时间,假设该文件为 \~/globus.cron。
-2. 然后使用crontab命令安装这个文件,使用crontab命令使之成为该用户的crontab文件。命令如下:
+1. 首先可以使用任何文本编辑器建立一个新文件,并将向该文件加入需要运行的命令和要定期执行的时间,假设该文件为 \~/userexample.cron。
+2. 然后在root权限下使用crontab命令安装这个文件,使用crontab命令使之成为该用户的crontab文件。命令如下:
```
- crontab globus. ~/globus.cron
+ # crontab -u userexample ~/userexample.cron
```
-这样crontab文件就建立好了,可以转到/var/spool/cron目录下面查看,发现多了一个globus文件。这个文件就是所需的crontab文件。
+这样crontab文件就建立好了,可以转到/var/spool/cron目录下面查看,发现多了一个userexample文件。这个文件就是所需的crontab文件。
> **说明:**
>cron启动后,每过一分钟读一次crontab文件,检查是否要执行里面的命令。因此该文件被修改后不需要重新启动cron服务。
diff --git "a/content/zh/docs/Administration/\351\205\215\347\275\256\347\275\221\347\273\234.md" "b/content/zh/docs/Administration/\351\205\215\347\275\256\347\275\221\347\273\234.md"
index 8c476a94f..9da7a61e6 100644
--- "a/content/zh/docs/Administration/\351\205\215\347\275\256\347\275\221\347\273\234.md"
+++ "b/content/zh/docs/Administration/\351\205\215\347\275\256\347\275\221\347\273\234.md"
@@ -445,7 +445,7 @@ ONBOOT=yes
#### 配置动态网络
-要通过ifcfg文件为名为em1的接口配置动态网络,请按照如下操作在/etc/sysconfig/network-scripts/目录中生成名为 ifcfg-em1 的文件,示例如下:
+要通过ifcfg文件为em1接口配置动态网络,请按照如下操作在/etc/sysconfig/network-scripts/目录中生成名为 ifcfg-em1 的文件,示例如下:
```
DEVICE=em1
--
Gitee
From 3568c706c89735712d0bf0691d82f8ff0afad74f Mon Sep 17 00:00:00 2001
From: zhangsong234
Date: Wed, 17 Jun 2020 04:30:21 +0800
Subject: [PATCH 20/22] Modify docs for syscontainer
Signed-off-by: zhangsong234
---
.../en/docs/Container/device-management.md | 16 ++---
.../dynamically-loading-the-kernel-module.md | 10 +--
.../docs/Container/installation-guideline.md | 2 +-
content/en/docs/Container/nic-management.md | 20 +++---
.../proc-file-system-isolation-(lxcfs).md | 10 +--
content/en/docs/Container/route-management.md | 18 ++---
.../Container/volume-mounting-management.md | 16 ++---
...05\346\240\270\346\250\241\345\235\227.md" | 10 +--
...14\351\232\224\347\246\273\346\200\247.md" | 10 +--
...11\350\243\205\346\214\207\345\257\274.md" | 2 +-
...50\346\200\201\347\256\241\347\220\206.md" | 70 +++++++++----------
11 files changed, 92 insertions(+), 92 deletions(-)
diff --git a/content/en/docs/Container/device-management.md b/content/en/docs/Container/device-management.md
index 1c3285516..b3946a031 100644
--- a/content/en/docs/Container/device-management.md
+++ b/content/en/docs/Container/device-management.md
@@ -2,12 +2,12 @@
## Function Description
-isulad-tools allows you to add block devices \(such as disks and logical volume managers\) or character devices \(such as GPUs, binners, and FUSEs\) on the host to a container. The devices can be used in the container. For example, you can run the **fdisk** command to format the disk and write data to the file system. If the devices are not required, isulad-tools allows you to delete them from the container and return them to the host.
+syscontainer-tools allows you to add block devices \(such as disks and logical volume managers\) or character devices \(such as GPUs, binners, and FUSEs\) on the host to a container. The devices can be used in the container. For example, you can run the **fdisk** command to format the disk and write data to the file system. If the devices are not required, syscontainer-tools allows you to delete them from the container and return them to the host.
## Command Format
```
-isulad-tools [COMMADN][OPTIONS] [ARG...]
+syscontainer-tools [COMMADN][OPTIONS] [ARG...]
```
In the preceding format:
@@ -87,16 +87,16 @@ In the preceding format:
- You can add or delete devices when container instances are not running. After the operation is complete, you can start the container to view the device status. You can also dynamically add a device when the container is running.
- Do not concurrently run the **fdisk** command to format disks in a container and on the host. Otherwise, the container disk usage will be affected.
-- When you run the **add-device** command to add a disk to a specific directory of a container, if the parent directory in the container is a multi-level directory \(for example, **/dev/a/b/c/d/e**\) and the directory level does not exist, isulad-tools will automatically create the corresponding directory in the container. When the disk is deleted, the created parent directory is not deleted. If you run the **add-device** command to add a device to this parent directory again, a message is displayed, indicating that a device already exists and cannot be added.
+- When you run the **add-device** command to add a disk to a specific directory of a container, if the parent directory in the container is a multi-level directory \(for example, **/dev/a/b/c/d/e**\) and the directory level does not exist, syscontainer-tools will automatically create the corresponding directory in the container. When the disk is deleted, the created parent directory is not deleted. If you run the **add-device** command to add a device to this parent directory again, a message is displayed, indicating that a device already exists and cannot be added.
- When you run the** add-device** command to add a disk or update disk parameters, you need to configure the disk QoS. Do not set the write or read rate limit for the block device \(I/O/s or byte/s\) to a small value. If the value is too small, the disk may be unreadable \(the actual reason is the speed is too slow\), affecting service functions.
- When you run the **--blkio-weight-device** command to limit the weight of a specified block device, if the block device supports only the BFQ mode, an error may be reported, prompting you to check whether the current OS environment supports setting the weight of the BFQ block device.
## Example
-- Start a system container, and set **hook spec** to the isulad hook execution script.
+- Start a system container, and set **hook spec** to the syscontainer hook execution script.
```
- [root@localhost ~]# isula run -tid --hook-spec /etc/isulad-tools/hookspec.json --system-container --external-rootfs /root/root-fs none init
+ [root@localhost ~]# isula run -tid --hook-spec /etc/syscontainer-tools/hookspec.json --system-container --external-rootfs /root/root-fs none init
eed1096c8c7a0eca6d92b1b3bc3dd59a2a2adf4ce44f18f5372408ced88f8350
```
@@ -104,7 +104,7 @@ In the preceding format:
- Add a block device to a container.
```
- [root@localhost ~]# isulad-tools add-device ee /dev/sdb:/dev/sdb123
+ [root@localhost ~]# syscontainer-tools add-device ee /dev/sdb:/dev/sdb123
Add device (/dev/sdb) to container(ee,/dev/sdb123) done.
[root@localhost ~]# isula exec ee fdisk -l /dev/sdb123
Disk /dev/sdb123: 50 GiB, 53687091200 bytes, 104857600 sectors
@@ -122,14 +122,14 @@ In the preceding format:
- Update the device information.
```
- [root@localhost ~]# isulad-tools update-device --device-read-bps /dev/sdb:10m ee
+ [root@localhost ~]# syscontainer-tools update-device --device-read-bps /dev/sdb:10m ee
Update read bps for device (/dev/sdb,10485760) done.
```
- Delete a device.
```
- [root@localhost ~]# isulad-tools remove-device ee /dev/sdb:/dev/sdb123
+ [root@localhost ~]# syscontainer-tools remove-device ee /dev/sdb:/dev/sdb123
Remove device (/dev/sdb) from container(ee,/dev/sdb123) done.
Remove read bps for device (/dev/sdb) done.
```
diff --git a/content/en/docs/Container/dynamically-loading-the-kernel-module.md b/content/en/docs/Container/dynamically-loading-the-kernel-module.md
index 695202479..6f821f774 100644
--- a/content/en/docs/Container/dynamically-loading-the-kernel-module.md
+++ b/content/en/docs/Container/dynamically-loading-the-kernel-module.md
@@ -2,7 +2,7 @@
## Function Description
-Services in a container may depend on some kernel modules. You can set environment variables to dynamically load the kernel modules required by services in the container to the host before the system container starts. This feature must be used together with isulad-hooks. For details, see [Dynamically Managing Container Resources \(syscontainer-tools\)](dynamically-managing-container-resources-(syscontainer-tools).md).
+Services in a container may depend on some kernel modules. You can set environment variables to dynamically load the kernel modules required by services in the container to the host before the system container starts. This feature must be used together with syscontainer-hooks. For details, see [Dynamically Managing Container Resources \(syscontainer-tools\)](dynamically-managing-container-resources-(syscontainer-tools).md).
## Parameter Description
@@ -28,7 +28,7 @@ Services in a container may depend on some kernel modules. You can set environme
## Constraints
- If loaded kernel modules are not verified or conflict with existing modules on the host, an unpredictable error may occur on the host. Therefore, exercise caution when loading kernel modules.
-- Dynamic kernel module loading transfers kernel modules to be loaded to containers. This function is implemented by capturing environment variables for container startup using isulad-tools. Therefore, this function relies on the proper installation and deployment of isulad-tools.
+- Dynamic kernel module loading transfers kernel modules to be loaded to containers. This function is implemented by capturing environment variables for container startup using syscontainer-tools. Therefore, this function relies on the proper installation and deployment of syscontainer-tools.
- Loaded kernel modules need to be manually deleted.
## Example
@@ -37,7 +37,7 @@ When starting a system container, specify the **-e KERNEL\_MODULES** parameter
```
[root@localhost ~]# lsmod | grep ip_vs
-[root@localhost ~]# isula run -tid -e KERNEL_MODULES=ip_vs,ip_vs_wrr --hook-spec /etc/isulad-tools/hookspec.json --system-container --external-rootfs /root/myrootfs none init
+[root@localhost ~]# isula run -tid -e KERNEL_MODULES=ip_vs,ip_vs_wrr --hook-spec /etc/syscontainer-tools/hookspec.json --system-container --external-rootfs /root/myrootfs none init
ae18c4281d5755a1e153a7bff6b3b4881f36c8e528b9baba8a3278416a5d0980
[root@localhost ~]# lsmod | grep ip_vs
ip_vs_wrr 16384 0
@@ -48,6 +48,6 @@ libcrc32c 16384 3 nf_conntrack,nf_nat,ip_vs
```
> **NOTE:**
->- isulad-tools must be installed on the host.
->- **--hooks-spec** must be set to **isulad hooks**.
+>- syscontainer-tools must be installed on the host.
+>- **--hooks-spec** must be set to **syscontainer hooks**.
diff --git a/content/en/docs/Container/installation-guideline.md b/content/en/docs/Container/installation-guideline.md
index d034dd8e0..386345cc0 100644
--- a/content/en/docs/Container/installation-guideline.md
+++ b/content/en/docs/Container/installation-guideline.md
@@ -9,7 +9,7 @@
2. Install dependent packages of system containers.
```
- # yum install isulad-tools authz isulad-lxcfs-toolkit lxcfs
+ # yum install syscontainer-tools authz lxcfs-tools lxcfs
```
3. Run the following command to check whether iSulad is started:
diff --git a/content/en/docs/Container/nic-management.md b/content/en/docs/Container/nic-management.md
index f6baf08e3..e307e66ad 100644
--- a/content/en/docs/Container/nic-management.md
+++ b/content/en/docs/Container/nic-management.md
@@ -2,12 +2,12 @@
## Function Description
-isulad-tools allows you to insert physical or virtual NICs on the host to a container. If the NICs are not required, isulad-tools allows you to delete them from the container and return them to the host. In addition, the NIC configurations can be dynamically modified. To insert a physical NIC, add the NIC on the host to the container. To insert a virtual NIC, create a veth pair and insert its one end to the container.
+syscontainer-tools allows you to insert physical or virtual NICs on the host to a container. If the NICs are not required, syscontainer-tools allows you to delete them from the container and return them to the host. In addition, the NIC configurations can be dynamically modified. To insert a physical NIC, add the NIC on the host to the container. To insert a virtual NIC, create a veth pair and insert its one end to the container.
## Command Format
```
-isulad-tools [COMMADN][OPTIONS]
+syscontainer-tools [COMMADN][OPTIONS]
```
In the preceding format:
@@ -69,18 +69,18 @@ In the preceding format:
- Physical NICs \(eth\) and virtual NICs \(veth\) can be added.
- When adding a NIC, you can also configure the NIC. The configuration parameters include **--ip**, **--mac**, **--bridge**, **--mtu**, **--qlen**.
- A maximum of eight physical NICs can be added to a container.
-- If you run the **isulad-tools add-nic** command to add an eth NIC to a container and do not add a hook, you must manually delete the NIC before the container exits. Otherwise, the name of the eth NIC on the host will be changed to the name of that in the container.
+- If you run the **syscontainer-tools add-nic** command to add an eth NIC to a container and do not add a hook, you must manually delete the NIC before the container exits. Otherwise, the name of the eth NIC on the host will be changed to the name of that in the container.
- For a physical NIC \(except 1822 VF NIC\), use the original MAC address when running the **add-nic** command. Do not change the MAC address in the container, or when running the **update-nic** command.
-- When using the **isulad-tools add-nic** command, set the MTU value. The value range depends on the NIC model.
-- When using isulad-tools to add NICs and routes to containers, you are advised to run the **add-nic** command to add NICs and then run the **add-route** command to add routes. When using isulad-tools to delete NICs and routes from a container, you are advised to run the **remove-route** command to delete routes and then run the **remove-nic** command to delete NICs.
-- When using isulad-tools to add NICs, add a NIC to only one container.
+- When using the **syscontainer-tools add-nic** command, set the MTU value. The value range depends on the NIC model.
+- When using syscontainer-tools to add NICs and routes to containers, you are advised to run the **add-nic** command to add NICs and then run the **add-route** command to add routes. When using syscontainer-tools to delete NICs and routes from a container, you are advised to run the **remove-route** command to delete routes and then run the **remove-nic** command to delete NICs.
+- When using syscontainer-tools to add NICs, add a NIC to only one container.
## Example
-- Start a system container, and set **hook spec** to the isulad hook execution script.
+- Start a system container, and set **hook spec** to the syscontainer hook execution script.
```
- [root@localhost ~]# isula run -tid --hook-spec /etc/isulad-tools/hookspec.json --system-container --external-rootfs /root/root-fs none init
+ [root@localhost ~]# isula run -tid --hook-spec /etc/syscontainer-tools/hookspec.json --system-container --external-rootfs /root/root-fs none init
2aaca5c1af7c872798dac1a468528a2ccbaf20b39b73fc0201636936a3c32aa8
```
@@ -88,14 +88,14 @@ In the preceding format:
- Add a virtual NIC to a container.
```
- [root@localhost ~]# isulad-tools add-nic --type "veth" --name abc2:bcd2 --ip 172.17.28.5/24 --mac 00:ff:48:13:xx:xx --bridge docker0 2aaca5c1af7c
+ [root@localhost ~]# syscontainer-tools add-nic --type "veth" --name abc2:bcd2 --ip 172.17.28.5/24 --mac 00:ff:48:13:xx:xx --bridge docker0 2aaca5c1af7c
Add network interface to container 2aaca5c1af7c (bcd2,abc2) done
```
- Add a physical NIC to a container.
```
- [root@localhost ~]# isulad-tools add-nic --type "eth" --name eth3:eth1 --ip 172.17.28.6/24 --mtu 1300 --qlen 2100 2aaca5c1af7c
+ [root@localhost ~]# syscontainer-tools add-nic --type "eth" --name eth3:eth1 --ip 172.17.28.6/24 --mtu 1300 --qlen 2100 2aaca5c1af7c
Add network interface to container 2aaca5c1af7c (eth3,eth1) done
```
diff --git a/content/en/docs/Container/proc-file-system-isolation-(lxcfs).md b/content/en/docs/Container/proc-file-system-isolation-(lxcfs).md
index 298df2667..621437140 100644
--- a/content/en/docs/Container/proc-file-system-isolation-(lxcfs).md
+++ b/content/en/docs/Container/proc-file-system-isolation-(lxcfs).md
@@ -6,12 +6,12 @@ Container virtualization is lightweight and efficient, and can be quickly deploy
## API Description
-A system container provides two tool packages: lxcfs and lxcfs-toolkit, which are used together. Lxcfs resides on the host as the daemon process. lxcfs-toolkit mounts the lxcfs file system of the host to containers through the hook mechanism.
+A system container provides two tool packages: lxcfs and lxcfs-tools, which are used together. Lxcfs resides on the host as the daemon process. lxcfs-tools mounts the lxcfs file system of the host to containers through the hook mechanism.
-The command line of lxcfs-toolkit is as follows:
+The command line of lxcfs-tools is as follows:
```
-lxcfs-toolkit [OPTIONS] COMMAND [COMMAND_OPTIONS]
+lxcfs-tools [OPTIONS] COMMAND [COMMAND_OPTIONS]
```
@@ -76,10 +76,10 @@ lxcfs-toolkit [OPTIONS] COMMAND [COMMAND_OPTIONS]
## Example
-1. Install the lxcfs and lxcfs-toolkit packages and start the lxcfs service.
+1. Install the lxcfs and lxcfs-tools packages and start the lxcfs service.
```
- [root@localhost ~]# yum install lxcfs lxcfs-toolkit
+ [root@localhost ~]# yum install lxcfs lxcfs-tools
[root@localhost ~]# systemctl start lxcfs
```
diff --git a/content/en/docs/Container/route-management.md b/content/en/docs/Container/route-management.md
index c784738ef..ee3a56579 100644
--- a/content/en/docs/Container/route-management.md
+++ b/content/en/docs/Container/route-management.md
@@ -2,12 +2,12 @@
## Function Description
-isulad-tools can be used to dynamically add or delete routing tables for system containers.
+syscontainer-tools can be used to dynamically add or delete routing tables for system containers.
## Command Format
```
-isulad-tools [COMMADN][OPTIONS] [ARG...]
+syscontainer-tools [COMMADN][OPTIONS] [ARG...]
```
In the preceding format:
@@ -74,31 +74,31 @@ In the preceding format:
## Constraints
-- When using isulad-tools to add NICs and routes to containers, you are advised to run the **add-nic** command to add NICs and then run the **add-route** command to add routes. When using isulad-tools to delete NICs and routes from a container, you are advised to run the **remove-route** command to delete routes and then run the **remove-nic** command to delete NICs.
+- When using syscontainer-tools to add NICs and routes to containers, you are advised to run the **add-nic** command to add NICs and then run the **add-route** command to add routes. When using syscontainer-tools to delete NICs and routes from a container, you are advised to run the **remove-route** command to delete routes and then run the **remove-nic** command to delete NICs.
- When adding a routing rule to a container, ensure that the added routing rule does not conflict with existing routing rules in the container.
## Example
-- Start a system container, and set **hook spec** to the isulad hook execution script.
+- Start a system container, and set **hook spec** to the syscontainer hook execution script.
```
- [root@localhost ~]# isula run -tid --hook-spec /etc/isulad-tools/hookspec.json --system-container --external-rootfs /root/root-fs none init
+ [root@localhost ~]# isula run -tid --hook-spec /etc/syscontainer-tools/hookspec.json --system-container --external-rootfs /root/root-fs none init
0d2d68b45aa0c1b8eaf890c06ab2d008eb8c5d91e78b1f8fe4d37b86fd2c190b
```
-- Use isulad-tools to add a physical NIC to the system container.
+- Use syscontainer-tools to add a physical NIC to the system container.
```
- [root@localhost ~]# isulad-tools add-nic --type "eth" --name enp4s0:eth123 --ip 172.17.28.6/24 --mtu 1300 --qlen 2100 0d2d68b45aa0
+ [root@localhost ~]# syscontainer-tools add-nic --type "eth" --name enp4s0:eth123 --ip 172.17.28.6/24 --mtu 1300 --qlen 2100 0d2d68b45aa0
Add network interface (enp4s0) to container (0d2d68b45aa0,eth123) done
```
-- isulad-tools adds a routing rule to the system container. Format example: **\[\{"dest":"default", "gw":"192.168.10.1"\},\{"dest":"192.168.0.0/16","dev":"eth0","src":"192.168.1.2"\}\]**. If **dest** is left blank, its value will be **default**.
+- syscontainer-tools adds a routing rule to the system container. Format example: **\[\{"dest":"default", "gw":"192.168.10.1"\},\{"dest":"192.168.0.0/16","dev":"eth0","src":"192.168.1.2"\}\]**. If **dest** is left blank, its value will be **default**.
```
- [root@localhost ~]# isulad-tools add-route 0d2d68b45aa0 '[{"dest":"172.17.28.0/32", "gw":"172.17.28.5","dev":"eth123"}]'
+ [root@localhost ~]# syscontainer-tools add-route 0d2d68b45aa0 '[{"dest":"172.17.28.0/32", "gw":"172.17.28.5","dev":"eth123"}]'
Add route to container 0d2d68b45aa0, route: {dest:172.17.28.0/32,src:,gw:172.17.28.5,dev:eth123} done
```
diff --git a/content/en/docs/Container/volume-mounting-management.md b/content/en/docs/Container/volume-mounting-management.md
index f9b4c12fb..ac5e094d8 100644
--- a/content/en/docs/Container/volume-mounting-management.md
+++ b/content/en/docs/Container/volume-mounting-management.md
@@ -2,12 +2,12 @@
## Function Description
-In a common container, you can set the **--volume** parameter during container creation to mount directories or volumes of the host to the container for resource sharing. However, during container running, you cannot unmount directories or volumes that are mounted to the container, or mount directories or volumes of the host to the container. Only the system container can use the isulad-tools tool to dynamically mount directories or volumes of the host to the container and unmount directories or volumes from the container.
+In a common container, you can set the **--volume** parameter during container creation to mount directories or volumes of the host to the container for resource sharing. However, during container running, you cannot unmount directories or volumes that are mounted to the container, or mount directories or volumes of the host to the container. Only the system container can use the syscontainer-tools tool to dynamically mount directories or volumes of the host to the container and unmount directories or volumes from the container.
## Command Format
```
-isulad-tools [COMMADN][OPTIONS] [ARG...]
+syscontainer-tools [COMMADN][OPTIONS] [ARG...]
```
In the preceding format:
@@ -83,18 +83,18 @@ In the preceding format:
## Example
-- Start a system container, and set **hook spec** to the isulad hook execution script.
+- Start a system container, and set **hook spec** to the syscontainer hook execution script.
```
- [root@localhost ~]# isula run -tid --hook-spec /etc/isulad-tools/hookspec.json --system-container --external-rootfs /root/root-fs none init
+ [root@localhost ~]# isula run -tid --hook-spec /etc/syscontainer-tools/hookspec.json --system-container --external-rootfs /root/root-fs none init
e45970a522d1ea0e9cfe382c2b868d92e7b6a55be1dd239947dda1ee55f3c7f7
```
-- Use isulad-tools to mount a directory on the host to a container, implementing resource sharing.
+- Use syscontainer-tools to mount a directory on the host to a container, implementing resource sharing.
```
- [root@localhost ~]# isulad-tools add-path e45970a522d1 /home/test123:/home/test123
+ [root@localhost ~]# syscontainer-tools add-path e45970a522d1 /home/test123:/home/test123
Add path (/home/test123) to container(e45970a522d1,/home/test123) done.
```
@@ -107,10 +107,10 @@ In the preceding format:
hello world
```
-- Use isulad-tools to delete the mount directory from the container.
+- Use syscontainer-tools to delete the mount directory from the container.
```
- [root@localhost ~]# isulad-tools remove-path e45970a522d1 /home/test123:/home/test123
+ [root@localhost ~]# syscontainer-tools remove-path e45970a522d1 /home/test123:/home/test123
Remove path (/home/test123) from container(e45970a522d1,/home/test123) done
[root@localhost ~]# isula exec e45970a522d1 bash
[root@localhost /]# ls /home/test123/helloworld
diff --git "a/content/zh/docs/Container/\345\212\250\346\200\201\345\212\240\350\275\275\345\206\205\346\240\270\346\250\241\345\235\227.md" "b/content/zh/docs/Container/\345\212\250\346\200\201\345\212\240\350\275\275\345\206\205\346\240\270\346\250\241\345\235\227.md"
index 2e5edd1d0..d5c65f9e4 100644
--- "a/content/zh/docs/Container/\345\212\250\346\200\201\345\212\240\350\275\275\345\206\205\346\240\270\346\250\241\345\235\227.md"
+++ "b/content/zh/docs/Container/\345\212\250\346\200\201\345\212\240\350\275\275\345\206\205\346\240\270\346\250\241\345\235\227.md"
@@ -2,7 +2,7 @@
## 功能描述
-容器内业务可能依赖某些内核模块,可通过设置环境变量的方式,在系统容器启动前动态加载容器中业务需要的内核模块到宿主机,此特性需要配合isulad-hooks一起使用,具体使用可参看"容器资源动态管理(syscontainer-tools)"章节。
+容器内业务可能依赖某些内核模块,可通过设置环境变量的方式,在系统容器启动前动态加载容器中业务需要的内核模块到宿主机,此特性需要配合syscontainer-hooks一起使用,具体使用可参看"容器资源动态管理(syscontainer-tools)"章节。
## 参数说明
@@ -28,7 +28,7 @@
## 约束限制
- 如果加载的内核模块是未经过验证的,或者跟宿主机已有模块冲突的场景,会导致宿主机出现不可预知问题,在做加载内核模块时需要谨慎操作。
-- 动态加载内核模块通过将需要加载的内核模块传递给容器,此功能是依靠isulad-tools捕获到容器启动的环境变量实现,依赖isulad-tools的正确安装部署。
+- 动态加载内核模块通过将需要加载的内核模块传递给容器,此功能是依靠syscontainer-tools捕获到容器启动的环境变量实现,依赖syscontainer-tools的正确安装部署。
- 加载的内核模块需要手动进行删除。
## 使用示例
@@ -37,7 +37,7 @@
```
[root@localhost ~]# lsmod | grep ip_vs
-[root@localhost ~]# isula run -tid -e KERNEL_MODULES=ip_vs,ip_vs_wrr --hook-spec /etc/isulad-tools/hookspec.json --system-container --external-rootfs /root/myrootfs none init
+[root@localhost ~]# isula run -tid -e KERNEL_MODULES=ip_vs,ip_vs_wrr --hook-spec /etc/syscontainer-tools/hookspec.json --system-container --external-rootfs /root/myrootfs none init
ae18c4281d5755a1e153a7bff6b3b4881f36c8e528b9baba8a3278416a5d0980
[root@localhost ~]# lsmod | grep ip_vs
ip_vs_wrr 16384 0
@@ -48,6 +48,6 @@ libcrc32c 16384 3 nf_conntrack,nf_nat,ip_vs
```
> **说明:**
->- 宿主机需要安装isulad-tools。
->- 需要指定--hooks-spec为isulad hooks。
+>- 宿主机需要安装syscontainer-tools。
+>- 需要指定--hooks-spec为syscontainer hooks。
diff --git "a/content/zh/docs/Container/\345\256\211\345\205\250\346\200\247\345\222\214\351\232\224\347\246\273\346\200\247.md" "b/content/zh/docs/Container/\345\256\211\345\205\250\346\200\247\345\222\214\351\232\224\347\246\273\346\200\247.md"
index 7f85248df..200736c81 100644
--- "a/content/zh/docs/Container/\345\256\211\345\205\250\346\200\247\345\222\214\351\232\224\347\246\273\346\200\247.md"
+++ "b/content/zh/docs/Container/\345\256\211\345\205\250\346\200\247\345\222\214\351\232\224\347\246\273\346\200\247.md"
@@ -213,12 +213,12 @@ exit
### 接口说明
-系统容器对外提供两个工具包:一个是lxcfs软件,另外一个是配合lxcfs一起使用的lxcfs-toolkit工具。其中lxcfs作为宿主机daemon进程常驻,lxcfs-toolkit通过hook机制将宿主机的lxcfs文件系统绑定挂载到容器。
+系统容器对外提供两个工具包:一个是lxcfs软件,另外一个是配合lxcfs一起使用的lxcfs-tools工具。其中lxcfs作为宿主机daemon进程常驻,lxcfs-tools通过hook机制将宿主机的lxcfs文件系统绑定挂载到容器。
-lxcfs-toolkit命令行格式如下:
+lxcfs-tools命令行格式如下:
```
-lxcfs-toolkit [OPTIONS] COMMAND [COMMAND_OPTIONS]
+lxcfs-tools [OPTIONS] COMMAND [COMMAND_OPTIONS]
```
@@ -283,10 +283,10 @@ lxcfs-toolkit [OPTIONS] COMMAND [COMMAND_OPTIONS]
### 使用示例
-1. 首先需要安装lxcfs和lxcfs-toolkit这两个包,并启动lxcfs服务。
+1. 首先需要安装lxcfs和lxcfs-tools这两个包,并启动lxcfs服务。
```
- [root@localhost ~]# yum install lxcfs lxcfs-toolkit
+ [root@localhost ~]# yum install lxcfs lxcfs-tools
[root@localhost ~]# systemctl start lxcfs
```
diff --git "a/content/zh/docs/Container/\345\256\211\350\243\205\346\214\207\345\257\274.md" "b/content/zh/docs/Container/\345\256\211\350\243\205\346\214\207\345\257\274.md"
index 204899cbe..fbcd663a6 100644
--- "a/content/zh/docs/Container/\345\256\211\350\243\205\346\214\207\345\257\274.md"
+++ "b/content/zh/docs/Container/\345\256\211\350\243\205\346\214\207\345\257\274.md"
@@ -12,7 +12,7 @@
2. 安装系统容器依赖包。
```
- # yum install isulad-tools authz isulad-lxcfs-toolkit lxcfs
+ # yum install syscontainer-tools authz lxcfs-tools lxcfs
```
3. 查看iSulad是否已经启动。
diff --git "a/content/zh/docs/Container/\345\256\271\345\231\250\350\265\204\346\272\220\345\212\250\346\200\201\347\256\241\347\220\206.md" "b/content/zh/docs/Container/\345\256\271\345\231\250\350\265\204\346\272\220\345\212\250\346\200\201\347\256\241\347\220\206.md"
index 720cb8835..c09fa4af2 100644
--- "a/content/zh/docs/Container/\345\256\271\345\231\250\350\265\204\346\272\220\345\212\250\346\200\201\347\256\241\347\220\206.md"
+++ "b/content/zh/docs/Container/\345\256\271\345\231\250\350\265\204\346\272\220\345\212\250\346\200\201\347\256\241\347\220\206.md"
@@ -19,12 +19,12 @@
### 功能描述
-isulad-tools支持将宿主机上的块设备(比如磁盘、LVM)或字符设备(比如GPU、binner、fuse)添加到容器中。在容器中使用该设备,例如可以对磁盘进行fdisk格式化,写入fs等操作。在容器不需要设备时,isulad-tools可以将设备从容器中删除,归还宿主机。
+syscontainer-tools支持将宿主机上的块设备(比如磁盘、LVM)或字符设备(比如GPU、binner、fuse)添加到容器中。在容器中使用该设备,例如可以对磁盘进行fdisk格式化,写入fs等操作。在容器不需要设备时,syscontainer-tools可以将设备从容器中删除,归还宿主机。
### 命令格式
```
-isulad-tools [COMMADN][OPTIONS] [ARG...]
+syscontainer-tools [COMMADN][OPTIONS] [ARG...]
```
其中:
@@ -104,16 +104,16 @@ ARG:命令对应的参数。
- 添加/删除设备的时机可以是容器实例非运行状态,完成操作后启动容器,容器内会有体现;也可以在容器运行时(running)动态添加。
- 不能在容器内和host上并发进行fdisk对磁盘的格式化写入,会影响容器磁盘使用。
-- add-device将磁盘添加到容器的特定目录时,如果容器内的父目录为多级目录(比如/dev/a/b/c/d/e...)且目录层级不存在,则isulad-tools会自动在容器内创建对应目录;当删除时,不会将创建的父目录删除。如果用户下一次add-device到该父目录,则会提示已经存在无法添加成功。
+- add-device将磁盘添加到容器的特定目录时,如果容器内的父目录为多级目录(比如/dev/a/b/c/d/e...)且目录层级不存在,则syscontainer-tools会自动在容器内创建对应目录;当删除时,不会将创建的父目录删除。如果用户下一次add-device到该父目录,则会提示已经存在无法添加成功。
- add-device添加磁盘、更新磁盘参数时,配置磁盘Qos;当配置磁盘Qos的read/write bps、read/write IOPS值时,不建议配置值过小,当设置过小时,会造成磁盘表现为不可读(实际原因是速度过慢),最终影响业务功能。
- 使用--blkio-weight-device来限制指定块设备的权重,如果当前块设备仅支持BFQ模式,可能会报错,提示用户检查当前OS环境是否支持BFQ块设备权重值设置。
### 使用示例
-- 启动一个系统容器,指定hook spec为isulad hook执行配置脚本
+- 启动一个系统容器,指定hook spec为syscontainer hook执行配置脚本
```
- [root@localhost ~]# isula run -tid --hook-spec /etc/isulad-tools/hookspec.json --system-container --external-rootfs /root/root-fs none init
+ [root@localhost ~]# isula run -tid --hook-spec /etc/syscontainer-tools/hookspec.json --system-container --external-rootfs /root/root-fs none init
eed1096c8c7a0eca6d92b1b3bc3dd59a2a2adf4ce44f18f5372408ced88f8350
```
@@ -121,7 +121,7 @@ ARG:命令对应的参数。
- 添加一个块设备到容器
```
- [root@localhost ~]# isulad-tools add-device ee /dev/sdb:/dev/sdb123
+ [root@localhost ~]# syscontainer-tools add-device ee /dev/sdb:/dev/sdb123
Add device (/dev/sdb) to container(ee,/dev/sdb123) done.
[root@localhost ~]# isula exec ee fdisk -l /dev/sdb123
Disk /dev/sdb123: 50 GiB, 53687091200 bytes, 104857600 sectors
@@ -139,14 +139,14 @@ ARG:命令对应的参数。
- 更新设备信息
```
- [root@localhost ~]# isulad-tools update-device --device-read-bps /dev/sdb:10m ee
+ [root@localhost ~]# syscontainer-tools update-device --device-read-bps /dev/sdb:10m ee
Update read bps for device (/dev/sdb,10485760) done.
```
- 删除设备
```
- [root@localhost ~]# isulad-tools remove-device ee /dev/sdb:/dev/sdb123
+ [root@localhost ~]# syscontainer-tools remove-device ee /dev/sdb:/dev/sdb123
Remove device (/dev/sdb) from container(ee,/dev/sdb123) done.
Remove read bps for device (/dev/sdb) done.
```
@@ -156,12 +156,12 @@ ARG:命令对应的参数。
### 功能描述
-isulad-tools支持将宿主机上的物理网卡或虚拟网卡插入到容器,在不使用网卡的时候从容器中删除归还给宿主机,并且可以动态修改网卡配置。插入物理网卡即把宿主机上一块网卡直接添加到容器中,插入虚拟网卡则需要先创建一对veth pair,之后将一端插入到容器中。
+syscontainer-tools支持将宿主机上的物理网卡或虚拟网卡插入到容器,在不使用网卡的时候从容器中删除归还给宿主机,并且可以动态修改网卡配置。插入物理网卡即把宿主机上一块网卡直接添加到容器中,插入虚拟网卡则需要先创建一对veth pair,之后将一端插入到容器中。
### 命令格式
```
-isulad-tools [COMMADN][OPTIONS]
+syscontainer-tools [COMMADN][OPTIONS]
```
其中:
@@ -223,18 +223,18 @@ container\_id:容器id。
- 支持添加物理网卡(eth)和虚拟网卡(veth)两种类型。
- 在添加网卡时可以同时对网卡进行配置,参数包括--ip/--mac/--bridge/--mtu/--qlen。
- 支持最多添加8个物理网卡到容器。
-- 使用isulad-tools add-nic向容器添加eth网卡后,如果不加hook,在容器退出前必须手工将nic删除,否则在host上的eth网卡的名字会被更改成容器内的名字。
+- 使用syscontainer-tools add-nic向容器添加eth网卡后,如果不加hook,在容器退出前必须手工将nic删除,否则在host上的eth网卡的名字会被更改成容器内的名字。
- 对于物理网卡(1822 vf网卡除外),add-nic必须使用原mac地址,update-nic禁止修改mac地址,容器内也不允许修改mac地址。
-- 使用isulad-tools add-nic时,设置mtu值,设置范围跟具体的网卡型号有关。
-- 使用isulad-tools向容器添加网卡和路由时,建议先执行add-nic添加网卡,然后执行add-route添加路由;使用isulad-tools从容器删除网卡和路由时,建议先执行remove-route删除路由,然后执行remove-nic删除网卡。
-- 使用isulad-tools添加网卡时,一块网卡只能添加到一个容器中。
+- 使用syscontainer-tools add-nic时,设置mtu值,设置范围跟具体的网卡型号有关。
+- 使用syscontainer-tools向容器添加网卡和路由时,建议先执行add-nic添加网卡,然后执行add-route添加路由;使用syscontainer-tools从容器删除网卡和路由时,建议先执行remove-route删除路由,然后执行remove-nic删除网卡。
+- 使用syscontainer-tools添加网卡时,一块网卡只能添加到一个容器中。
### 使用示例
-- 启动一个系统容器,指定hook spec为isulad hook执行配置脚本:
+- 启动一个系统容器,指定hook spec为syscontainer hook执行配置脚本:
```
- [root@localhost ~]# isula run -tid --hook-spec /etc/isulad-tools/hookspec.json --system-container --external-rootfs /root/root-fs none init
+ [root@localhost ~]# isula run -tid --hook-spec /etc/syscontainer-tools/hookspec.json --system-container --external-rootfs /root/root-fs none init
2aaca5c1af7c872798dac1a468528a2ccbaf20b39b73fc0201636936a3c32aa8
```
@@ -242,14 +242,14 @@ container\_id:容器id。
- 添加一个虚拟网卡到容器
```
- [root@localhost ~]# isulad-tools add-nic --type "veth" --name abc2:bcd2 --ip 172.17.28.5/24 --mac 00:ff:48:13:xx:xx --bridge docker0 2aaca5c1af7c
+ [root@localhost ~]# syscontainer-tools add-nic --type "veth" --name abc2:bcd2 --ip 172.17.28.5/24 --mac 00:ff:48:13:xx:xx --bridge docker0 2aaca5c1af7c
Add network interface to container 2aaca5c1af7c (bcd2,abc2) done
```
- 添加一个物理网卡到容器
```
- [root@localhost ~]# isulad-tools add-nic --type "eth" --name eth3:eth1 --ip 172.17.28.6/24 --mtu 1300 --qlen 2100 2aaca5c1af7c
+ [root@localhost ~]# syscontainer-tools add-nic --type "eth" --name eth3:eth1 --ip 172.17.28.6/24 --mtu 1300 --qlen 2100 2aaca5c1af7c
Add network interface to container 2aaca5c1af7c (eth3,eth1) done
```
@@ -261,12 +261,12 @@ container\_id:容器id。
### 功能描述
-isulad-tools工具可以对系统容器进行动态添加/删除路由表。
+syscontainer-tools工具可以对系统容器进行动态添加/删除路由表。
### 命令格式
```
-isulad-tools [COMMADN][OPTIONS] [ARG...]
+syscontainer-tools [COMMADN][OPTIONS] [ARG...]
```
其中:
@@ -333,31 +333,31 @@ ARG:命令对应的参数。
### 约束限制
-- 使用isulad-tools向容器添加网卡和路由时,建议先执行add-nic添加网卡,然后执行add-route添加路由;使用isulad-tools从容器删除网卡和路由时,建议先执行remove-route删除路由,然后执行remove-nic删除网卡。
+- 使用syscontainer-tools向容器添加网卡和路由时,建议先执行add-nic添加网卡,然后执行add-route添加路由;使用syscontainer-tools从容器删除网卡和路由时,建议先执行remove-route删除路由,然后执行remove-nic删除网卡。
- 向容器内添加路由规则时,需确保所添加的路由规则与容器内现有的路由规则不会产生冲突。
### 使用示例
-- 启动一个系统容器,指定hook spec为isulad hook执行配置脚本:
+- 启动一个系统容器,指定hook spec为syscontainer hook执行配置脚本:
```
- [root@localhost ~]# isula run -tid --hook-spec /etc/isulad-tools/hookspec.json --system-container --external-rootfs /root/root-fs none init
+ [root@localhost ~]# isula run -tid --hook-spec /etc/syscontainer-tools/hookspec.json --system-container --external-rootfs /root/root-fs none init
0d2d68b45aa0c1b8eaf890c06ab2d008eb8c5d91e78b1f8fe4d37b86fd2c190b
```
-- isulad-tools向系统容器添加一块物理网卡:
+- syscontainer-tools向系统容器添加一块物理网卡:
```
- [root@localhost ~]# isulad-tools add-nic --type "eth" --name enp4s0:eth123 --ip 172.17.28.6/24 --mtu 1300 --qlen 2100 0d2d68b45aa0
+ [root@localhost ~]# syscontainer-tools add-nic --type "eth" --name enp4s0:eth123 --ip 172.17.28.6/24 --mtu 1300 --qlen 2100 0d2d68b45aa0
Add network interface (enp4s0) to container (0d2d68b45aa0,eth123) done
```
-- isulad-tools添加一条路由规则到系统容器,注意格式需按照'\[\{"dest":"default", "gw":"192.168.10.1"\},\{"dest":"192.168.0.0/16","dev":"eth0","src":"192.168.1.2"\}\]'来配置。如果dest为空会自动填成default。
+- syscontainer-tools添加一条路由规则到系统容器,注意格式需按照'\[\{"dest":"default", "gw":"192.168.10.1"\},\{"dest":"192.168.0.0/16","dev":"eth0","src":"192.168.1.2"\}\]'来配置。如果dest为空会自动填成default。
```
- [root@localhost ~]# isulad-tools add-route 0d2d68b45aa0 '[{"dest":"172.17.28.0/32", "gw":"172.17.28.5","dev":"eth123"}]'
+ [root@localhost ~]# syscontainer-tools add-route 0d2d68b45aa0 '[{"dest":"172.17.28.0/32", "gw":"172.17.28.5","dev":"eth123"}]'
Add route to container 0d2d68b45aa0, route: {dest:172.17.28.0/32,src:,gw:172.17.28.5,dev:eth123} done
```
@@ -376,12 +376,12 @@ ARG:命令对应的参数。
### 功能描述
-普通容器仅支持在创建时指定--volume参数将宿主机的目录/卷挂载到容器实现资源共享,但是无法在容器运行时将挂载到容器中的目录/卷卸载掉,也不支持将宿主机的目录/卷挂载到容器。系统容器可以通过isulad-tools工具实现动态将宿主机的目录/卷挂载到容器,以及将容器中的目录/卷进行卸载。
+普通容器仅支持在创建时指定--volume参数将宿主机的目录/卷挂载到容器实现资源共享,但是无法在容器运行时将挂载到容器中的目录/卷卸载掉,也不支持将宿主机的目录/卷挂载到容器。系统容器可以通过syscontainer-tools工具实现动态将宿主机的目录/卷挂载到容器,以及将容器中的目录/卷进行卸载。
### 命令格式
```
-isulad-tools [COMMADN][OPTIONS] [ARG...]
+syscontainer-tools [COMMADN][OPTIONS] [ARG...]
```
其中:
@@ -455,18 +455,18 @@ ARG:命令对应的参数。
### 使用示例
-- 启动一个系统容器,指定hook spec为isulad hook执行配置脚本:
+- 启动一个系统容器,指定hook spec为syscontainer hook执行配置脚本:
```
- [root@localhost ~]# isula run -tid --hook-spec /etc/isulad-tools/hookspec.json --system-container --external-rootfs /root/root-fs none init
+ [root@localhost ~]# isula run -tid --hook-spec /etc/syscontainer-tools/hookspec.json --system-container --external-rootfs /root/root-fs none init
e45970a522d1ea0e9cfe382c2b868d92e7b6a55be1dd239947dda1ee55f3c7f7
```
-- isulad-tools将宿主机某个目录挂载到容器,实现资源共享:
+- syscontainer-tools将宿主机某个目录挂载到容器,实现资源共享:
```
- [root@localhost ~]# isulad-tools add-path e45970a522d1 /home/test123:/home/test123
+ [root@localhost ~]# syscontainer-tools add-path e45970a522d1 /home/test123:/home/test123
Add path (/home/test123) to container(e45970a522d1,/home/test123) done.
```
@@ -479,10 +479,10 @@ ARG:命令对应的参数。
hello world
```
-- isulad-tools将挂载目录从容器内删除:
+- syscontainer-tools将挂载目录从容器内删除:
```
- [root@localhost ~]# isulad-tools remove-path e45970a522d1 /home/test123:/home/test123
+ [root@localhost ~]# syscontainer-tools remove-path e45970a522d1 /home/test123:/home/test123
Remove path (/home/test123) from container(e45970a522d1,/home/test123) done
[root@localhost ~]# isula exec e45970a522d1 bash
[root@localhost /]# ls /home/test123/helloworld
--
Gitee
From c3a39d8a772db9eeaa1b76a832723cfdd488ef82 Mon Sep 17 00:00:00 2001
From: fhxing168
Date: Thu, 18 Jun 2020 10:14:58 +0800
Subject: [PATCH 21/22] Fixes issues.
---
.../configuring-the-repo-server.md | 4 +-
...ing-the-dnf-to-manage-software-packages.md | 110 ++++++++++++------
.../ApplicationDev/building-an-rpm-package.md | 3 +-
content/en/docs/ApplicationDev/preparation.md | 14 ++-
...06\350\275\257\344\273\266\345\214\205.md" | 104 +++++++++++------
...po\346\234\215\345\212\241\345\231\250.md" | 2 +-
...57\345\242\203\345\207\206\345\244\207.md" | 13 ++-
...346\236\204\345\273\272RPM\345\214\205.md" | 3 +-
8 files changed, 161 insertions(+), 92 deletions(-)
diff --git a/content/en/docs/Administration/configuring-the-repo-server.md b/content/en/docs/Administration/configuring-the-repo-server.md
index 4fa5736ab..4f5191adc 100644
--- a/content/en/docs/Administration/configuring-the-repo-server.md
+++ b/content/en/docs/Administration/configuring-the-repo-server.md
@@ -283,8 +283,8 @@ You can configure the built repo as the yum source and create the \*\*\*.repo co
```
> **NOTE:**
- > _gpgcheck_ indicates whether to enable the GNU privacy guard \(GPG\) to check the validity and security of sources of RPM packages. **1** indicates GPG check is enabled. **0** indicates the GPG check is disabled. If this option is not specified, the GPG check is enabled by default.
- > _gpgkey_ is the storage path of the signature public key.
+ > **gpgcheck** indicates whether to enable the GNU privacy guard \(GPG\) to check the validity and security of sources of RPM packages. **1** indicates GPG check is enabled. **0** indicates the GPG check is disabled. If this option is not specified, the GPG check is enabled by default.
+ > **gpgkey** is the public key used to verify the signature.
- Configuring the yum source for the HTTP server
diff --git a/content/en/docs/Administration/using-the-dnf-to-manage-software-packages.md b/content/en/docs/Administration/using-the-dnf-to-manage-software-packages.md
index f02692ab4..bf2291c95 100644
--- a/content/en/docs/Administration/using-the-dnf-to-manage-software-packages.md
+++ b/content/en/docs/Administration/using-the-dnf-to-manage-software-packages.md
@@ -9,7 +9,7 @@ DNF is a Linux software package management tool used to manage RPM software pack
- [Using the DNF to Manage Software Packages](#using-the-dnf-to-manage-software-packages)
- [Configuring the DNF](#configuring-the-dnf)
- - [Modifying the Configuration File](#modifying-the-configuration-file)
+ - [The DNF Configuration File](#the-dnf-configuration-file)
- [Creating a Local Software Repository](#creating-a-local-software-repository)
- [Adding, Enabling, and Disabling Software Sources](#adding-enabling-and-disabling-software-sources)
- [Managing Software Package](#managing-software-package)
@@ -35,15 +35,19 @@ DNF is a Linux software package management tool used to manage RPM software pack
-### Modifying the Configuration File
+### The DNF Configuration File
-The main configuration file of the DNF is /etc/dnf/dnf.conf. The **main** part in the file stores the global settings of the DNF. You can add one or more **repository** sections to the file to set the location of the software source to be installed.
+The main configuration file of the DNF is /etc/dnf/dnf.conf which consists of two parts:
-In addition, the /etc/yum.repos.d directory stores one or more repo source files, which define different repositories.
+- The **main** part in the file stores the global settings of the DNF.
-You can configure a software source by either directly configuring the /etc/dnf/dnf.conf file or adding the .repo file to the /etc/yum.repos.d directory.
+- The **repository** part in the file stores the settings of the software source. You can add one or more **repository** sections to the file.
-#### Modify the main Part
+In addition, the /etc/yum.repos.d directory stores one or more repo source files, which define different repositories.
+
+You can configure a software source by either directly configuring the /etc/dnf/dnf.conf file or configuring the .repo file in the /etc/yum.repos.d directory.
+
+#### Configuring the main Part
The /etc/dnf/dnf.conf file contains the **main** part. The following is an example of the configuration file:
```
@@ -99,7 +103,6 @@ Common options are as follows:
|
The options are 1 and 0, indicating whether to perform GPG verification. The default value is 1, indicating that verification is required.
|
-