独立日志命名空间的 systemd-journald 在 30 秒后退出

独立日志命名空间的 systemd-journald 在 30 秒后退出

我正在尝试systemd-journald首次配置额外的 /log 命名空间(在 Debian bookworm 上)(因为这似乎是为不同的服务配置不同日志存储量的唯一可能性)。

我已经创建并添加了设置。/etc/systemd/[email protected]/etc/systemd/system/[email protected]LogNamespace=postfix

当我启动 Postfix 实例时,一开始一切都按预期运行:实例systemd-journald已启动并在 下创建其目录和文件/var/log/journal。但 31 秒后,systemd-journald实例退出(代码为 0),原因不明。Postfix 实例(这是使用此日志命名空间的唯一服务)继续运行。没有错误消息,只有:

systemd[1]: [email protected]: Deactivated successfully.

这是在主日志命名空间中。它本身只记录以下内容:

systemd-journald[1274]: Journal started
systemd-journald[1274]: System Journal (/var/log/journal/6aca95cee9e8c625f75e5f2865f56978.postfix) is 8.0M, max 1.4G, 1.4G free.
systemd-journald[1274]: Journal stopped

如果手动启动也会发生这种情况[email protected](无论 Postfix 是否正在运行)。

这似乎不是由外部引起的。strace没有显示信号或类似的东西:

gettid()                                = 2446
epoll_wait(8, [{events=EPOLLIN, data={u32=1095348704, u64=94378706711008}}], 30, -1) = 1
read(14, "\1\0\0\0\0\0\0\0", 8)         = 8
ftruncate(15, 8388608)                  = 0
gettid()                                = 2446
timerfd_settime(14, TFD_TIMER_ABSTIME, {it_interval={tv_sec=0, tv_nsec=0}, it_value={tv_sec=13897, tv_nsec=88832000}}, NULL) = 0
epoll_wait(8, [{events=EPOLLIN, data={u32=1095348704, u64=94378706711008}}], 30, -1) = 1
read(14, "\1\0\0\0\0\0\0\0", 8)         = 8
rt_sigprocmask(SIG_BLOCK, ~[BUS RTMIN RT_1], [INT USR1 USR2 TERM RT_3], 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x7feba74a55b0, sa_mask=[], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7feba745afd0}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
mmap(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7feba59ff000
mprotect(0x7feba5a00000, 8388608, PROT_READ|PROT_WRITE) = 0
rt_sigprocmask(SIG_BLOCK, ~[], ~[BUS KILL STOP RTMIN RT_1], 8) = 0
clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7feba61ff990, parent_tid=0x7feba61ff990, exit_signal=0, stack=0x7feba59ff000, stack_size=0x7ffd80, tls=0x7feba61ff6c0}, 88) = -1 ENOSYS (Die angeforderte Funktion ist nicht implementiert)
clone(child_stack=0x7feba61fed70, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTIDstrace: Process 2456 attached
 <unfinished ...>
[pid  2456] rseq(0x7feba61fffe0, 0x20, 0, 0x53053053 <unfinished ...>
[pid  2446] <... clone resumed>, parent_tid=[2456], tls=0x7feba61ff6c0, child_tidptr=0x7feba61ff990) = 2456
[pid  2456] <... rseq resumed>)         = 0
[pid  2446] rt_sigprocmask(SIG_SETMASK, ~[BUS KILL STOP RTMIN RT_1],  <unfinished ...>
[pid  2456] set_robust_list(0x7feba61ff9a0, 24 <unfinished ...>
[pid  2446] <... rt_sigprocmask resumed>NULL, 8) = 0
[pid  2456] <... set_robust_list resumed>) = 0
[pid  2446] rt_sigprocmask(SIG_SETMASK, [INT USR1 USR2 TERM RT_3],  <unfinished ...>
[pid  2456] rt_sigprocmask(SIG_SETMASK, ~[BUS KILL STOP RTMIN RT_1],  <unfinished ...>
[pid  2446] <... rt_sigprocmask resumed>NULL, 8) = 0
[pid  2456] <... rt_sigprocmask resumed>NULL, 8) = 0
[pid  2446] gettid( <unfinished ...>
[pid  2456] prctl(PR_SET_NAME, "journal-offline"... <unfinished ...>
[pid  2446] <... gettid resumed>)       = 2446
[pid  2456] <... prctl resumed>)        = 0
[pid  2446] timerfd_settime(14, TFD_TIMER_ABSTIME, {it_interval={tv_sec=0, tv_nsec=0}, it_value={tv_sec=13917, tv_nsec=88832000}},  <unfinished ...>
[pid  2456] fsync(15 <unfinished ...>
[pid  2446] <... timerfd_settime resumed>NULL) = 0
[pid  2456] <... fsync resumed>)        = 0
[pid  2446] epoll_wait(8,  <unfinished ...>
[pid  2456] fsync(15)                   = 0
[pid  2456] rt_sigprocmask(SIG_BLOCK, ~[RT_1], NULL, 8) = 0
[pid  2456] madvise(0x7feba59ff000, 8368128, MADV_DONTNEED) = 0
[pid  2456] exit(0)                     = ?
[pid  2456] +++ exited with 0 +++
<... epoll_wait resumed>[{events=EPOLLIN, data={u32=1095348704, u64=94378706711008}}], 30, -1) = 1
read(14, "\1\0\0\0\0\0\0\0", 8)         = 8
gettid()                                = 2446
fsync(15)                               = 0
newfstatat(15, "", {st_mode=S_IFREG|0640, st_size=8388608, ...}, AT_EMPTY_PATH) = 0
ftruncate(15, 8388608)                  = 0
fsync(15)                               = 0
fsync(15)                               = 0
munmap(0x7feba6200000, 8388608)         = 0
close(15)                               = 0
epoll_ctl(8, EPOLL_CTL_DEL, 3, NULL)    = 0
close(3)                                = 0
epoll_ctl(8, EPOLL_CTL_DEL, 6, NULL)    = 0
epoll_ctl(8, EPOLL_CTL_DEL, 5, NULL)    = 0
epoll_ctl(8, EPOLL_CTL_DEL, 4, NULL)    = 0
signalfd4(10, [USR2], 8, SFD_CLOEXEC|SFD_NONBLOCK) = 10
close(10)                               = 0
signalfd4(11, [INT], 8, SFD_CLOEXEC|SFD_NONBLOCK) = 11
close(11)                               = 0
close(12)                               = 0
epoll_ctl(8, EPOLL_CTL_DEL, 9, NULL)    = 0
close(8)                                = 0
close(14)                               = 0
close(6)                                = 0
close(5)                                = 0
close(4)                                = 0
close(9)                                = 0
close(13)                               = 0
exit_group(0)                           = ?
+++ exited with 0 +++

相关内容