1 (edited by jpbaril 2015-06-25 10:41:07)

Topic: Confused by .rpmnew conf files in upgrading process

======== Required information ====
- iRedMail version (check /etc/iredmail-release): in the process of updating to 0.9.2
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Apache
- Linux/BSD distribution name and version: CentOS 7
- Related log if you're reporting an issue:
====

Hi,

I did a 'yum update' and now I'm trying to follow upgrading tutorial for version 0.9.2.

I noticed that instead of merging conf files, yum just created new conf files.

How should I know how to merge these two files to have both new settings/changes from new package versions and also keep iredmail custom settings?

For exemple, let's take a look at Nginx conf files.

nginx.conf

user apache;
worker_processes 1;
pid /var/run/nginx.pid;

events {
    worker_connections 1024;
}

ht tp {
    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    # Hide Nginx version number
    server_tokens off;

    gzip on;
    keepalive_timeout 65;
    sendfile on;

    client_max_body_size 12m;
    types_hash_max_size 2048;

    include /etc/nginx/conf.d/*.conf;
}

nginx.conf.rmpnew

# For more information on configuration, see:
#   * Official English Documentation: nginx.org/en/docs/
#   * Official Russian Documentation: nginx.org/ru/docs/

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

events {
    worker_connections 1024;
}

ht tp {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$ht tp_referer" '
                      '"$ht tp_user_agent" "$ht tp_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  _;
        root         /usr/share/nginx/html;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }
}

The two are very different. It is even worse with /etc/amavisd/amavisd.conf and /etc/amavisd/amavisd.conf.rpmnew.

How can I know what to do with all these differences?

Do I need to merge the two files? And if so, how?
Or can I only keep one and disregard altogether the differences in the other? And if so, which one do I keep (and consequently, in which one do I apply the changes the tutorial ask for) ?

Thank you

BTW, I had to split every occurrence of 'http' in my post because it said I tried to include to many links. It took me long to think that maybe it tried to parse everything that began with ht tp to make it a link even if I did not use the url bbcode tag. I think you should tweak the forum configs because it will happen to many people and very often.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Confused by .rpmnew conf files in upgrading process

Short answer: you don't need to merge '.rpmnew' with existing files.

This is how rpm works, if it detects existing config file, it will create new config file as 'xxx.rpmnew'.

3

Re: Confused by .rpmnew conf files in upgrading process

But won't I miss settings (features) that could have been introduced in the new package version if I just keep as is my existing config file?

So, I can just delete all .rpmnew files ?

Thanks

4

Re: Confused by .rpmnew conf files in upgrading process

jpbaril wrote:

But won't I miss settings (features) that could have been introduced in the new package version if I just keep as is my existing config file?

It depends. If new packages introduce new settings which are missed in existing config file, this may cause issue.

jpbaril wrote:

So, I can just delete all .rpmnew files ?

Don't do this, just keep them.

5

Re: Confused by .rpmnew conf files in upgrading process

ZhangHuangbin wrote:
jpbaril wrote:

But won't I miss settings (features) that could have been introduced in the new package version if I just keep as is my existing config file?

It depends. If new packages introduce new settings which are missed in existing config file, this may cause issue.

Ok, so from what you say, I understand that in those cases you will tell us in the upgrade toturials as you did with the uwsgi package. Right?

6

Re: Confused by .rpmnew conf files in upgrading process

This is RedHat/CentOS system administration knowledge, since you don't need to do anything for .rpmnew files, we won't mention this.