MOON
Server: Apache/2.2.31 (Unix) mod_ssl/2.2.31 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4
System: Linux csr818.wilogic.com 2.6.18-419.el5xen #1 SMP Fri Feb 24 22:50:37 UTC 2017 x86_64
User: digitals (531)
PHP: 5.4.45
Disabled: NONE
Upload Files
File: //proc/self/root/proc/self/root/scripts.20110531.215904.25158/futexfix
#!/usr/bin/perl
# cpanel - futexfix                               Copyright(c) 2010 cPanel, Inc.
#                                                           All rights Reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cpanel license. Unauthorized copying is prohibited

BEGIN { unshift @INC, '/usr/local/cpanel'; }

use Cpanel::ProcessCheck qw( );
use Cpanel::HttpRequest;

my $httpClient = Cpanel::HttpRequest->new('hideOutput' => 0);

$SIG{ALRM} = \&death;

alarm(600);

Cpanel::ProcessCheck::killdeadlock('process'    => 'whostmgr2',
                                     'processarg' => 'dochangeip',
                                     'timeout'    => 50);
Cpanel::ProcessCheck::killdeadlock('process'    => 'safeapacherestart',
                                     'timeout'    => 25);

if (@ARGV && $ARGV[0] =~ /setup/i){
   mkdir("/var/cpanel",0755);
   fetchfile("http://httpupdate.cpanel.net/installd/futex-test","/var/cpanel/futex-test");
   chmod(0755,"/var/cpanel/futex-test");
}


if (-x "/var/cpanel/futex-test" && -d "/etc/profile.d") {
   my $futex = `/var/cpanel/futex-test`;
   chomp($futex);
   if ($futex =~ /broken/i) {
      open(FF,">>/var/cpanel/brokenfutex");
      close(FF);
      open(PFD,">/etc/profile.d/futexfix.sh");
      chmod(0755,"/etc/profile.d/futexfix.sh");
      print PFD "export LD_ASSUME_KERNEL=2.4.1";
      close(PFD);
      open(PFD,">/etc/profile.d/futexfix.csh");
      chmod(0755,"/etc/profile.d/futexfix.csh");
      print PFD "setenv LD_ASSUME_KERNEL 2.4.1";
      close(PFD);
   } else {
      unlink("/etc/profile.d/futexfix.csh");
      unlink("/etc/profile.d/futexfix.sh");
      unlink("/var/cpanel/brokenfutex");
   }
}


sub fetchfile {
   my($url,$file) = @_;
   if (! -e $file || (stat(_))[7] <= 0) {
      $httpClient->download($url,$file);
   }
   return $file;
}

sub death {
   exit;
}