Performing verification for noble.

I installed nginx 1.24.0-2ubuntu7.3 from -updates:

Running through the policy-rc.d testcase:

$ sudo vim /usr/sbin/policy-rc.d
#!/bin/sh

exit 0
$ sudo chmod 755 /usr/sbin/policy-rc.d

$ sudo apt install -y nginx
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  nginx-common
Suggested packages:
  fcgiwrap nginx-doc ssl-cert
The following NEW packages will be installed:
  nginx nginx-common
0 upgraded, 2 newly installed, 0 to remove and 63 not upgraded.
Need to get 551 kB of archives.
After this operation, 1596 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 nginx-common 
all 1.24.0-2ubuntu7.3 [31.2 kB]
Get:2 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 nginx amd64 
1.24.0-2ubuntu7.3 [520 kB]
Fetched 551 kB in 2s (255 kB/s)
Preconfiguring packages ...
Selecting previously unselected package nginx-common.
(Reading database ... 74794 files and directories currently installed.)
Preparing to unpack .../nginx-common_1.24.0-2ubuntu7.3_all.deb ...
Unpacking nginx-common (1.24.0-2ubuntu7.3) ...
Selecting previously unselected package nginx.
Preparing to unpack .../nginx_1.24.0-2ubuntu7.3_amd64.deb ...
Unpacking nginx (1.24.0-2ubuntu7.3) ...
Setting up nginx (1.24.0-2ubuntu7.3) ...
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xeu nginx.service" for 
details.
invoke-rc.d: initscript nginx, action "start" failed.
× nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; preset: 
enabled)
     Active: failed (Result: exit-code) since Thu 2025-06-19 03:21:59 UTC; 6ms 
ago
       Docs: man:nginx(8)
    Process: 1693 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; 
master_process on; (code=exited, status=1/FAILURE)
        CPU: 1ms

Jun 19 03:21:59 noble-test systemd[1]: Starting nginx.service - A high 
performance web server and a reverse proxy server...
Jun 19 03:21:59 noble-test nginx[1693]: 2025/06/19 03:21:59 [emerg] 1693#1693: 
open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)
Jun 19 03:21:59 noble-test nginx[1693]: nginx: configuration file 
/etc/nginx/nginx.conf test failed
Jun 19 03:21:59 noble-test systemd[1]: nginx.service: Control process exited, 
code=exited, status=1/FAILURE
Jun 19 03:21:59 noble-test systemd[1]: nginx.service: Failed with result 
'exit-code'.
Jun 19 03:21:59 noble-test systemd[1]: Failed to start nginx.service - A high 
performance web server and a reverse proxy server.
dpkg: error processing package nginx (--configure):
 installed nginx package post-installation script subprocess returned error 
exit status 1
dpkg: dependency problems prevent configuration of nginx-common:
 nginx-common depends on nginx (<< 1.24.0-2ubuntu7.3.1~); however:
  Package nginx is not configured yet.

dpkg: error processing package nginx-common (--configure):
 dependency problems - leaving unconfigured
Processing triggers for ufw (0.36.2-6) ...
No apport report written because the error message indicates its a followup 
error from a previous failure.
                                                                                
                          Processing triggers for man-db (2.12.0-4build2) ...
Errors were encountered while processing:
 nginx
 nginx-common
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

policy-rc.d prevents nginx.service from starting due to nginx-common getting
stuck because nginx is not installed yet, and vice versa. We can reproduce the
issue.

Running through the nginx-common testcase:

$ sudo apt install nginx-common
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  nginx
Suggested packages:
  fcgiwrap nginx-doc ssl-cert
The following NEW packages will be installed:
  nginx nginx-common
0 upgraded, 2 newly installed, 0 to remove and 63 not upgraded.
Need to get 0 B/551 kB of archives.
After this operation, 1596 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
Selecting previously unselected package nginx-common.
(Reading database ... 74817 files and directories currently installed.)
Preparing to unpack .../nginx-common_1.24.0-2ubuntu7.3_all.deb ...
Unpacking nginx-common (1.24.0-2ubuntu7.3) ...
Selecting previously unselected package nginx.
Preparing to unpack .../nginx_1.24.0-2ubuntu7.3_amd64.deb ...
Unpacking nginx (1.24.0-2ubuntu7.3) ...
Setting up nginx (1.24.0-2ubuntu7.3) ...
Setting up nginx-common (1.24.0-2ubuntu7.3) ...
Processing triggers for ufw (0.36.2-6) ...
Processing triggers for man-db (2.12.0-4build2) ...

