Are "system()" php functions created by script included in LVE?
Forum
  1. Forums
  2. CloudLinux and Control Panels
  3. CloudLinux and cPanel
  1. Host Provider
  2. 13.02.2012
  3.  Subscribe via email
Hello,

We have a user that runs a PHP script via cron every 6 hours. It seems to be loading the server quite a bit, and I\'m not sure if Cloud Linux is \"catching\" it or not in the user\'s LVE.

Here is the code in their PHP script:

---------------
system(\'for i in images/*; do mv $i public_html/search/images/; done\');
---------------

So this basically spawns a command shell process (running under the user\'s ID) which runs for 2 hours.

Will this sh command be included in the user\'s LVE? (ie: We have set the LVE default to 100% CPU and 1 processor... so I want to make sure this command will never use more then that limit.

Thanks.
Rate this post:
  1. 13.02.2012 10:02:12
  2. # 1
Igor Seletskiy Accepted Answer
Posts: 1201
Joined: 09.02.2010
0
Votes
Undo
Cron jobs should be inside LVE, just to make sure, could you give me output of:

uname -a
rpm -qa|grep vixie-cron
rpm -qa|grep lve
cat /etc/pam.d/crond
  1. 13.02.2012 10:02:48
  2. # 2
Host Provider Accepted Answer
Posts: 48
Joined: 31.01.2012
0
Votes
Undo
Here are the result of those commands:

--------------------------
@amy [~]# uname -a
Linux amy.removed-for-privacy.com 2.6.18-374.12.1.el5.lve0.8.54PAE #1 SMP Wed Jan 4 19:42:48 EET 2012 i686 i686 i386 GNU/Linux

[email protected] [~]# rpm -qa|grep vixie-cron
vixie-cron-4.1-77.7.el5.cloudlinux

-----
[email protected] [~]# rpm -qa|grep vixie-cron
vixie-cron-4.1-77.7.el5.cloudlinux
[email protected] [~]# rpm -qa|grep lve
lve-0.8-20
liblve-devel-0.8-20
lve-utils-0.6-10.el5.cloudlinux
kernel-PAE-2.6.18-374.12.1.el5.lve0.8.54
liblve-0.8-20
lve-stats-0.8-2.el5.cloudlinux
kernel-headers-2.6.18-374.12.1.el5.lve0.8.54

-----
[email protected] [~]# cat /etc/pam.d/crond
#
# The PAM configuration file for the cron daemon
#
#
auth sufficient pam_env.so
auth required pam_rootok.so
auth include system-auth
account required pam_access.so
account include system-auth
session required pam_loginuid.so
session include system-auth

--------------------------

Let me know...
  1. 13.02.2012 10:02:23
  2. # 3
Igor Seletskiy Accepted Answer
Posts: 1201
Joined: 09.02.2010
0
Votes
Undo
LVE is there. My best guess is that there are huge number of images, and it just stresses out IO.

Could you try to add something basic for them that runs every minute, and monitor it via lvetop? Just to make sure.

Also, any idea why they would use this:

system(\'for i in images/*; do mv $i public_html/search/images/; done\');

vs this:

system(\'mv images/* public_html/search/images/\');
  1. 13.02.2012 11:02:12
  2. # 4
Host Provider Accepted Answer
Posts: 48
Joined: 31.01.2012
0
Votes
Undo
OK, thanks Igor.

(And thanks for the script mod suggestion. I didn\'t even think of that. :)
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!
Guest
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below. Supports gif,jpg,png,zip,rar,pdf
• Insert • Remove Upload Files (Maximum File Size: 2 MB)
Captcha
To protect the site from bots and unauthorized scripts, we require that you enter the captcha codes below before posting your question.