
Encontré muchas quejas con el mismo error pero para paquetes diferentes. Sin embargo, no pude entender la esencia de este error y cómo solucionarlo. Por favor. ayuda si tienes alguna idea al respecto.
Apareció por primera vez cuando intenté instalar rsyslog.
# dpkg --configure -a
Setting up rsyslog (4.6.4-2) ...
insserv: warning: script 'K02ossec' missing LSB tags and overrides
insserv: warning: script 'K02drwebd' missing LSB tags and overrides
insserv: warning: script 'drwebd' missing LSB tags and overrides
insserv: script ctasd_initd: service Parallels already provided!
insserv: script ctasd_initd: service Premium already provided!
insserv: script ctasd_initd: service Outgoing already provided!
insserv: script ctasd_initd: service Antispam already provided!
insserv: warning: script 'ctmilter_initd' missing LSB tags and overrides
insserv: warning: script 'ossec' missing LSB tags and overrides
insserv: There is a loop between service munin-node and ctmilter_initd if stopped
insserv: loop involving service ctmilter_initd at depth 2
insserv: loop involving service munin-node at depth 1
insserv: Stopping ctmilter_initd depends on munin-node and therefore on system facility `$all' which can not be true!
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
dpkg: error processing rsyslog (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
rsyslog
Respuesta1
Supongo que el problema es que falta la directiva inicial para insserv en el
/etc/init.d/rsyslog
Entonces agregue estas líneas en /etc/init.d/rsyslog después de la directiva /bin/bash
### BEGIN INIT INFO
# Provides: rsyslog
# Required-Start: $remote_fs $time
# Required-Stop: umountnfs $time
# X-Stop-After: sendsigs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: enhanced syslogd
# Description: Rsyslog is an enhanced multi-threaded syslogd.
# It is quite compatible to stock sysklogd and can be
# used as a drop-in replacement.
### END INIT INFO
y luego
# dpkg --configure -a
Respuesta2
Ambiente:Contenedor acoplable
Distribución de Linux:Ubuntu 20.04 LTS
También tuve este error exacto, pero cuando estaba intentando instalar elAgente multiplataforma de Nagios (NCPA)dentro de mi entorno Docker Container y mientras ejecuto mi initialize.sh
script bash personalizado. ¿Alguien puede ayudarme sobre cuál de los servicios de demonio dentro de /etc/init.d/ necesito configurar? ¿Y a qué configuración necesito configurarlo?
¡Muchas gracias por adelantado!
La salida de mi script bash es la siguiente:
root@a132ae571fae:/var/scripts# apt-get -o DPkg::Options::=--force-confdef install -y ncpa
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
ncpa
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 10.7 MB of archives.
After this operation, 30.6 MB of additional disk space will be used.
Get:1 https://repo.nagios.com/deb/focal ncpa 2.4.0-1 [10.7 MB]
Fetched 10.7 MB in 2s (5990 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package ncpa.
(Reading database ... 29237 files and directories currently installed.)
Preparing to unpack .../ncpa_2.4.0-1_amd64.deb ...
Unpacking ncpa (2.4.0-1) ...
Setting up ncpa (2.4.0-1) ...
Configuration file '/usr/local/ncpa/etc/ncpa.cfg'
==> File on system created by you or by a script.
==> File also in package provided by package maintainer.
==> Keeping old config file as default.
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
dpkg: error processing package ncpa (--configure):
installed ncpa package post-installation script subprocess returned error exit status 1
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...
Processing triggers for systemd (245.4-4ubuntu3.19) ...
Errors were encountered while processing:
ncpa
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@a132ae571fae:/etc/init.d# ls -lah
total 84K
drwxrwxr-x 1 root root 4.0K Jan 6 12:22 .
drwxr-xr-x 1 root root 4.0K Jan 6 12:22 ..
-rwxr-xr-x 1 root root 2.5K Feb 23 2021 apache-htcacheclean
-rwxr-xr-x 1 root root 8.0K Feb 23 2021 apache2
-rwxr-xr-x 1 root root 3.0K Feb 11 2020 cron
-rwxr-xr-x 1 root root 3.1K Sep 30 2019 dbus
-rwxr-xr-x 1 root root 3.8K Jul 28 2019 hwclock.sh
-rwxrwxr-x 1 root root 608 Jan 2 15:22 initialize.sh
-rwxr-xr-x 1 root root 6.9K Jan 6 12:07 nagios
-rwxr-xr-x 1 root root 1.6K Jan 6 12:22 ncpa_listener
-rwxr-xr-x 1 root root 1.5K Jan 6 12:22 ncpa_passive
-rwxr-xr-x 1 root root 1.6K Nov 27 2020 ntp
-rwxr-xr-x 1 root root 3.3K Aug 31 2021 postfix
-rwxr-xr-x 1 root root 924 Feb 13 2020 procps
-rwxr-xr-x 1 root root 2.8K Mar 7 2019 rsyslog
-rwxr-xr-x 1 root root 3.9K Mar 30 2022 ssh
-rwxr-xr-x 1 root root 2.1K Jan 21 2020 ufw
-rwxr-xr-x 1 root root 2.7K Jan 20 2017 x11-common
root@a132ae571fae:/var/scripts# ls -lah
total 24K
drwxr-xr-x 1 root root 4.0K Jan 6 12:16 .
drwxr-xr-x 1 root root 4.0K Jan 6 12:09 ..
-rwxrwxr-x 1 root root 806 Jan 6 12:16 initialize.sh
-rwxrwxr-x 1 root root 165 Jan 2 14:53 remove-nologin.sh
root@a132ae571fae:/var/scripts# nano initialize.sh
root@a132ae571fae:/var/scripts#
root@a132ae571fae:/var/scripts# cat initialize.sh
#!/bin/bash
INIT_FLAG="initialized.flag"
if [ ! -f "$INIT_FLAG" ]; then
## Ncpa install (repository and key already added in dockerfile)
apt-get update
export DEBIAN_FRONTEND=noninteractive
cd /tmp
dpkg -i dpkg_1.19.7ubuntu3.2_amd64.deb
apt-get update
apt-get install --reinstall dpkg
apt-get -o DPkg::Options::=--force-confdef install -y ncpa
## Set TimeZone to Europe/Amsterdam and Enable & Run Remove No-Login Service
timedatectl set-timezone Europe/Amsterdam
# systemctl start remove-nologin.service
# systemctl enable remove-nologin.service
#rm -rf /var/run/nologin
service apache2 start
service nagios start
service ncpa_listener start
service ncpa_passive start
echo "services are up and running!"
exit 1
else
touch $INIT_FLAG
echo "services have failed to load!"
exit 0
fi
Lo que me gustaría hacer es instalar NCPA usando el script personalizado que había creado.
Y como quería mantener una configuración específica, para que no la sobrescribiera durante la instalación predeterminada de ncpa, no utilicé el parámetro estándar apt-get o apt install ncpa.
En lugar de eso usé:
apt-get -o DPkg::Options::=--force-confdef install -y ncpa
¡Gracias por su ayuda de antemano chicos!
Atentamente,
doga