Das installierte Post-Installation-Skript hat den Fehler-Exit-Status 1 zurückgegeben.

Das installierte Post-Installation-Skript hat den Fehler-Exit-Status 1 zurückgegeben.

Ich habe viele Beschwerden mit demselben Fehler gefunden, aber für unterschiedliche Pakete. Ich konnte jedoch nicht verstehen, was der Grund für diesen Fehler ist und wie ich ihn beheben kann. Bitte helfen Sie, wenn Sie eine Ahnung davon haben.

Es erschien zuerst, als ich versuchte, rsyslog zu installieren.

# 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

Antwort1

Ich vermute, das Problem ist, dass die ursprüngliche Direktive für insserv fehlt in der

/etc/init.d/rsyslog

Fügen Sie also diese Zeile in /etc/init.d/rsyslog nach der Direktive /bin/bash hinzu

### 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

und dann

# dpkg --configure -a

Antwort2

Umfeld:Docker-Container

Linux-Distribution:Ubuntu 20.04 LTS

Ich hatte auch genau diesen Fehler, aber als ich versuchte, diePlattformübergreifender Nagios-Agent (NCPA)innerhalb meiner Docker-Containerumgebung und während der Ausführung meines benutzerdefinierten initialize.shBash-Skripts. Kann mir jemand helfen, welchen der Daemon-Dienste innerhalb von /etc/init.d/ ich konfigurieren muss? Und auf welche Konfiguration ich ihn konfigurieren muss?

Vielen Dank im Voraus!

Die Ausgabe meines Bash-Skripts lautet wie folgt:

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

Ich möchte NCPA mit dem benutzerdefinierten Skript installieren, das ich erstellt habe.

Und da ich eine bestimmte Konfiguration beibehalten wollte, damit sie bei der Standard-NCPA-Installation nicht überschrieben wird, habe ich die Standardparameter apt-get oder apt install ncpa nicht verwendet.

Stattdessen habe ich verwendet:

apt-get -o DPkg::Options::=--force-confdef install -y ncpa

Vielen Dank im Voraus für eure Hilfe, Leute!

Mit freundlichen Grüße,

Doga

verwandte Informationen