windows kill tool (send signal to process)

在Linux中,kill命令可以优雅地关闭进程,但Windows缺少类似功能。文章介绍了如何使用windows-kill工具在Windows环境中实现自动化运维中的优雅进程关闭,以替代Ctrl+C的方式,适合批处理脚本操作。

Linux 的 kill  命令可以支持优雅关进程, windows 没有内置这样的工具, 只是支持Ctrl+C 方式来优雅关闭当前console 创建程序.

但这不适合于自动化运维, 没法 shutdown 批处理脚本,  下面这个工具能很好支持这点.

https://github.com/alirdn/windows-kill

报错日志: [root@vdb1 script]# ./gs_expansion -U vastbase -G vastbase -h 192.168.248.140 -X ../cluster_config0721.xml Start expansion with cluster manager component. Start to send soft to each standby nodes. End to send soft to each standby nodes. Success to send XML to new nodes Start to perform perinstall on nodes: ['vdb4'] Preinstall command is: /tmp/gs_expansion_2025-07-21_13_22_17_999864/pkg/script/gs_preinstall -U vastbase -G vastbase -X /data/soft/vastbase-installer/cluster_config0721.xml -L --sep-env-file=/home/vastbase/.Vastbase --non-interactive 2>&1 Traceback (most recent call last): File "/data/soft/vastbase-installer/script/gspylib/threads/SshTool.py", line 609, in getSshStatusOutput raise Exception(ErrorCode.GAUSS_514["GAUSS_51400"] Exception: [GAUSS-51400] : Failed to execute the command: source /etc/profile && unset LD_LIBRARY_PATH && /data/soft/vastbase-installer/lib/python/bin/python3 /data/soft/vastbase-installer/script/gspylib/pssh/bin/pssh -t 310 -H vdb4 -P -p 300 -o /tmp/gauss_output_files_1405752_2025-07-21_13:22:19_199259_016 -e /tmp/gauss_error_files_1405752_2025-07-21_13:22:19_199259_016 "source /etc/profile;source /home/vastbase/.Vastbase;/tmp/gs_expansion_2025-07-21_13_22_17_999864/pkg/script/gs_preinstall -U vastbase -G vastbase -X /data/soft/vastbase-installer/cluster_config0721.xml -L --sep-env-file=/home/vastbase/.Vastbase --non-interactive 2>&1" 2>&1 | tee /tmp/gauss_result_1405752_2025-07-21_13:22:19_199259_016.log. Error: [1] 13:28:18 [FAILURE] vdb4 Timed out, Killed by signal Signals.SIGKILL During handling of the above exception, another exception occurred: Traceback (most recent call last): File "./gs_expansion", line 614, in <module> expansion.expand_run(expansion) File "./gs_expansion", line 447, in expand_run expand_impl.run() File "/data/soft/vastbase-installer/script/impl/expansion/expansion_impl_with_cm.py", line 558, in run self.do_preinstall() File "/data/soft/vastbase-installer/script/impl/expansion/expansion_impl_with_cm.py", line 470, in do_preinstall self.preinstall_run() File "/data/soft/vastbase-installer/script/impl/expansion/expansion_impl_with_cm.py", line 145, in preinstall_run self.ssh_tool.getSshStatusOutput(cmd, File "/data/soft/vastbase-installer/script/gspylib/threads/SshTool.py", line 650, in getSshStatusOutput raise Exception(str(e)) Exception: [GAUSS-51400] : Failed to execute the command: source /etc/profile && unset LD_LIBRARY_PATH && /data/soft/vastbase-installer/lib/python/bin/python3 /data/soft/vastbase-installer/script/gspylib/pssh/bin/pssh -t 310 -H vdb4 -P -p 300 -o /tmp/gauss_output_files_1405752_2025-07-21_13:22:19_199259_016 -e /tmp/gauss_error_files_1405752_2025-07-21_13:22:19_199259_016 "source /etc/profile;source /home/vastbase/.Vastbase;/tmp/gs_expansion_2025-07-21_13_22_17_999864/pkg/script/gs_preinstall -U vastbase -G vastbase -X /data/soft/vastbase-installer/cluster_config0721.xml -L --sep-env-file=/home/vastbase/.Vastbase --non-interactive 2>&1" 2>&1 | tee /tmp/gauss_result_1405752_2025-07-21_13:22:19_199259_016.log. Error: [1] 13:28:18 [FAILURE] vdb4 Timed out, Killed by signal Signals.SIGKILL
最新发布
07-22
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值