Re: use pssh to restart a service

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



>
> Have you tried running the command from a conventional login?
> sudo -S
> expects a password from stdin, where is that being supplied?


Yep! That works fine.

#ssh -qt  bluethundr@xxxxxxxxxxxxxxx "/bin/sudo -S /bin/systemctl restart
elasticsearch"
#ssh -qt  bluethundr@xxxxxxxxxxxxxxx "/bin/echo $?"
0

And the user has 'NOPASSWD' access.

Any ideas?

Thanks,
Tim

On Sat, Oct 31, 2015 at 5:09 PM, Tony Schreiner <anthony.schreiner@xxxxxx>
wrote:

> On Sat, Oct 31, 2015 at 5:04 PM, Tim Dunphy <bluethundr@xxxxxxxxx> wrote:
>
> > Hi all,
> >
> >  I need to restart a service on a few elasticsearch nodes. I'm trying to
> do
> > it with pssh.
> >
> >  I'm getting this error when I try to do that:
> >
> > pssh -h es_list   "/bin/sudo -S /bin/systemctl restart elasticsearch"
> > [1] 17:01:50 [FAILURE] bluethundr@xxxxxxxxxxxxxxx Exited with error
> code 1
> > [2] 17:01:51 [FAILURE] bluethundr@xxxxxxxxxxxxxxx Exited with error
> code 1
> > [3] 17:01:51 [FAILURE] bluethundr@xxxxxxxxxxxxxxx Exited with error
> code 1
> >
> > I have to sudo up from my user account as root logins are disallowed.
> >
> > However a simple 'echo hello' command that doesn't require sudo works
> fine:
> >
> > #pssh -h es_list   "/bin/echo hello"
> > [1] 17:00:40 [SUCCESS] bluethundr@xxxxxxxxxxxxxxx
> > [2] 17:00:41 [SUCCESS] bluethundr@xxxxxxxxxxxxxxx
> > [3] 17:00:41 [SUCCESS] bluethundr@xxxxxxxxxxxxxxx
> >
> > What am I doing wrong?
> >
> > Thanks,
> > Tim
> >
> >
> Have you tried running the command from a conventional login?
>
> sudo -S
> expects a password from stdin, where is that being supplied?
> _______________________________________________
> CentOS mailing list
> CentOS@xxxxxxxxxx
> https://lists.centos.org/mailman/listinfo/centos
>



-- 
GPG me!!

gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
https://lists.centos.org/mailman/listinfo/centos



[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux