root executes a script as another user

we have this script that stops, starts and monitor process scheduler. prcs_control. this script runs perfectly when executed by ps_user.

we are now creating a new script that will run this script and is executed by root. this script needs to execute the prcs_control as ps_user because root can not execute the psadmin command.

here's how we coded it to be executed by ps_user

su -c "path/prcs_control arg1 arg2"

the script exits successfully but when the status process sched is checked via manual psadmin, it did not stop or start the process sched.

any idea?

If the script is run by root, then your su command needs to be
su - ps_user -c "path/prcs_control arg1 arg2"

If the script is being run by ps_user, then you may need to source the .profile or .login (it matters what the shell is) to set up environment variables.