I was wondering it is safe or an acceptable practice to use sudo
to run an application from another one. For example, Let's say I have an application that uses a configuration file to do its work and, somewhere in that file exists the following line (in this case, I'd like to create a DB):
/usr/bin/sudo -u postgres /usr/bin/psql < /home/userX/create.sql
is this acceptable in a sys admin perspective?