1
collery 2020 年 11 月 27 日
可以
|
2
Chemist 2020 年 11 月 27 日
alias down=ssh userA:passA@hostA "service test stop" && shutdown
|
3
f6x 2020 年 11 月 27 日
楼上方法好.
直接写进 init.d 里网络情况和结果异常都没法处理. |
4
shily 2020 年 11 月 27 日
Let me Google it for you
谷歌第一个链接是 https://opensource.com/life/16/11/running-commands-shutdown-linux 就提到了。 runlevel 3 就是关机 |
5
no1xsyzy 2020 年 11 月 27 日
init.d 估计不行, #2 反转了控制,未必可行(比如 A 在内网?)
systemd 倒是可以保证在网络退出前先完成 stop |
6
julyclyde 2020 年 11 月 27 日
跨机器啊……这样做的话,B 那里感觉就是莫名其妙被关了
是不是不太好? |
7
zunxiongchen OP @kyuuseiryuu @f6x 你顾虑的对。我参考下
|
8
zunxiongchen OP @julyclyde B 机器就是 DB server 而已。服务于 A 的 web 应用,A,B 想要同步关
|
9
zunxiongchen OP @no1xsyzy 是。我用的 systemd
|
10
no1xsyzy 2020 年 12 月 1 日
|