代码之家  ›  专栏  ›  技术社区  ›  Sebi

为什么yum要在RHEL7上的yum update上重新创建默认nginx配置文件?

  •  0
  • Sebi  · 技术社区  · 7 年前

    我通过RHEL7上的yum软件包安装了nginx。我将配置添加为

    /etc/nginx/conf.d/my.conf
    

    并删除了软件包附带的配置文件

    /etc/nginx/conf.d/default.conf
    

    最近,通过yum更新更新了nginx包。现在,默认设置。conf文件再次出现。我本以为,如果更改或删除了默认配置文件,yum不会触及这些文件。

    这是正常的行为吗?下面是关于RHEL版本和nginx包的一些信息。

    root@host: [~]# yum info nginx
    Loaded plugins: langpacks, product-id, rhnplugin, search-disabled-repos
    This system is receiving updates from RHN Classic or Red Hat Satellite.
    Installed Packages
    Name        : nginx
    Arch        : x86_64
    Epoch       : 1
    Version     : 1.14.1
    Release     : 1.el7_4.ngx
    Size        : 2.6 M
    Repo        : installed
    From repo   : nginx
    Summary     : High performance web server
    URL         : http://nginx.org/
    License     : 2-clause BSD-like license
    Description : nginx [engine x] is an HTTP and reverse proxy server, as well as
                : a mail proxy server.
    

    我将包从1.14.0升级到上面所示的1.14.1版本。

    root@host: [~]# nginx -v
    nginx version: nginx/1.14.1
    

    Redhat版本:

    root@host: [~]# hostnamectl 
       Static hostname: host.example.com
             Icon name: computer-vm
               Chassis: vm
            Machine ID: SOME-ID
               Boot ID: ANOTHER-ID
        Virtualization: vmware
      Operating System: Red Hat Enterprise Linux
           CPE OS Name: cpe:/o:redhat:enterprise_linux:7.5:GA:server
                Kernel: Linux 3.10.0-862.14.4.el7.x86_64
          Architecture: x86-64
    

    如果我重命名我的。默认设置为conf。conf,它不会在yum更新中被替换。

    0 回复  |  直到 7 年前