Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

对 __compat_restart_ssh 中 L43-L45 的一个问题 #11

Open
unknowndevQwQ opened this issue Nov 24, 2022 · 3 comments
Open

对 __compat_restart_ssh 中 L43-L45 的一个问题 #11

unknowndevQwQ opened this issue Nov 24, 2022 · 3 comments

Comments

@unknowndevQwQ
Copy link
Contributor

在 commit 79e276c 以及更早的提交中,

menhera.sh/menhera.sh

Lines 43 to 45 in 79e276c

! systemctl enable ssh
! systemctl reset-failed ssh
if ! systemctl restart ssh; then
L43-L45 为什么要再次 enable 并且 reset-failed sshd?如果是 reset-failed 后 enable --now 或者直接 enable --now 会有什么不良后果?

@Jamesits
Copy link
Owner

没什么不良后果啊,我理解的这两个操作是等效的
reset-failed 我暂且认为是必需的,如果本来的系统里面 sshd 处于 failed 状态,直接 start 是无效的

@unknowndevQwQ
Copy link
Contributor Author

没什么不良后果啊,我理解的这两个操作是等效的 reset-failed 我暂且认为是必需的,如果本来的系统里面 sshd 处于 failed 状态,直接 start 是无效的

再 enable 一次是因为处于新的 rootfs 吗?

@Jamesits
Copy link
Owner

再 enable 一次是因为处于新的 rootfs 吗?

是的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants