Highlighted

pre-command with python script [TTY - ERROR]

Hello,

 

I'm trying to run pre-command/post-command with execution of python script on remote linux server.

But I can see many error on agent RALUS log (/var/VRTSralus/beremote.service.log):

sudo: sorry, you must have a tty to run sudo

sudo: sorry, you must have a tty to run sudo

sudo: sorry, you must have a tty to run sudo

 

When I'm trying to run my python script localy on my linux server its works well. I think the problem come from in the fact of the execution of the script is made by a real user when i do it in local (manually) and not from backup exec pre-command/post-command. 

By curiosity i've try to execute the python script from an other linux server through SSH Like this :

ssh XXXX@XXXXX 'symantec-script/test.py -c'
sudo: sorry, you must have a tty to run sudo

So can you tell me if we can force the pseudo tty allocation from symantec backup exec ? or the only workaround is to comment on my sudoers files the options : 

#Defaults    requiretty 

 

Do you know an other workaround on symantec side ? like an argument to put in the pre-command with my script path ?

Thanks for your feedback Smiley Happy

Tags (2)
2 Replies

Re: pre-command with python script [TTY - ERROR]

Well, precommands are supported. Can you try something simple first and then move forward. Maybe something will show up as you take steps:

https://www.veritas.com/support/en_US/article.000016305

This has simple commands to try for the pre.

Re: pre-command with python script [TTY - ERROR]

Look at the -t and -tt options on ssh, one of those ought to do what you want.

from the ssh man page:

     -t      Force pseudo-terminal allocation.  This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, e.g. when implementing menu services.  Multiple -t options force tty allocation, even if ssh has no local tty.