ntt360 / pmon2

golang进程管理工具(golang process manager)
Apache License 2.0
988 stars 133 forks source link

pmon2添加子命令为什么需要sudo? #5

Closed liuzhuan23 closed 2 years ago

liuzhuan23 commented 2 years ago

pmon2添加子命令,必须用sudo,是因为cobra.Command的要求吗?

liuzhuan23 commented 2 years ago

不用回复了,找到sudo的原因了,因为在app/executor/executor.go内用了&syscall.SysProcAttr{Credential},这里用来切换用户,这必须提升权限