How to change the temporary file directory of a 1С:Enterprise server
When a 1C:Enterprise server is running on Linux, errors caused by 1C:Enterprise attempting to access files missing from the temporary directory may occur. This issue appears because a script cleans the temporary file directory. This article describes how to avoid this issue.
The variety of Linux distribution kits cannot give you a 100% guarantee that the following steps are applicable to all of them without any modification. However, the general idea stays the same. The steps given in this article are fully applicable to Fedora Core 4 and its analogs where bash is used as a command-line shell.
The default temporary file directory is /tmp. It is processed by scheduled runs of the /etc/cron.daily/tmpwatch script, which deletes files that have not been accessed for a long time.
To eliminate the issue, you have to change the temporary file directory of 1C:Enterprise server /tmp/.usr1cv82). To change the directory, add the following lines to the .bash_profile file, which is located in the home directory of the user on whose behalf the 1С:Enterprise server runs:
TMPDIR=/tmp/.usr1cv82 export TMPDIR
You can use any directory as a temporary file directory. Ensure that the user on whose behalf the 1С:Enterprise server runs has the right to write to this directory.
To apply the changes, restart the 1С:Enterprise server.
Then exclude the directory from the list of directories processed by the tmpwatch utility, which is started automatically by the OS job scheduler.
In the /etc/cron.daily/tmpwatch script, modify the line that processes the /tmp directory by adding the parameter indicating that the directory should be skipped. Example:
/usr/sbin/tmpwatch -x /tmp/.usr1cv82 240 /tmp
NOTEIf you choose a directory that is not processed by tmpwatch, you do not have to change the script.