AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-324420

Neal Eastwood's questions

Martin Hope
Neal Eastwood
Asked: 2022-04-05 08:01:39 +0800 CST

journald RuntimeMaxUse 被忽略,配额绑定到 RuntimeMaxFileSize

  • 0

设置

在内核 4.19.62 上使用 systemd 244 (244.5+)。

我想将总日志存储大小设置为 100MB。Journald 设置为易失性存储,因此日志结束,/run/log/journal/...并且应该使用RuntimeMaxUse在/etc/systemd/journald.conf中设置存储配额,如下所示:

[Journal]
Storage=volatile
RuntimeMaxUse=100M
RuntimeMaxFileSize=2M

通过调整这些配置值,日志日志大小和配额确实会发生变化,并且 journalctl 中的启动消息也会显示变化。

在配置值更改之间,我停止 systemd-journald.service,删除所有system*文件/run/log/journal/...并重新启动服务。

注意:当Storage=persistent和日志使用时/var/log/journal/,等效的SystemMaxUse得到正确尊重。这似乎只是 volatile/RuntimeMaxUse 中的一个错误。

观察到的错误

Runtime MaxUse (100M) 被忽略。只要 Runtime MaxFileSize小于 32M ,日志配额就设置为64MB 。

如果 Runtime MaxFileSize设置为大于 32M,则日志配额设置为该值的两倍。

在这两种情况下,运行时MaxUse似乎都被忽略了。

这是 journald/systemd 配置处理中的错误吗?为什么 Runtime MaxUse被忽略,而使用 64M 或 double Runtime MaxFileSize作为日志配额?

我看到日志源中有几个地方可以将 max_use 设置为双倍 max_size:

  • https://github.com/systemd/systemd/blob/v244/src/journal/journal-file.c#L3747
  • https://github.com/systemd/systemd/blob/v244/src/journal/journal-file.c#L3772

错误示例

设置了64M 的配额(RuntimeMaxUse=100M而RuntimeMaxFileSize=2M不是我要求的 100M),如日志启动消息中所示:

systemd-journald[20312]: Runtime Journal (/run/log/journal/...) is 2.0M, max 64.0M, 62.0M free.
-- Runtime Journal (/run/log/journal/...) is currently using 2.0M.
-- Maximum allowed usage is set to 64.0M.
-- Leaving at least 1.5G free (of currently available 31.2G of disk space).
-- Enforced usage limit is thus 64.0M, of which 62.0M are still available.

使用RuntimeMaxUse=100Mand RuntimeMaxFileSize=31M,仍然使用 64M:

systemd-journald[20989]: Runtime Journal (/run/log/journal/...) is 8.0M, max 64.0M, 56.0M free.
-- Runtime Journal (/run/log/journal/...) is currently using 8.0M.
-- Maximum allowed usage is set to 64.0M.
-- Leaving at least 1.5G free (of currently available 31.2G of disk space).
-- Enforced usage limit is thus 64.0M, of which 56.0M are still available.

使用RuntimeMaxUse=100Mand RuntimeMaxFileSize=33M,配额最终为 66M:

systemd-journald[21557]: Runtime Journal (/run/log/journal/...) is 8.0M, max 66.0M, 58.0M free.
-- Runtime Journal (/run/log/journal/...) is currently using 8.0M.
-- Maximum allowed usage is set to 66.0M.
-- Leaving at least 1.5G free (of currently available 31.2G of disk space).
-- Enforced usage limit is thus 66.0M, of which 58.0M are still available.

使用RuntimeMaxUse=100M并且RuntimeMaxFileSize=200M我们突破了 100M 的限制,400M 似乎来自 200M 的 RuntimeMaxFileSize 的两倍:

systemd-journald[25271]: Runtime Journal (/run/log/journal/...) is 8.0M, max 400.0M, 392.0M free.
-- Runtime Journal (/run/log/journal/...) is currently using 8.0M.
-- Maximum allowed usage is set to 400.0M.
-- Leaving at least 1.5G free (of currently available 31.2G of disk space).
-- Enforced usage limit is thus 400.0M, of which 392.0M are still available.
systemd systemd-journald
  • 1 个回答
  • 364 Views
Martin Hope
Neal Eastwood
Asked: 2018-12-06 08:40:40 +0800 CST

如何在 Oracle Linux 6 的 kickstart 中强制 GPT 分区

  • 0

我想配置 OL6 kickstart 以安装从 BIOS 引导但使用 GPT 分区而不是 MBR 的系统,即使对于 <2TB 的磁盘也是如此。

我的 kickstart 文件的相关部分如下所示($ROOTDRIVE已正确初始化):

%pre
parted -s $ROOTDRIVE mklabel gpt

bootloader --location=partition --append="elevator=deadline nomodeset inst.gpt" --driveorder=$ROOTDRIVE
part biosboot --fstype biosboot --size=1 --ondisk=$ROOTDRIVE
part /boot --fstype ext3 --size=500 --ondisk=$ROOTDRIVE
part pv.2 --size=1 --grow --ondisk=$ROOTDRIVE`

我已经删除clearpart --all --drives=$ROOTDRIVE,zerombr因为这些据说会擦除我的partedGPT 并恢复 MBR。

我相信我的conf中的以下内容应该导致GPT:

  • parted mklabel gpt
  • --location=partition(不确定我是否真的需要这个?)
  • inst.gpt(可能仅在 OL7 中可用?)
  • part biosboot

然而,我生成的系统仍将主驱动器列为 MBR(msdos标签):

[root@localhost ~]$ parted -l
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 172GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

我的问题:我可以使用任何 kickstart 配置来确保我最终使用 GPT 磁盘而不是 MBR?

linux gpt
  • 1 个回答
  • 3366 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve