cgroup : option or name mismatch, new: 0x0 “”, old: 0x4 “systemd”

  • A+

遇到一个奇怪的问题,Arch可以重新启动,但是执行halt的时候报错“cgroup : option or name mismatch, new: 0x0 "", old: 0x4 "systemd"”,貌似官方暂时没有好的解决方法:

Okay, here's a rather long explanation of some of the things that happen during shutdown (simplified at some places, because some details don't help the understanding at all).

systemd activates, which conflicts with all services and mount points, essentially stopping everything that was started.

Activating starts a service that creates the executable /run/initramfs/shutdown, if it doesn't exist yet (more on that further down).

Upon reaching, systemd replaces itself with /usr/lib/systemd/systemd-shutdown.

systemd-shutdown tries kill all remaining processes, unmount all remaining file systems, detach all loop and device-mapper devices. It gives up at some point, since most of the time it will fail for a few mount points.

If /run/systemd/shutdown does not exist, systemd-shutdown proceeds to power off or reboot the machine.

systemd-shutdown changes the root to /run/initramfs, puts the old root to /oldroot and replaces itself with /shutdown.

In our case, /shutdown is a copy of /usr/lib/systemd/systemd-shutdown, which again tries to unmount everything and so on. Most of the time, it succeeds now (this means that the root file system is not only remounted read-only as it was classically done, but unmounted entirely. Any encryption mapping is also closed, which causes the kernel to wipe the encryption key from memory, to prevent a cold boot attack).

/shutdown then proceeds to power off or reboot.

So, how does the hardware watchdog come into play here? By default, systemd sets the watchdog timer to 10 minutes before it replaces itself with systemd-shutdown. Then it closes it, but does not stop it. When systemd-shutdown takes over, it opens the watchdog again. The same happens again when systemd-shutdown switches to /run/initramfs. This has a very useful result: If somehow the execution of the new binary fails, the hardware watchdog will time out after 10 minutes and reboot the computer - so your machine reboots instead of hanging indefinitely. The downside: You get a "watchdog did not stop" warning twice during shutdown.

As for the other error:

cgroup : option or name mismatch, new: 0x0 "", old: 0x4 "systemd"

This is a message from the kernel that is generated when a cgroup file system is remounted and options are changed that should not be changed. I cannot explain this entirely, but somehow this seems to happen while /oldroot/sys/fs/cgroup/systemd is being unmounted. In any case, it is of no special interest.



:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: