I am trying to run a script from a webapp on tomcat6. The problem is that I need superuser permissions for tomcat6 user to run the script.
I have not changed my sudoers file, I just created a new one at /etc/sudoers.d/ that looks like this:
Defaults env_keep += "JAVA_HOME"
# Host alias specification
# User alias specification
# Cmnd alias specification
Cmnd_Alias TOMCAT_ALLOWED = /opt/domotics/databasebackup.sh, /usr/bin/innobackupex
# User privilege specification
tomcat6 ALL=(ALL) NOPASSWD: TOMCAT_ALLOWED
The problem is that I keep getting this error:
"sudo no tty present and no askpass program specified"
I know why I am getting this error, I just do not know how to solve it :S
I have already used "Defaults visiblepw" but this option only makes my webapp act like an endless loop (prompts for a password and I do not want that behavior).
Am I missing something? (information in http://ubuntuforums.org/archive/index.php/t-639803.html is not solving my problem either)
If you need more information, just let me know
Thanks in advance,