설치된 설치 후 스크립트가 오류 종료 상태 1을 반환했습니다.

설치된 설치 후 스크립트가 오류 종료 상태 1을 반환했습니다.

동일한 오류가 있지만 다른 패키지에 대해 많은 불만이 있음을 발견했습니다. 그러나 나는 이 오류의 본질과 해결 방법을 이해할 수 없었습니다. 부탁드립니다. 그것에 대해 어떤 단서가 있다면 도와주세요.

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

따라서 /bin/bash 지시어 뒤에 /etc/init.d/rsyslog에 다음 줄을 추가하십시오.

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

환경:도커 컨테이너

리눅스 배포판:우분투 20.04 LTS

나 또한 이 정확한 오류가 있었지만 설치하려고 할 때NCPA(Nagios 크로스 플랫폼 에이전트)내 Docker 컨테이너 환경 내에서 그리고 내 사용자 정의 initialize.shbash 스크립트를 실행하는 동안. /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

미리 도움을 주셔서 감사합니다!

감사합니다,

도가

관련 정보