We are getting chattr process in cpanel.

winlinsam

Member
Apr 21, 2009
7
0
51
Hello,

We are getting chattr process everyday on particular time.When process comes online our server load increases and not able to decrease the load whenever chattr process up.
And when we kills chattr process then server load get decreases.

01:17:56 up 11 days, 13:44, 5 users, load average: 10.53, 6.07, 5.54

So please let us know how to avoid this in future.
 

JayFromEpic

Well-Known Member
Apr 2, 2011
218
8
68
Scottsdale
cPanel Access Level
Root Administrator
Twitter
Well chattr is a Linux command that basically makes a file immutable and is used for file attributes. It is important to have chattr on some files so they will not be disrupted in a update or upgrade. Now there is some very important files you do not want to take off the chattr. When the process comes up, see what user it is under. If it is under root, you will need to see what file is trying to change something or if there is a automatic update setup that could be doing it as well. So I suggest checking if automatic updates are set and see if you have a conflicting file trying to change something.
 

JaredR.

Well-Known Member
Feb 25, 2010
1,834
23
143
Houston, TX
cPanel Access Level
Root Administrator
Please note that, with very few exceptions, files on a cPanel server should not have attributes such as i (immutable) or a (append-only) set.

Using chatter to set the i and a attributes on files that cPanel uses or manages will cause problems. It will prevent cPanel from properly updating or configuring services. If cPanel is reverting custom changes to a file, such as the Exim or Apache configuration, using chattr +i is not the proper way to prevent that type of behavior. Instead, tools are provided in cPanel to make custom changes to services' configurations without the use of chattr.

I can go into more detail if anyone wants information about making changes to specific services that will be preserved when cPanel updates, but I wanted to mention that cPanel does not use the i and a attributes and these should not be set on a cPanel server.

(The lone exception I can think of is a single file, fpexe, that is part of FrontPage extensions. That is one of the only files related to cPanel in any way that normally should have the i attribute applied.)
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
38
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
To get more details on the process when it runs beyond what has been noted, you can run the following commands to get details:

Code:
ps aux | grep chattr
lsof -p PID#
xargs -n 1 -0 < /proc/PID#/environ
In the above, you would run the ps aux to find out the PID number for the process, then replace PID# in the next two commands with the PID number of that process. The lsof will show what files the process has opened, while the environment (/proc/PID#/environ) of the process will show what it is running. These are two major ways to determine what is going on for a set process.