ubuntu@noble-test:~$ systemctl status nginx.service 
● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; preset: 
enabled)
     Active: active (running) since Thu 2025-06-19 03:28:33 UTC; 8s ago
       Docs: man:nginx(8)
    Process: 1274 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; 
master_process on; (code=exited, status=0/SUCCESS)
    Process: 1276 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; 
(code=exited, status=0/SUCCESS)
   Main PID: 1277 (nginx)
      Tasks: 5 (limit: 4655)
     Memory: 3.7M (peak: 4.3M)
        CPU: 13ms
     CGroup: /system.slice/nginx.service
             ├─1277 "nginx: master process /usr/sbin/nginx -g daemon on; 
master_process on;"
             ├─1278 "nginx: worker process"
             ├─1279 "nginx: worker process"
             ├─1280 "nginx: worker process"
             └─1281 "nginx: worker process"

Jun 19 03:28:33 noble-test systemd[1]: Starting nginx.service - A high 
performance web server and a reverse proxy server...
Jun 19 03:28:33 noble-test systemd[1]: Started nginx.service - A high 
performance web server and a reverse proxy server.

Due to the circular dependencies, nginx-common pulls in nginx, and ends up
starting the service.

I then enabled -proposed and installed nginx 1.24.0-2ubuntu7.4

Running through the policy-rc.d testcase:

$ sudo apt install -t noble-proposed nginx
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  nginx-common
Suggested packages:
  fcgiwrap nginx-doc ssl-cert
The following NEW packages will be installed:
  nginx nginx-common
0 upgraded, 2 newly installed, 0 to remove and 81 not upgraded.
Need to get 564 kB of archives.
After this operation, 1596 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu noble-proposed/main amd64 nginx-common 
all 1.24.0-2ubuntu7.4 [43.4 kB]
Get:2 http://archive.ubuntu.com/ubuntu noble-proposed/main amd64 nginx amd64 
1.24.0-2ubuntu7.4 [521 kB]
Fetched 564 kB in 2s (237 kB/s)
Preconfiguring packages ...
Selecting previously unselected package nginx-common.
(Reading database ... 74814 files and directories currently installed.)
Preparing to unpack .../nginx-common_1.24.0-2ubuntu7.4_all.deb ...
Unpacking nginx-common (1.24.0-2ubuntu7.4) ...
Selecting previously unselected package nginx.
Preparing to unpack .../nginx_1.24.0-2ubuntu7.4_amd64.deb ...
Unpacking nginx (1.24.0-2ubuntu7.4) ...
Setting up nginx-common (1.24.0-2ubuntu7.4) ...
Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → 
/usr/lib/systemd/system/nginx.service.
Setting up nginx (1.24.0-2ubuntu7.4) ...
 * Upgrading binary nginx                                                       
                                                                                
  [ OK ] 
Processing triggers for man-db (2.12.0-4build2) ...
Processing triggers for ufw (0.36.2-6) ...

ubuntu@noble-test:~$ systemctl status nginx.service 
● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; preset: 
enabled)
     Active: active (running) since Thu 2025-06-19 03:26:03 UTC; 9s ago
       Docs: man:nginx(8)
    Process: 1590 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; 
master_process on; (code=exited, status=0/SUCCESS)
    Process: 1592 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; 
(code=exited, status=0/SUCCESS)
   Main PID: 1632 (nginx)
      Tasks: 5 (limit: 4655)
     Memory: 3.7M (peak: 8.4M)
        CPU: 22ms
     CGroup: /system.slice/nginx.service
             ├─1632 "nginx: master process /usr/sbin/nginx -g daemon on; 
master_process on;"
             ├─1634 "nginx: worker process"
             ├─1635 "nginx: worker process"
             ├─1636 "nginx: worker process"
             └─1637 "nginx: worker process"

