[CentOS] use pssh to restart a service

Mon Nov 2 00:06:15 UTC 2015
Gordon Messmer <gordon.messmer at gmail.com>

On 10/31/2015 04:16 PM, Tim Dunphy wrote:
> Got the same exact message!
>
> Anything else I can try?

I think you need to double-check your sudoers file.  Use the '-i' 
argument to pssh to get more information.

# cat /etc/sudoers.d/gordon
gordon    ALL=(ALL)    NOPASSWD: ALL

$ pssh -h t -i sudo echo true
[1] 16:02:12 [FAILURE] MYHOST Exited with error code 1
Stderr: sudo: sorry, you must have a tty to run sudo



# cat /etc/sudoers.d/gordon
Defaults:gordon        !requiretty, visiblepw
gordon    ALL=(ALL)    NOPASSWD: ALL

$ pssh -h t -i sudo echo true
[1] 16:02:30 [SUCCESS] MYHOST
true