CP Linux - How to change the location of the CP_TEMP_FOLDER
85
Created On 11/10/26 11:02 AM - Last Modified 11/10/26 16:02 PM
Objective
The CP uses a temp folder to prepare metadata. this folder is by default created in the /tmp folder of the system, as in:
/tmp/CP_TEMP_FOLDER
In some cases, organizational policies require the /tmp folder to get cleared periodically, causing the CP to not function (following the deletion of the required folder CP_TEMP_FOLDER)
This article demonstrates how the CP can be directed to create the CP_TEMP_FOLDER in a location other than /tmp
Environment
12.1;12.4;12.6 Privileged Access Manager (PAM, self-hosted) Credential Provider
Procedure
- Delete the folder /tmp/CP_TEMP_FOLDER
- Make a new temporary folder to have the CP_TEMP_FOLDER created in, for example /newTemp
- Grant the folder the required permissions:
- chmod 733 /newTemp
- Set a new environment variable for AIM_TEMPFOLDER to the newly created directory:
- export AIM_TEMP_FOLDER=/newTemp
- Add the environment variable declaration to the CP service script:
- Open the file /etc/init.d/aimprv
- Under the start function, immediately below the opening curly bracket of the start function, add the same export command from above (step 4), it should look like this:
- Save the file and exit
- Amend the /etc/profile, add the new AIM_TEMP_FOLDER location to the last line of the file:
export AIM_TEMP_FOLDER=/newTemp
This ensures the variable is preserved after restarting the OS. - Restart the CP service:
- service aimprv restart
- A new CP_TEMP_FOLDER folder will be created under /newTemp/ with all the correct permissions and content.
- Observe that the CP_TEMP_FOLDER folder is not getting re-created under /tmp/ anymore
- Perform some test CP calls to ensure everything is working fine.