Jun 19 03:26:03 noble-test systemd[1]: Starting nginx.service - A high 
performance web server and a reverse proxy server...
Jun 19 03:26:03 noble-test systemd[1]: Started nginx.service - A high 
performance web server and a reverse proxy server.

This is much improved. The apt transaction completes successfully and the
service is running as intended.

Running through the nginx-common testcase:

$ sudo apt install -t noble-proposed nginx-common
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
  fcgiwrap nginx-doc ssl-cert
The following NEW packages will be installed:
  nginx-common
0 upgraded, 1 newly installed, 0 to remove and 81 not upgraded.
Need to get 43.4 kB of archives.
After this operation, 245 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu noble-proposed/main amd64 nginx-common 
all 1.24.0-2ubuntu7.4 [43.4 kB]
Fetched 43.4 kB in 1s (33.9 kB/s)       
Preconfiguring packages ...
Selecting previously unselected package nginx-common.
(Reading database ... 74817 files and directories currently installed.)
Preparing to unpack .../nginx-common_1.24.0-2ubuntu7.4_all.deb ...
Unpacking nginx-common (1.24.0-2ubuntu7.4) ...
Setting up nginx-common (1.24.0-2ubuntu7.4) ...
Processing triggers for ufw (0.36.2-6) ...

ubuntu@noble-test:~$ systemctl status nginx.service 
○ nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; preset: 
enabled)
     Active: inactive (dead)
  Condition: start condition unmet at Thu 2025-06-19 03:30:23 UTC; 3s ago
             └─ ConditionFileIsExecutable=/usr/sbin/nginx was not met
       Docs: man:nginx(8)

Jun 19 03:30:23 noble-test systemd[1]: nginx.service - A high
performance web server and a reverse proxy server was skipped because of
an unmet condition check (ConditionFileIsExecutable=/usr/sbin/nginx).

If we then install nginx:

$ sudo apt install -t noble-proposed nginx
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  nginx
0 upgraded, 1 newly installed, 0 to remove and 81 not upgraded.
Need to get 521 kB of archives.
After this operation, 1352 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu noble-proposed/main amd64 nginx amd64 
1.24.0-2ubuntu7.4 [521 kB]
Fetched 521 kB in 2s (229 kB/s)
Selecting previously unselected package nginx.
(Reading database ... 74837 files and directories currently installed.)
Preparing to unpack .../nginx_1.24.0-2ubuntu7.4_amd64.deb ...
Unpacking nginx (1.24.0-2ubuntu7.4) ...
Setting up nginx (1.24.0-2ubuntu7.4) ...
Processing triggers for man-db (2.12.0-4build2) ...

ubuntu@noble-test:~$ systemctl status nginx.service 
● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; preset: 
enabled)
     Active: active (running) since Thu 2025-06-19 03:31:06 UTC; 3s ago
       Docs: man:nginx(8)
    Process: 1366 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; 
master_process on; (code=exited, status=0/SUCCESS)
    Process: 1368 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; 
(code=exited, status=0/SUCCESS)
   Main PID: 1369 (nginx)
      Tasks: 5 (limit: 4655)
     Memory: 3.7M (peak: 4.4M)
        CPU: 14ms
     CGroup: /system.slice/nginx.service
             ├─1369 "nginx: master process /usr/sbin/nginx -g daemon on; 
master_process on;"
             ├─1370 "nginx: worker process"
             ├─1371 "nginx: worker process"
             ├─1372 "nginx: worker process"
             └─1373 "nginx: worker process"

Jun 19 03:31:06 noble-test systemd[1]: Starting nginx.service - A high 
performance web server and a reverse proxy server...
Jun 19 03:31:06 noble-test systemd[1]: Started nginx.service - A high 
performance web server and a reverse proxy server.

The policy-rc.d testcase is fixed, and now when nginx-common is installed
it does not start nginx.service unless the nginx package is installed.

The package in -proposed fixes the issue, happy to mark verified for
noble.

** Tags removed: verification-needed verification-needed-noble
** Tags added: verification-done-noble

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2081308

Title:
  Resolve circular dependency loop between nginx and nginx-common

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/2081308/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to