leichongxiang / sshpt

Automatically exported from code.google.com/p/sshpt
0 stars 0 forks source link

System reboot fails #5

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. ./sshpt.py -f hosts "sudo /sbin/shutdown -r  now"
2. ./sshpt.py -f hosts "sudo reboot"
3.

What is the expected output? What do you see instead?
The system should reboot. The System does not reboot

What version of the product are you using? On what operating system?
1.1.3 on RHEL 5

Please provide any additional information below.

/var/log/messages shows following:
Jul  8 11:16:05 l01 sudo: foo : no tty present and no askpass program specified 
; TTY=unknown ; PWD=/home/foo ; USER=root ; COMMAND=shutdown -r now

Alternatively if I do  following command it works
"ssh -t hostname "sudo /sbin/shutdown -r now""      

Original issue reported on code.google.com by gary.car...@gmail.com on 8 Jul 2011 at 6:28

GoogleCodeExporter commented 9 years ago
Try the -s flag to execute a command with sudo:
./sshpt.py -f hosts -s "reboot"
or
./sshpt.py -f hosts -s "/sbin/shutdown -r now"

Original comment by preston....@gmail.com on 19 Oct 2011 at 4:59

GoogleCodeExporter commented 9 years ago
Thank you. Its working.

Original comment by gary.car...@gmail.com on 19 Oct 2011 at 6:38