Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

shell action in oozie

shell action in oozie

Expert Contributor

I am trying to execute a shell script from oozie. The script is used to download a file from a remote server using scp command.

 

The shell script looks like this:

 

 

sudo -u test scp userName@ServerIP:pathToFileONRemoteServer/export_all_products.csv /home/test

 

Now, I am using sudo - u test because password less ssh has been enabled for test user only. I came across error messages that suggested disabling tty and that's what I did for test user. 

 

However, Now I get:

 

sudo: no tty present and no askpass program specified
Failing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.ShellMain], exit code [1]

 

Why is that and how do we fix this? I am using hue and can't seem to enable password less ssh for hue user as it isn't a shell user and isn't a folder under with username under home directory. 

 

Is there a way around this?

1 REPLY 1

Re: shell action in oozie

Master Guru
Could you show us your sudo configuration? Does it declare NOPASSWD for all commands?

Also, since you're using a shell script, keep in mind that it would run in a YARN container and may therefore execute as either the 'yarn' user (in un-secure environments) or the job submitting user (in secure environments). The sudo command would therefore be executed as that user.