search cancel

KILLJOBS files not deleted from /tmp directory


Article ID: 88181


Updated On:


CA Automic Applications Manager (AM)


Error Message :

Temporary KILLJOBS.<process id> files in the /tmp directory are not cleaned up when an SURUN job is killed.
Jobs generated using the SURUN program copy the exec/KILLJOBS to the /tmp directory in order for the Applications Manager (AM) user to be able to kill a job ran as another user.  When a job is killed, that process needs the KILL script in a location that can be executed as any user.  Since the $AW_HOME/tmp directory is not accessible to all users, the script has to be in a location that all OS users can access. 
If there is a restriction on deletes from the /tmp directory, non-root users may not be able to delete from the /tmp directory and so the temporary KILLJOBS.<process id> files generated when an SURUN job is killed can not be deleted and an error message similar to the one above is written to the SURUN’s Job log.


Cause type:
Root Cause: The KILL script needs to be able to delete the files. If there is a restriction on deletes from the /tmp directory, non-root users may not be able to delete from the /tmp directory.


OS Version: N/A


There are 2 possible solutions. 
  1. Recommended:  Fix the permissions on the /tmp directory so that non-root users can delete files.
  1. Set the $SU_KILL_SCRIPT variable to a different path. 
BEWARE:  When the KILL script is moved to another location for SURUN, it may or may not be able to execute for every user (meaning hung PIDS) and the file may or may not be removed (files remain).  Therefore this change is not recommended and will not be supported by Automic.  Should issues arise in the future as a result of setting this variable to a different path, Automic will require you to revert the change.

Steps to set the $SU_KILL_SCRIPT variable: 
  • Create a directory in the Applications Manager's /tmp directory named KILLJOBS
  • Edit the $AW_HOME/exec/SURUNP script and add the following lines to the script above the line "echo in SURUNP"
SU_KILL_SCRIPT= <path to the $AW_HOME/tmp directory>/KILLJOBS; export SU_KILL_SCRIPT
  • Change to the directory $AW_HOME/exec 
cd $AW_HOME/exec
  • Change the owner of KILLJOBS to root and set the uid bit.  This will allow the KILLJOBS script to be able to delete files from the $AW_HOME/tmp directory that are owned by root.
chown root KILLJOBS
chmod 4711 KILLJOBS
  • Save the file, and when an SURUN job is killed the KILLJOBS files will be deleted from the $AW_HOME/tmp/KILLJOBS directory, and will no longer be created in the /tmp directory.

Fix Status: No Fix

Fix Version(s):

Additional Information

Workaround :