I have created one script with starting letter 'S' (Example: Start) and stored in the path "/etc/rc.d/".
This script was called automatically when we reboot the server.
In this script i am using 'su' command to switch other user but it is not working, it giving some error.
su sas -c "pwd ; whoami"
Note:
After done the reboot, same command is working fine but it is not working when we rebooting the server.