[排错] Linux 解决使用 setfacl 命令时报错 “setfacl: …… : Operation not supported”

报错代码:

setfacl: ......: Operation not supported

解决方法 (添加 acl 参数):

临时解决方法(临时在挂载时添加 acl 参数):

# mount -o remount,acl /mnt

(补充:这里以给挂载的 /mnt 目录添加 acl 参数为例)

永久解决方法(永久在挂载时添加 acl 参数):

# vi /etc/fstab

将部分内容修改如下:

......
/dev/sda5 /mnt xfs defaults,acl 0 0
......

(补充:这里以给从硬盘 /dev/sda5 挂载到 /mnt 目录的目录添加 acl 参数为例)

[STEP] Limitation of the amount of the file which can be opened by Linux program

Step One: In system level, set the limitation of the amount of the files which can be opened by the user who running the Linux Program

# vi /etc/security/limites.conf

Add these lines:

......
rmt  -       nofile  1024
rmt  -       nproc   1024

(Add: Setting the rmt user can open 8192 files and 8192 processes in this Linux as an example here)

Step Two: In program level, check the setting of the amount of the files which can be opened by Linux program

# /bin/systemctl show 'rmt-server-mirror.service' | sort
......
LimitNOFILE=524288
......

(Add: The amount of opening the file by program rmt-server-mirror.service is limited at 8096 as an example here)

[步骤] Rocky Linux & RHEL 自定义 YUM 源的制作

步骤一:制作自定义 YUM 源

1.1 安装从软件源下载安装包和依赖包到本地的工具

# yum install yum-utils -y

(注意:这里假设的情况是本系统可以正常使用 YUM 安装软件)

1.2 获取某软件的安装包和此软件的依赖包

# yumdownloader --resolve --destdir /tmp/ansible ansible

(补充:这里以将 ansible 安装包和 ansible 的依赖包下载到本地的 /tmp/ansible 目录为例)


注意:
1) 这里建议直接下载软件名称比如这里的 ansible,而不是下载指定了具体版本的软件,如果下载制定了具体版本的软件,其对应的依赖包可能不会下载下来
2) 这里假设的情况是本系统可以正常使用 YUM 安装软件

1.3 获取生成 YUM 源的工具软件包

# yumdownloader --resolve --destdir /tmp/ansible createrepo

(补充:这里以将 createrepo 安装包和 createrepo 的依赖包下载到本地的 /tmp/ansible 目录为例)

(注意:这里假设的情况是本系统可以正常使用 YUM 安装软件)

1.4 制作 YUM 源

1.4.1 进入到软件的安装包、依赖包和生成 YUM 源的工具软件包所在的目录
# cd /tmp/ansible

(补充:这里以进入到目录 /tmp/ansible 为例)

1.4.2 安装生成 YUM 源的工具
# rpm -ivh createrepo_c & rpm -ivh createrepo_c-libs & rpm -ivh drpm


补充:这里安装的软件包有
1) createrepo_c
2) createrepo_c-libs
3) drpm

1.4.3 进入到上一级目录
# cd ../
1.4.4 创建 ansible 的 YUM 源
# createrepo ansible

(补充:这里以用 ansible 目录里的软件包创建 YUM 源为例)

步骤二:使用自定义 YUM 源

2.1 创建新的 repo 文件

# vim /etc/yum.repos.d/ansible.repo

创建以下内容:

[ansible]
name=ansible
baseurl=file:///tmp/ansible
gpgcheck=0
enabled=1


补充:这里以
1) 文件名为 ansible
2) 文件标题为 ansible
3) YUM 源的软件包位置在 /tmp/ansible
4) 不进行 gpgcheck 检测
5) 启用此 YUM 源
为例

2.2 使用自定义 YUM 源安装软件

# yum install ansible -y

(补充:这里以安装 ansible 软件为例)