
Я нашел много жалоб с той же ошибкой, но для разных пакетов. Однако я не смог понять суть этой ошибки и как ее исправить. Пожалуйста, помогите, если у вас есть какие-либо соображения по этому поводу.
Впервые это появилось, когда я попытался установить 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
решение1
Я предполагаю, что проблема в том, что отсутствует начальная директива для insserv в
/etc/init.d/rsyslog
Поэтому добавьте эти строки в /etc/init.d/rsyslog после директивы /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
а потом
# dpkg --configure -a
решение2
Среда:Контейнер Docker
Дистрибутив Linux:Ubuntu 20.04 LTS
У меня тоже была точно такая же ошибка, но когда я пытался установитьКроссплатформенный агент Nagios (NCPA)в моей среде Docker Container и во время выполнения моего пользовательского initialize.sh
скрипта bash. Может ли кто-нибудь помочь мне с тем, какие из служб демонов в /etc/init.d/ мне нужно настроить? и на какую конфигурацию мне нужно его настроить?
Заранее большое спасибо!
Вывод моего bash-скрипта следующий:
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
Я хотел бы установить NCPA с помощью созданного мной специального скрипта.
А поскольку я хотел сохранить определенную конфигурацию, чтобы она не была перезаписана во время установки ncpa по умолчанию, я не использовал стандартный параметр apt-get или apt install ncpa.
Вместо этого я использовал:
apt-get -o DPkg::Options::=--force-confdef install -y ncpa
Спасибо заранее за вашу помощь, ребята!
С уважением,
Дога