I am porting from SuseLinux to CentOS
Default Path Variable of cronjob in Suse Linux was - PATH=/usr/bin:/bin
All the Application Scripts worked fine in Suse Linux.
Now in CentOS, many binaries have been moved to /usr/sbin
directories.
Now when these application scripts are run from cron job in CentOS they do not work because cron job default PATH in Centos is also PATH=/usr/bin:/bin
. So these Cron scripts cannot access binaries present in /sbin
or /usr/sbin
directories.
Have to make PATH
variable like PATH=/usr/bin:/bin:/usr/sbin
So that all my application scripts work.
I don't want to change Application Scripts and give the full path to all the binaries in these scripts. As it would produce many changes.
Setting PATH
variable on top of Cron Script when the application installs and removing it when the application uninstalls, and even making changes during application upgrade also seems a lot of work.
I wanted to know the optimal or less work solution It would be better if the change involves is in application side and I don't have to make changes in OS rpm.