I want to apply a sequence of commands to a load of servers. It is a relatively complicated sequence of commands including su-ing as a different user, killing a process, exiting, installing a Slackware package, which has a post-installation script, su-ing as a different user again, starting a daemon, sleeping a couple of seconds and then tailing a log file to check that the daemon is healthy.
To apply the command to many servers, I have a BASH for loop which changes $server and executes the sequence of commands using SSH as follows:
ssh root@$server "blah; blah; blah"
All I need to do is to paste the root password and I'm in business.
However, one of my commands is throwing up the error: "stderr is not a tty - where are you?". Evidently one of the commands is checking stderr and getting disappointed. Rather than sorting out the command which is the culprit, is there something I can do with SSH to avoid this?