[StarCluster] Running remote commands _*as a different user*_
Steve Darnell
darnells at dnastar.com
Fri Feb 8 14:07:48 EST 2013
Greetings,
I am interested in running remote commands from the command line as a different user. The put and get commands have a switch to use a user other than root. Is there a similar feature for running remote commands with the sshmaster command? The documentation does not list this as an option: http://star.mit.edu/cluster/docs/latest/manual/runcommands.html
I know that I can remotely execute "su - sgeadmin --command <COMMAND>", but variable substitution for a command with multiple arguments requires multiple sets of nested strings and the correct order of quotes and ticks. I resorted to an eval statement after an hour of failure trying to perform a one-liner. Part of that failure originated from forgetting to include hyphen with su to use a login shell, which sets up the SGE environment with a configuration file in /etc/profile.d.
cmd="starcluster sshmaster $clustername 'su - sgeadmin --command \"qsub -V -o /home/sgeadmin/$jobid.out -e /home/sgeadmin/$jobid.err /home/sgeadmin/$jobid.sh\"'"
eval $cmd
Regards,
Steve
More information about the StarCluster
mailing list