Change TMP environment variable

JoyceBabu

Member
Dec 7, 2010
13
0
51
Hi,

The environment variable TMP is set to /root/tmp by easy apache. This is creating problem with XCache, because user nobody does not have permission to create file in /root/tmp. The 0777 permission on /root/tmp has no effect.

I tried following the instructions at Modifying Environment Variables and creating a file TMP under /var/cpanel/easy/apache/rawenv/ and rebuilding easy apache. But it did not work.

How can I change the value of TMP to /tmp. I have a cPanel dedicated server with Apache / PHP compiled with similar easy apache options. It does not have the environment variable TMP set.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,202
363
Hello :)

You may actually want to report the issue as a bug if it's resulting in an issue with XCache. What is the specific error message that you receive?

Thank you.
 

JoyceBabu

Member
Dec 7, 2010
13
0
51
Hi Michael,

Xcache is unable to create the lock files

PHP Fatal error: xc_fcntl_create: open(/root/tmp/.xcache.99.20845.1.lock, O_RDWR|O_CREAT, 0666) failed: in Unknown on line 0
PHP Fatal error: xc_fcntl_create: open(/root/tmp/.xcache.99.20845.2.lock, O_RDWR|O_CREAT, 0666) failed: in Unknown on line 0
PHP Fatal error: xc_fcntl_create: open(/root/tmp/.xcache.99.20845.3.lock, O_RDWR|O_CREAT, 0666) failed: in Unknown on line 0
PHP Fatal error: xc_fcntl_create: open(/root/tmp/.xcache.99.20845.4.lock, O_RDWR|O_CREAT, 0666) failed: in Unknown on line 0
PHP Fatal error: xc_fcntl_create: open(/root/tmp/.xcache.99.20845.5.lock, O_RDWR|O_CREAT, 0666) failed: in Unknown on line 0
PHP Fatal error: xc_fcntl_create: open(/root/tmp/.xcache.99.20845.6.lock, O_RDWR|O_CREAT, 0666) failed: in Unknown on line 0
PHP Fatal error: xc_fcntl_create: open(/root/tmp/.xcache.99.20845.7.lock, O_RDWR|O_CREAT, 0666) failed: in Unknown on line 0
PHP Fatal error: xc_fcntl_create: open(/root/tmp/.xcache.99.20845.8.lock, O_RDWR|O_CREAT, 0666) failed: in Unknown on line 0
PHP Fatal error: xc_fcntl_create: open(/root/tmp/.xcache.99.20845.9.lock, O_RDWR|O_CREAT, 0666) failed: in Unknown on line 0
PHP Fatal error: xc_fcntl_create: open(/root/tmp/.xcache.99.20845.10.lock, O_RDWR|O_CREAT, 0666) failed: in Unknown on line 0
PHP Fatal error: xc_fcntl_create: open(/root/tmp/.xcache.99.20845.11.lock, O_RDWR|O_CREAT, 0666) failed: in Unknown on line 0
PHP Fatal error: xc_fcntl_create: open(/root/tmp/.xcache.99.20845.12.lock, O_RDWR|O_CREAT, 0666) failed: in Unknown on line 0
[Wed Sep 04 08:24:02.787475 2013] [:error] [pid 6930] [client 117.242.16.43:61073] [Cms\\ArticleManager] PHP <b>Fatal error</b>: xc_fcntl_lock failed errno:9 in <b>/home/user/.cms-cache/tmp/37d28b3cec4752d9a327024d824ee459.tmp.php</b> on line <b>4</b><br />
https://groups.google.com/forum/#!topic/xcache/sFE35akcjso

Joyce Babu
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,202
363
It looks like this may actually be an issue with the XCache configuration itself. However, I advise submitting a bug report via:

Submit A Bug Report

It's possible some changes to the initial configuration of this module need to be made when it's installed through cPanel.

Thank you.
 

ThinIce

Well-Known Member
Apr 27, 2006
352
9
168
Disillusioned in England
cPanel Access Level
Root Administrator
Out of interest, is this problem occurring immediately after the apache build only? I submitted a similar case (don't remember the exact specifics) over a year ago now because I'd found it necessary to remember to manually restart apache after each built to prevent issues the env variables.

As I recall it was relatively promptly rectified, so be interesting if a similar issue has returned.
 

JoyceBabu

Member
Dec 7, 2010
13
0
51
It looks like this may actually be an issue with the XCache configuration itself. However, I advise submitting a bug report via:

Submit A Bug Report

It's possible some changes to the initial configuration of this module need to be made when it's installed through cPanel.

Thank you.
I was using a standalone version of XCache. I'll try with the bundled XCache. Xcache uses the $TMP directory for storing the lock files. User nobody does not have permission to write to /root/tmp even though it is 0777. So, I don't think it is an XCache problem.

---
[email protected] [/var/cpanel/easy]# chpst -u nobody touch /root/tmp/.xcache.99.27445.1.lock
touch: cannot touch `/root/tmp/.xcache.99.27445.1.lock': Permission denied
---

But, why am I unable to modify the TMP variable?

Out of interest, is this problem occurring immediately after the apache build only? I submitted a similar case (don't remember the exact specifics) over a year ago now because I'd found it necessary to remember to manually restart apache after each built to prevent issues the env variables.

As I recall it was relatively promptly rectified, so be interesting if a similar issue has returned.
I tried restarting apache several times, but it did not work.
 
Last edited:

JoyceBabu

Member
Dec 7, 2010
13
0
51
It was a problem with XCache, after all. When I rebuilt apache with the bundled XCache, the environment variable and the error vanished.