Are "system()" php functions created by script included in LVE?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • suhaskhare
    Member
    Forum ExplorerTechnical Associate
    • Mar 2021
    • 70

    #1

    Are "system()" php functions created by script included in LVE?

    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 Im not sure if Cloud Linux is "catching" it or not in the users 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 users ID) which runs for 2 hours.

    Will this sh command be included in the users 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.
  • iseletsk
    Senior Member
    • Dec 2017
    • 1199

    #2
    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

    Comment

    • henri
      Member
      • Oct 2020
      • 62

      #3
      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

      root@amy [~]# rpm -qa|grep vixie-cron
      vixie-cron-4.1-77.7.el5.cloudlinux

      -----
      root@amy [~]# rpm -qa|grep vixie-cron
      vixie-cron-4.1-77.7.el5.cloudlinux
      root@amy [~]# 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

      -----
      root@amy [~]# 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...

      Comment

      • iseletsk
        Senior Member
        • Dec 2017
        • 1199

        #4
        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/);

        Comment

        • henri
          Member
          • Oct 2020
          • 62

          #5
          OK, thanks Igor.

          (And thanks for the script mod suggestion. I didn even think of that.

          Comment

          Working...