Public bug reported:
Hi,
We've got an issue with Nginx and policy-rc.d on Ubuntu 24.04. Nginx
can't install when we create an policy-rc.d file with an `exit 0` code.
Here is the steps to reproduce :
1. Install Ubuntu 24.04 Live Server from the ISO.
2. Connect to the machine via SSH.
3. Create a **/usr/sbin/policy-rc.d** file containing :
```
#!/bin/sh
exit 0
```
4. Chmod the **policy-rc.d** file :
```
chmod 755 /usr/sbin/policy-rc.d
```
5. Install Nginx :
```
apt update
apt install -y nginx
```
Here is the output.
```
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances... Fait
Lecture des informations d'état... Fait
nginx est déjà la version la plus récente (1.24.0-2ubuntu7.1).
0 mis à jour, 0 nouvellement installés, 0 à enlever et 113 non mis à jour.
root@ubuntu24:~# apt remove --purge nginx
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances... Fait
Lecture des informations d'état... Fait
Les paquets suivants seront ENLEVÉS :
nginx* nginx-common*
0 mis à jour, 0 nouvellement installés, 2 à enlever et 113 non mis à jour.
Après cette opération, 1 596 ko d'espace disque seront libérés.
Souhaitez-vous continuer ? [O/n] Y
(Lecture de la base de données... 83674 fichiers et répertoires déjà installés.)
Suppression de nginx-common (1.24.0-2ubuntu7.1) ...
Suppression de nginx (1.24.0-2ubuntu7.1) ...
Traitement des actions différées (« triggers ») pour man-db (2.12.0-4build2) ...
(Lecture de la base de données... 83649 fichiers et répertoires déjà installés.)
Purge des fichiers de configuration de nginx-common (1.24.0-2ubuntu7.1) ...
Traitement des actions différées (« triggers ») pour ufw (0.36.2-6) ...
root@ubuntu24:~# apt install nginx
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances... Fait
Lecture des informations d'état... Fait
Les paquets supplémentaires suivants seront installés :
nginx-common
Paquets suggérés :
fcgiwrap nginx-doc ssl-cert
Les NOUVEAUX paquets suivants seront installés :
nginx nginx-common
0 mis à jour, 2 nouvellement installés, 0 à enlever et 113 non mis à jour.
Il est nécessaire de prendre 552 ko dans les archives.
Après cette opération, 1 596 ko d'espace disque supplémentaires seront utilisés.
Souhaitez-vous continuer ? [O/n] Y
Réception de :1 http://archive.ubuntu.com/ubuntu noble-updates/main amd64
nginx-common all 1.24.0-2ubuntu7.1 [31,2 kB]
Réception de :2 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 nginx
amd64 1.24.0-2ubuntu7.1 [521 kB]
552 ko réceptionnés en 1s (759 ko/s)
Préconfiguration des paquets...
Sélection du paquet nginx-common précédemment désélectionné.
(Lecture de la base de données... 83626 fichiers et répertoires déjà installés.)
Préparation du dépaquetage de .../nginx-common_1.24.0-2ubuntu7.1_all.deb ...
Dépaquetage de nginx-common (1.24.0-2ubuntu7.1) ...
Sélection du paquet nginx précédemment désélectionné.
Préparation du dépaquetage de .../nginx_1.24.0-2ubuntu7.1_amd64.deb ...
Dépaquetage de nginx (1.24.0-2ubuntu7.1) ...
Paramétrage de nginx (1.24.0-2ubuntu7.1) ...
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 Fri 2024-09-20 13:20:58 UTC; 12ms
ago
Docs: man:nginx(8)
Process: 2641 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on;
master_process on; (code=exited, status=1/FAILURE)
CPU: 3ms
sept. 20 13:20:58 ubuntu24 systemd[1]: Starting nginx.service - A high
performance web server and a reverse proxy server...
sept. 20 13:20:58 ubuntu24 nginx[2641]: 2024/09/20 13:20:58 [emerg] 2641#2641:
open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)
sept. 20 13:20:58 ubuntu24 nginx[2641]: nginx: configuration file
/etc/nginx/nginx.conf test failed
sept. 20 13:20:58 ubuntu24 systemd[1]: nginx.service: Control process exited,
code=exited, status=1/FAILURE
sept. 20 13:20:58 ubuntu24 systemd[1]: nginx.service: Failed with result
'exit-code'.
sept. 20 13:20:58 ubuntu24 systemd[1]: Failed to start nginx.service - A high
performance web server and a reverse proxy server.
dpkg: erreur de traitement du paquet nginx (--configure) :
le sous-processus paquet nginx script post-installation installé a renvoyé un
état de sortie d'erreur 1
dpkg: des problèmes de dépendances empêchent la configuration de nginx-common :
nginx-common dépend de nginx (<< 1.24.0-2ubuntu7.1.1~); cependant :
Le paquet nginx n'est pas encore configuré.
dpkg: erreur de traitement du paquet nginx-common (--configure) :
problèmes de dépendances - laissé non configuré
Traitement des actions différées (« triggers ») pour ufw (0.36.2-6) ...
Aucun rapport « appor