opengauss2.1.0-oe2203sp3数据库容器运行正常,但检查其日志,发现存在“[FAILED] Failed to start User Login Management.”报错信息,本文记录了处理过程。
[root@localhost ~]# docker logs opengauss
4ec583f58a8c login: systemd v249-63.oe2203sp3 running in system mode (+PAM +AUDIT +SELINUX -APPARMOR +IMA -SMACK +SECCOMP +GCRYPT +GNUTLS -OPENSSL +ACL +BLKID -CURL -ELFUTILS -FIDO2 +IDN2 -IDN -IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT -QRENCODE +BZIP2 +LZ4 +XZ +ZLIB -ZSTD +XKBCOMMON +UTMP +SYSVINIT default-hierarchy=legacy)
Detected virtualization docker.
Detected architecture x86-64.
systemd v249-63.oe2203sp3 running in system mode (+PAM +AUDIT +SELINUX -APPARMOR +IMA -SMACK +SECCOMP +GCRYPT +GNUTLS -OPENSSL +ACL +BLKID -CURL -ELFUTILS -FIDO2 +IDN2 -IDN -IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT -QRENCODE +BZIP2 +LZ4 +XZ +ZLIB -ZSTD +XKBCOMMON +UTMP +SYSVINIT default-hierarchy=legacy)
Detected virtualization docker.
Detected architecture x86-64.
Welcome to openEuler 22.03 (LTS-SP3)!
Queued start job for default target Graphical Interface.
[ OK ] Created slice Slice /system/getty.
[ OK ] Created slice Slice /system/modprobe.
[ OK ] Started Dispatch Password …ts to Console Directory Watch.
[ OK ] Started Forward Password R…uests to Wall Directory Watch.
[ OK ] Set up automount Arbitrary…s File System Automount Point.
[ OK ] Reached target Network is Online.
[ OK ] Reached target Path Units.
[ OK ] Reached target Remote File Systems.
[ OK ] Reached target Slice Units.
[ OK ] Reached target Swaps.
[ OK ] Reached target Local Verity Integrity Protected Volumes.
[ OK ] Listening on Process Core Dump Socket.
[ OK ] Listening on initctl Compatibility Named Pipe.
[ OK ] Listening on Journal Socket (/dev/log).
[ OK ] Listening on Journal Socket.
[ OK ] Reached target Socket Units.
Mounting Huge Pages File System...
Mounting Kernel Debug File System...
Mounting Kernel Trace File System...
Mounting Temporary Directory /tmp...
Starting Load Kernel Module configfs...
Starting Load Kernel Module fuse...
systemd-journald.service: unit configures an IP firewall, but the local system does not support BPF/cgroup firewalling.
(This warning is only shown for the first unit using IP firewalling.)
Starting Journal Service...
Starting Apply Kernel Variables...
[ OK ] Mounted Huge Pages File System.
[ OK ] Mounted Temporary Directory /tmp.
[email protected]: Deactivated successfully.
[ OK ] Finished Load Kernel Module fuse.
[ OK ] Reached target Local File Systems.
Mounting FUSE Control File System...
[ OK ] Mounted Kernel Trace File System.
[email protected]: Deactivated successfully.
[ OK ] Finished Load Kernel Module configfs.
[ OK ] Mounted FUSE Control File System.
Mounting Kernel Configuration File System...
[ OK ] Mounted Kernel Debug File System.
[ OK ] Mounted Kernel Configuration File System.
[ OK ] Finished Apply Kernel Variables.
[ OK ] Started Journal Service.
Starting Flush Journal to Persistent Storage...
[ OK ] Finished Flush Journal to Persistent Storage.
Starting Create Volatile Files and Directories...
[ OK ] Finished Create Volatile Files and Directories.
Starting Record System Boot/Shutdown in UTMP...
[ OK ] Finished Record System Boot/Shutdown in UTMP.
[ OK ] Reached target System Initialization.
[ OK ] Started dnf makecache --timer.
[ OK ] Started Daily Cleanup of Temporary Directories.
[ OK ] Reached target Basic System.
[ OK ] Reached target Timer Units.
Starting Update RTC With System Clock...
[ OK ] Started Start openGauss server.
Starting User Login Management...
Starting Permit User Sessions...
[ OK ] Finished Permit User Sessions.
[ OK ] Started Console Getty.
[ OK ] Started Getty on tty1.
[ OK ] Reached target Login Prompts.
[ OK ] Finished Update RTC With System Clock.
[FAILED] Failed to start User Login Management.
See 'systemctl status systemd-logind.service' for details.
[ OK ] Reached target Multi-User System.
[ OK ] Reached target Graphical Interface.
Starting Record Runlevel Change in UTMP...
[ OK ] Finished Record Runlevel Change in UTMP.
openEuler 22.03 (LTS-SP3)
Kernel 5.10.0-60.18.0.50.oe2203.x86_64 on an x86_64
[root@localhost ~]# docker exec -it opengauss /bin/bash
Welcome to 5.10.0-60.18.0.50.oe2203.x86_64
System information as of time: Mon Jan 15 17:31:33 CST 2024
System load: 0.11
Processes: 10
Memory used: 30.5%
Swap used: 2.5%
Usage On: 91%
Users online: 0
[root@4ec583f58a8c /]# systemctl disable systemd-logind
[root@4ec583f58a8c /]# systemctl status systemd-logind
× systemd-logind.service - User Login Management
Loaded: loaded (/usr/lib/systemd/system/systemd-logind.service; static)
Active: failed (Result: exit-code) since Mon 2024-01-15 17:31:15 CST; 31s ago
Docs: man:sd-login(3)
man:systemd-logind.service(8)
man:logind.conf(5)
man:org.freedesktop.login1(5)
Main PID: 31 (code=exited, status=1/FAILURE)
Jan 15 17:31:15 4ec583f58a8c systemd[1]: systemd-logind.service: Failed to schedule restart job: Unit dbus.socket not found.
Jan 15 17:31:15 4ec583f58a8c systemd[1]: systemd-logind.service: Failed with result 'exit-code'.
[root@4ec583f58a8c /]# systemctl status dbus
Unit dbus.service could not be found.
提示“systemd-logind.service: Failed to schedule restart job: Unit dbus.socket not found.”,这个错误信息表明在尝试重新启动systemd-logind.service时遇到了问题,具体是因为找不到dbus.socket单元。dbus.socket是D-Bus系统的一个组成部分,用于进程间通信。应该是容器部署过程中少装了dbus服务。
1、安装dbus
[root@4ec583f58a8c /]# yum install dbus
OS 4.1 kB/s | 1.8 kB 00:00
everything 1.0 kB/s | 1.8 kB 00:01
EPOL 5.4 kB/s | 1.8 kB 00:00
debuginfo 4.8 kB/s | 1.8 kB 00:00
source 5.3 kB/s | 1.8 kB 00:00
update 5.6 kB/s | 1.8 kB 00:00
update-source 5.7 kB/s | 1.8 kB 00:00
Dependencies resolved.
====================================================================================================================
Package Architecture Version Repository Size
====================================================================================================================
Installing:
dbus x86_64 1:1.12.20-10.oe2203sp3 OS 62 k
Installing dependencies:
dbus-common noarch 1:1.12.20-10.oe2203sp3 OS 12 k
dbus-daemon x86_64 1:1.12.20-10.oe2203sp3 OS 172 k
dbus-tools x86_64 1:1.12.20-10.oe2203sp3 OS 27 k
Transaction Summary
====================================================================================================================
Install 4 Packages
Total download size: 273 k
Installed size: 769 k
Is this ok [y/N]: y
Downloading Packages:
(1/4): dbus-common-1.12.20-10.oe2203sp3.noarch.rpm 50 kB/s | 12 kB 00:00
(2/4): dbus-1.12.20-10.oe2203sp3.x86_64.rpm 223 kB/s | 62 kB 00:00
(3/4): dbus-tools-1.12.20-10.oe2203sp3.x86_64.rpm 320 kB/s | 27 kB 00:00
(4/4): dbus-daemon-1.12.20-10.oe2203sp3.x86_64.rpm 503 kB/s | 172 kB 00:00
--------------------------------------------------------------------------------------------------------------------
Total 402 kB/s | 273 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : dbus-tools-1:1.12.20-10.oe2203sp3.x86_64 1/4
Installing : dbus-common-1:1.12.20-10.oe2203sp3.noarch 2/4
Running scriptlet: dbus-daemon-1:1.12.20-10.oe2203sp3.x86_64 3/4
Installing : dbus-daemon-1:1.12.20-10.oe2203sp3.x86_64 3/4
Running scriptlet: dbus-daemon-1:1.12.20-10.oe2203sp3.x86_64 3/4
Installing : dbus-1:1.12.20-10.oe2203sp3.x86_64 4/4
Running scriptlet: dbus-1:1.12.20-10.oe2203sp3.x86_64 4/4
Verifying : dbus-1:1.12.20-10.oe2203sp3.x86_64 1/4
Verifying : dbus-common-1:1.12.20-10.oe2203sp3.noarch 2/4
Verifying : dbus-daemon-1:1.12.20-10.oe2203sp3.x86_64 3/4
Verifying : dbus-tools-1:1.12.20-10.oe2203sp3.x86_64 4/4
Installed:
dbus-1:1.12.20-10.oe2203sp3.x86_64 dbus-common-1:1.12.20-10.oe2203sp3.noarch
dbus-daemon-1:1.12.20-10.oe2203sp3.x86_64 dbus-tools-1:1.12.20-10.oe2203sp3.x86_64
Complete!
[root@4ec583f58a8c /]# systemctl restart systemd-logind
[root@4ec583f58a8c /]# systemctl status systemd-logind
● systemd-logind.service - User Login Management
Loaded: loaded (/usr/lib/systemd/system/systemd-logind.service; static)
Active: active (running) since Mon 2024-01-15 17:34:19 CST; 6s ago
Docs: man:sd-login(3)
man:systemd-logind.service(8)
man:logind.conf(5)
man:org.freedesktop.login1(5)
Main PID: 289 (systemd-logind)
Status: "Processing requests..."
CGroup: /docker/4ec583f58a8cdb0ae4136d46f8610aed5946f901b9784e712142790fa846ebdf/system.slice/systemd-logind.service
└─ 289 /usr/lib/systemd/systemd-logind
Jan 15 17:34:19 4ec583f58a8c systemd[1]: Starting User Login Management...
Jan 15 17:34:19 4ec583f58a8c systemd-logind[289]: New seat seat0.
Jan 15 17:34:19 4ec583f58a8c systemd[1]: Started User Login Management.
[root@4ec583f58a8c /]# exit
exit
[root@localhost ~]# echo > $(docker inspect --format='{{.LogPath}}' opengauss)
[root@localhost ~]# docker logs opengauss
[root@localhost ~]#
[root@localhost ~]# docker restart opengauss
opengauss
[root@localhost ~]# docker logs opengauss
4ec583f58a8c login: systemd v249-63.oe2203sp3 running in system mode (+PAM +AUDIT +SELINUX -APPARMOR +IMA -SMACK +SECCOMP +GCRYPT +GNUTLS -OPENSSL +ACL +BLKID -CURL -ELFUTILS -FIDO2 +IDN2 -IDN -IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT -QRENCODE +BZIP2 +LZ4 +XZ +ZLIB -ZSTD +XKBCOMMON +UTMP +SYSVINIT default-hierarchy=legacy)
Detected virtualization docker.
Detected architecture x86-64.
/usr/lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly.
systemd v249-63.oe2203sp3 running in system mode (+PAM +AUDIT +SELINUX -APPARMOR +IMA -SMACK +SECCOMP +GCRYPT +GNUTLS -OPENSSL +ACL +BLKID -CURL -ELFUTILS -FIDO2 +IDN2 -IDN -IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT -QRENCODE +BZIP2 +LZ4 +XZ +ZLIB -ZSTD +XKBCOMMON +UTMP +SYSVINIT default-hierarchy=legacy)
Detected virtualization docker.
Detected architecture x86-64.
Welcome to openEuler 22.03 (LTS-SP3)!
/usr/lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly.
Queued start job for default target Graphical Interface.
[ OK ] Created slice Slice /system/getty.
[ OK ] Created slice Slice /system/modprobe.
[ OK ] Created slice User and Session Slice.
[ OK ] Started Dispatch Password …ts to Console Directory Watch.
[ OK ] Started Forward Password R…uests to Wall Directory Watch.
[ OK ] Set up automount Arbitrary…s File System Automount Point.
[ OK ] Reached target Network is Online.
[ OK ] Reached target Path Units.
[ OK ] Reached target Remote File Systems.
[ OK ] Reached target Slice Units.
[ OK ] Reached target Swaps.
[ OK ] Reached target Local Verity Integrity Protected Volumes.
[ OK ] Listening on Process Core Dump Socket.
[ OK ] Listening on initctl Compatibility Named Pipe.
[ OK ] Listening on Journal Socket (/dev/log).
[ OK ] Listening on Journal Socket.
Mounting Huge Pages File System...
Mounting Kernel Debug File System...
Mounting Kernel Trace File System...
Mounting Temporary Directory /tmp...
Starting Load Kernel Module configfs...
Starting Load Kernel Module drm...
Starting Load Kernel Module fuse...
systemd-journald.service: unit configures an IP firewall, but the local system does not support BPF/cgroup firewalling.
(This warning is only shown for the first unit using IP firewalling.)
Starting Journal Service...
Starting Apply Kernel Variables...
[ OK ] Mounted Huge Pages File System.
[ OK ] Mounted Kernel Trace File System.
[ OK ] Mounted Temporary Directory /tmp.
[ OK ] Reached target Local File Systems.
[email protected]: Deactivated successfully.
[ OK ] Finished Load Kernel Module fuse.
Mounting FUSE Control File System...
[email protected]: Deactivated successfully.
[ OK ] Finished Load Kernel Module configfs.
Mounting Kernel Configuration File System...
[ OK ] Mounted Kernel Debug File System.
[email protected]: Deactivated successfully.
[ OK ] Finished Load Kernel Module drm.
[ OK ] Mounted Kernel Configuration File System.
[ OK ] Mounted FUSE Control File System.
[ OK ] Finished Apply Kernel Variables.
[ OK ] Started Journal Service.
Starting Flush Journal to Persistent Storage...
[ OK ] Finished Flush Journal to Persistent Storage.
Starting Create Volatile Files and Directories...
[ OK ] Finished Create Volatile Files and Directories.
Starting Record System Boot/Shutdown in UTMP...
[ OK ] Finished Record System Boot/Shutdown in UTMP.
[ OK ] Reached target System Initialization.
[ OK ] Started dnf makecache --timer.
[ OK ] Started Daily Cleanup of Temporary Directories.
[ OK ] Reached target Timer Units.
[ OK ] Listening on D-Bus System Message Bus Socket.
[ OK ] Reached target Socket Units.
[ OK ] Reached target Basic System.
Starting D-Bus System Message Bus...
Starting Update RTC With System Clock...
[ OK ] Started Start openGauss server.
Starting User Login Management...
Starting Permit User Sessions...
[ OK ] Started D-Bus System Message Bus.
[ OK ] Finished Permit User Sessions.
[ OK ] Started Console Getty.
[ OK ] Started Getty on tty1.
[ OK ] Reached target Login Prompts.
[ OK ] Finished Update RTC With System Clock.
[ OK ] Started User Login Management.
[ OK ] Reached target Multi-User System.
[ OK ] Reached target Graphical Interface.
Starting Record Runlevel Change in UTMP...
[ OK ] Finished Record Runlevel Change in UTMP.
openEuler 22.03 (LTS-SP3)
Kernel 5.10.0-60.18.0.50.oe2203.x86_64 on an x86_64
[root@localhost ~]#
可以看到,容器日志已完全正常,没有报错信息了。