Skip to content

nginx error following command setcap cap_net_bind_service #2398

@matthieumarrast

Description

@matthieumarrast

If we want mfserv/nginx to listen a port < 1024, we follow the instruction given in the mfserv config.ini:

[nginx]

# Port of nginx daemon
# IMPORTANT: this is the main port of the mfserv module
# Note: you can use <1024 value here (80 for example) but ports <1024 need
#       an extra configuration step as root user:
#       => setcap cap_net_bind_service=+ep "{{MFEXT_HOME}}/opt/openresty/nginx/sbin/nginx"
#       (and)
#       => touch /etc/metwork.config.d/mfserv/set_cap_net_bind_service
#          (for this change survives after a metwork update)
port=18868

But in rocky9/mw2.2 it raises an error:

$ docker run -it metwork/mfserv-rocky9:2.2.8 bash
# setcap cap_net_bind_service=+ep "/opt/metwork-mfext-2.2/opt/openresty/nginx/sbin/nginx"
# touch /etc/metwork.config.d/mfserv/set_cap_net_bind_service
# service metwork start mfserv
*****************************************
*****     MFSERV INITIALIZATION     *****
*****************************************

- Stopping (if running) mfserv module...                   [ OK ]
- Cleaning /home/mfserv/tmp...                             [ OK ]
- Cleaning /home/mfserv/var...                             [ OK ]
- Cleaning /home/mfserv/log...                             [ OK ]


- Installing internal plugin: welcome...                   [ ERROR ]
ERROR: BashWrapperException exception with message: bad return code and debug:
===== BASH COMMAND =======================
_plugins.postinstall welcome 2.2.8 1
===== BASH RETURN CODE ===================
1
===== BASH STDOUT ========================
Testing circus conf generation...
Ok
Testing nginx conf generation...
===== BASH STDERR ========================
ERROR: bad nginx configuration (/home/mfserv/tmp/nginx_conf2.481 => see /home/mfserv/tmp/nginx_conf3.481 for details
***********************************
*****     STARTING MFSERV     *****
***********************************

- Checking circus conf generation...                       [ OK ]
- Generating circus.ini                                    [ OK ]
- Starting circus...                                       [ OK ]
- Waiting for circus daemon...                             [ OK ]
- Collecting infos about plugins...                        [ OK ]
- Checking nginx conf generation...                        [ ERROR ]
- Starting of conf_monitor                                 [ OK ]
- Building crontab file...                                 [ OK ]
- Installing crontab file...                               [ OK ]
- Wait 2 sec...                                            [ OK ]
- Checking circus status...                                [ OK ]
- Checking crontab is not empty...                         [ OK ]
- Checking nginx...                                        [ ERROR ]
- Checking conf_monitor...                                 [ OK ]
- Checking plugin:autorestart...                           [ OK ]

ERROR(S) DETECTED DURING MFSERV CHECK

OK with rocky9/mw2.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions