小编Tom*_*art的帖子

hwclock:无法通过任何已知方法访问硬件时钟

在 Debian 服务器上,我遇到了以下问题hwclock

$ hwclock --show 
hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --debug option to see the details of our search for an access method.
Run Code Online (Sandbox Code Playgroud)

系统在 backports 内核上运行Debian 4.9.18-1~bpo8+1 (2017-04-10)

这是调试输出:

$ hwclock --debug
hwclock from util-linux 2.25.2
hwclock: cannot open /dev/rtc: Device or resource busy
No usable clock interface found.
hwclock: Cannot access the Hardware Clock via any known method.
Run Code Online (Sandbox Code Playgroud)

时钟源:

$ cat /sys/devices/system/clocksource/clocksource0/current_clocksource
tsc
Run Code Online (Sandbox Code Playgroud)

最后,rtc设备存在: …

debian time-synchronization clock-synchronization

5
推荐指数
1
解决办法
2万
查看次数

如何用木偶更新grub?

我想将/etc/default/grubpuppet 中的一行更改为:

GRUB_CMDLINE_LINUX="cgroup_enable=memory"
Run Code Online (Sandbox Code Playgroud)

我试过使用 augeas 这似乎有这个魔法:

   exec { "update_grub":
    command => "update-grub",
    refreshonly => true,
   }

  augeas { "grub-serial":
    context => "/files/etc/default/grub",
    changes => [
      "set /files/etc/default/grub/GRUB_CMDLINE_LINUX[last()] cgroup_enable=memory",
    ],
    notify => Exec['update_grub'],
  }
Run Code Online (Sandbox Code Playgroud)

它似乎有效,但结果字符串不在引号中,而且我想确保任何其他值都用空格分隔。

GRUB_CMDLINE_LINUX=cgroup_enable=memory
Run Code Online (Sandbox Code Playgroud)

是否有某种机制如何附加值并逃避整个事情?

GRUB_CMDLINE_LINUX="quiet splash cgroup_enable=memory"
Run Code Online (Sandbox Code Playgroud)

configuration-management puppet

4
推荐指数
1
解决办法
4051
查看次数

Debian Jessie LXC 容器中的 systemd-journal 占用 100% CPU

在基于 Debian Jessie 创建新的 LXC 之后,在 Ubuntu 14.04 上,systemd-journal 会吃掉所有可用的 CPU。

lxc-create -n jessie -t debian
Run Code Online (Sandbox Code Playgroud)

debian lxc systemd

3
推荐指数
1
解决办法
3916
查看次数

Icinga2:在主机/服务关闭时发送电子邮件

我用 icingaweb2 安装并配置了 Icinga2。

我添加了一个带有测试服务的测试主机:我们称之为“example.com”。

这是测试主机:

/etc/icinga2/conf.d/hosts/example-com:

object Host "example-com" {
        //Importiert die generische Host-Vorlage aus der template.conf
        import "generic-host"
        //IPv4 Adresse
        address = "2xx.2xx.2xx.2xx"

        //Angabe des Betriebssystemtyps
        vars.os = "Linux OS"
        vars.sla = "24x7"
}
Run Code Online (Sandbox Code Playgroud)

好的,那么我们有了服务配置:

/etc/icinga2/conf.d/hosts/example-com/http.conf

object Service "http" {
    import "generic-service"
    host_name = "example-com"
    check_command = "http"
    vars.sla = "24x7"
}
Run Code Online (Sandbox Code Playgroud)

当然我在/etc/icinga2/conf.d/users.conf中添加了一个新的用户组

/**
 * The example user 'icingaadmin' and the example
 * group 'icingaadmins'.
 */

object User "icingaadmin" {
  import "generic-user"

  display_name = "Icinga 2 Admin"
  groups …
Run Code Online (Sandbox Code Playgroud)

monitoring icinga icinga2

3
推荐指数
1
解决办法
3万
查看次数

ntpd 无法同步 TIME_ERROR:0x41:时钟不同步

在 Debian 10 上,ntpd 4.2.8p12@1.3728-o无法同步并出现以下错误:

kernel reports TIME_ERROR: 0x41: Clock Unsynchronize
Run Code Online (Sandbox Code Playgroud)

这是ntp.conf

disable monitor

statsdir /var/log/ntpstats

restrict -4 default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict ::1

server 0.us.pool.ntp.org iburst
server 1.us.pool.ntp.org iburst
server 2.us.pool.ntp.org iburst
server 3.us.pool.ntp.org iburst

server   127.127.1.0
fudge    127.127.1.0 stratum 10
restrict 127.127.1.0

driftfile /var/lib/ntp/drift

Run Code Online (Sandbox Code Playgroud)

ntpq -c sysinfo:

associd=0 status=0614 leap_none, sync_ntp, 1 event, freq_mode,
system peer:        50-205-57-38-static.hfc.comcastbusiness.net:123
system peer mode:   client …
Run Code Online (Sandbox Code Playgroud)

ntp ntpd

3
推荐指数
1
解决办法
4万
查看次数