小编ise*_*rko的帖子

为什么`sudo pkill -HUP -f "nginx: master process"` 返回代码 129 而没有输出

我正在尝试使用pkill和触发 Nginx 主进程的重新加载sudo

服务器重新加载正常,但我很好奇是否有人知道为什么该命令sudo pkill -HUP -f "nginx: master process"返回代码 129?

# Running as root
$ pkill -HUP -f "nginx: master process"
$ echo $?

# Output is as expected:
0

# Running as a user (sudo is set to not prompt for a password)
% sudo pkill -HUP -f "nginx: master process
% echo $?

# Output is weird (considering sudo should be passing along the return
#                  code of the command it …
Run Code Online (Sandbox Code Playgroud)

process kill sudo

5
推荐指数
1
解决办法
2053
查看次数

标签 统计

kill ×1

process ×1

sudo ×1