Linux 卡在启动时:启动作业正在运行

Linux 卡在启动时:启动作业正在运行

我有一台 NixOS 服务器,在重新启动后卡在启动时。它显示以下消息:A start job is running for Waiting for NixOps keys (1d 3h / no limit)

系统正在等待的任务是 systemd 服务。我做了一些研究,发现当这个问题发生时,它通常会在一段时间后超时并系统启动。然而,就我而言,它已经卡住了一天多了。有什么想法如何绕过该状态吗?

答案1

根据 NixOps 手册...

来自deployment.keys的密钥存储在临时文件系统的/run/下,并且在重新启动后不会保留...请注意,所有nixops命令都会在适当的时候隐式上传密钥,因此只有在无人值守的重新启动后才需要手动发送密钥。

尝试一下nixops send-keys命令。

nixops send-keys [ --include machine-name... ] [ --exclude machine-name... ]
Description

This command uploads the keys described in deployment.keys to remote machines in the /run/keys/ directory.

Keys are not persisted across reboots by default. If a machine reboot is triggered from outside nixops, it will need nixops send-keys to repopulate its keys.

Note that nixops deploy does an implicit send-keys where appropriate, so manually sending keys is only necessary after unattended reboots.
Options

--include machine-name...

    Only operate on the machines explicitly mentioned here, excluding other machines.
--exclude machine-name...

    Only operate on the machines that are not mentioned here.

https://nixos.org/nixops/manual/#idm140737318306400

相关内容