Running Perl Script On Cron

Jan 25, 2007

I tried using this perl script which supposedly restarts apache when server load reaches 5 and above

Code:
#!/usr/bin/perl -w
#use strict;
$|++;
open(LOAD,"/proc/loadavg") || die "couldn't open /proc/loadavg: $!
";
my @load=split(/ /,<LOAD>);
close(LOAD);
if ($load[0] > 5) {
`/sbin/service httpd restart`;
}
and placed it in /usr/local/script/loadavg.pl and chmod to 755

and added this to my crontab

*/1 * * * * root /usr/local/script/loadavg.pl

my server load went up to 20 and waited if it will automatically go down via the script but it seems it's not working. I had to restart apache manually.

View 4 Replies


ADVERTISEMENT

Installed Imagemagick Perl Module But Its Not Running

Apr 15, 2008

I have installed image::magick perl module but its not running error is :--

Can't load '/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Image/Magick/Magick.so' for module Image::Magick: libMagickCore.so.1: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/DynaLoader.pm line 230.
at flickr.pl line 55
Compilation failed in require at flickr.pl line 55.
BEGIN failed--compilation aborted at flickr.pl line 55.

View 4 Replies View Related

Perl Install Constantly Fails With Out Of Memory, But Nothing's Running

Aug 12, 2008

an inexpensive VPS host and based on reviews on this forum, went with Web Wide Hosting.

I had a smooth signup and thanks to Jon at WWH, managed to get a payment snafu with Paypal resolved smoothly.

However, I've been struggling a lot with getting most recommended steps to actually work in my VPS and I'm getting increasingly frustrated.

The latest problem I have is that trying to install Perl modules fails with a "cannot allocate memory" error. First google hits suggest increasing memory, which really isn't an option for me right now. More puzzling is the fact that both HyperVM and user_beancounters suggest I have enough headroom atleast to install perl modules!

Output from session:

cpan> install Authen::PAM
CPAN: Storable loaded ok
Going to read /root/.cpan/sources/authors/01mailrc.txt.gz
Going to read /root/.cpan/sources/modules/02packages.details.txt.gz
Database was generated on Mon, 11 Aug 2008 07:02:52 GMT
HTTP::Date not available

There's a new CPAN.pm version (v1.9205) available!
[Current version is v1.7602]
You might want to try
install Bundle::CPAN
reload cpan
without quitting the current session. It should be a seamless upgrade
while we are running...

Going to read /root/.cpan/sources/modules/03modlist.data.gz
Could not pipe[/bin/gzip --decompress --stdout /root/.cpan/sources/modules/03modlist.data.gz |]: Cannot allocate memory at /usr/lib/perl5/5.8.8/CPAN.pm line 5726.

# cat /proc/user_beancounters
Version: 2.5
uid resource held maxheld barrier limit failcnt
6050: kmemsize 2383965 4269136 2147483646 2147483646 0
lockedpages 0 0 99 99 0
privvmpages 6418 26175 25600 25600 38
shmpages 685 1981 25600 25600 0
dummy 0 0 0 0 0
numproc 22 38 99 99 0
physpages 3147 22279 0 2147483647 0
vmguarpages 0 0 25600 2147483647 0
oomguarpages 3147 22279 25600 2147483647 0
numtcpsock 5 42 792 792 0
numflock 3 9 99 99 0
numpty 1 3 50 50 0
numsiginfo 0 3 99 99 0
tcpsndbuf 55900 411424 20971520 24215552 0
tcprcvbuf 81920 4136784 20971520 24215552 0
othersockbuf 2236 11744 20971520 24215552 0
dgramrcvbuf 0 8380 20971520 24215552 0
numothersock 9 20 792 792 0
dcachesize 113634 194947 912384 912384 0
numfile 495 856 2376 2376 0
dummy 0 0 0 0 0
dummy 0 0 0 0 0
dummy 0 0 0 0 0
numiptent 14 14 99 99 0

Not even getting started on the problems I'm having trying to mount /tmp as a noexec,nosuid partition

View 13 Replies View Related

Trojan Activity - Running Perl With High CPU Usage, With User Apache

Sep 5, 2007

Running programs named Perl with Heavy CPU usage, with the ownership of user apache.

We found the problem on Fedora 3 and Fedora 6.

In our case, it was the result of a Trojan activity.

Quick Solution

Check the cron jobs of user apache
crontab -u apache -e
*/1 * * * * perl /tmp/.tmp/tmpfile
delete the cronjob entry.
Also delete the file /tmp/.tmp/tmpfile
also added "apache" to the file /etc/cron.deny

That's all

Problem and solution in detail....

View 1 Replies View Related

Cron Jobs Not Running

Jan 5, 2008

I have a machine, that for some reason stopped running it's cron jobs for some reason, and I can figure out how to get them working again.

My /etc/crontab file is as follows.

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
Here are the contents of a sample user cron file.

MAILTO="USER"
10 4 * * * php -q -f /home/USER/public_html/tools/updtransfers.php /home/USER/public_html >/dev/null 2>&1
10 5 * * * php -q -f /home/USER/public_html/tools/updateexp.php /home/USER/public_html >/dev/null 2>&1
10 5 * * * php -q -f /home/USER/public_html/tools/invoice_cron.php /home/USER/public_html >/dev/null 2>&1
and another

*/5 * * * * /usr/local/bin/php -c /home/USER/php.ini /home/USER/public_html/poller.php > /dev/null 2>&1
I've checked my logs, and I can find no errors anywhere. When I run the commands manually via SSH, they work perfectly, they simply are not being run automatically the way they are supposed to be.

I have checked, and the crond service is running. I have tried restarting it, but it seams to have no affect. I really have no idea what the issue is. The only thing I seam to have found at one point, was the possibility that the files within the /etc/cron.d directory might be CHMOD'ed wrong, but I haven't found anything to confirm this either way.

[root@server cron.d]# ls -all
total 60
drwxr-xr-x 2 root root 4096 Dec 17 03:07 .
drwx--x--x 94 root root 12288 Jan 3 09:28 ..
-rw-r--r-- 1 root root 61 Jun 22 2007 csf_update
-rw-r--r-- 1 root root 81 Apr 11 2007 lsm
-rw-r--r-- 1 root root 79 Jun 22 2007 prm
-rw------- 1 root root 366 Feb 23 2007 sa-update
-rw-r--r-- 1 root root 82 Jun 22 2007 spri
-rw-r--r-- 1 root root 188 Nov 16 23:14 sysstat
[root@server cron.d]#

View 3 Replies View Related

Plesk 12.x / Linux :: Cron Not Running

Dec 30, 2014

I have just recently moved to Plesk web admin from cpanel. I have been trying to get the cron to run for the past 48 hours but no luck. Bellow is the code i have been trying to execute via cron but It does not run.

"/usr/bin/php /var/www/ vhosts/mydomain. com /httpdocs/billing/index.php cron"

View 8 Replies View Related

Howto: Automatically Verify Cron / Crond Is Running And Restart If Not

May 30, 2005

This one's pretty simple really, but given the fact that I'm constantly running into crond stops with CPanel servers (no clue why, or where, but it's happening), I'll post this here. If it helps someone, then great, if not, hey, no worries.

Firstly, login as root to your server through ssh, however you usually do .

Next, the script (we'll call it /bin/croncheck.sh). Use whatever editor you choose to create the file.

#!/bin/bash .......

View 14 Replies View Related

/usr/bin/perl -w Hnc.cgi

Dec 5, 2008

When i was running top -cd2 command following scripts are taking high cup uses on server. But when we are go home directory we didn't find any thing.

24489 "User Name" 20 0 6732 5084 1164 S 8.0 0.2 11:00.69 /usr/bin/perl -w hnc.cgi
26456 "User Name" 20 0 6876 5080 1164 S 8.0 0.2 7:23.47 /usr/bin/perl -w hnc.cgi
32569 "User Name" 20 0 6748 5056 1164 S 7.5 0.2 8:57.30 /usr/bin/perl -w hnc.cgi

update us why this script are running under some particular users and what the application of this script.

View 11 Replies View Related

Perl

May 16, 2007

I have a website is written by Perl language. I donnt know how to run it.

I installed Activeperl 5.0 and IIS is running. I have heared someone who told me that need to install a software as Emperl/ html-emperl, is it right?

View 1 Replies View Related

How To Install Perl

Jul 7, 2009

How do you install perl on a centos 5?

View 3 Replies View Related

Perl Symlink

Aug 15, 2008

i have big problem all Forums in my server hacked by perl symlink see all config.php by shell perl in .txt by include

i solve it by make perl permission 000 but all thing in cpanel stop cause cpanel by perl

View 6 Replies View Related

Perl Removed

Feb 2, 2008

A client's server's password was guessed, and the hacker conveniently uninstalled perl. I can't seem to get perl reinstalled. Any ideas on how this would be done? RPM, TAR's and YUM don't work, as they require perl!

Is this going to be a reinstall job?

View 14 Replies View Related

How To Secure Perl

Mar 28, 2008

all we know that perl language its using in alot of scripts and alot of system admins stop it why this why u dont try stopp the problems from it and make ur client have perl to used it in scripts lets try this if some one need to see passwd he will do cat /etc/passwd what about make this chmod 700 /bin/cat and he will used wget to get files what about this chmod 700 /usr/bin/wget and lynx what about chmod 700 /usr/bin/lynx in this case we make root only can using this commands any system admin sure know now the idea and he can use it as he want ,, this secured method not only in perl its in another programing language put i give this as a clear exampel.

View 5 Replies View Related

Old Version Of Perl

Mar 12, 2008

I have a Centos VPS with Cpanel. I have begun receiving some email notifications, apparantly from my cpanel... The latest one says that the version of perl I am running is too old.

Subj: [checkperlmodules] perl version too old (v5.8.8 required, v5.8.7 is installed.)

Are there any problems or dire consequences from upgrading or side effects? What version should I upgrade to?

View 3 Replies View Related

Perl Error

Jul 29, 2007

I've been trying to figure this out for about the past week and haven't had any success.

Can't locate funcs.pl in @INC (@INC contains: lib/perl . /usr/lib/perl5/5.8.8/i686-linux /usr/lib/perl5/5.8.8 /usr/lib/perl5/site_perl/5.8.8/i686-linux /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl) at ./terr.pl line 28.

I'm trying to run perl magick.

View 2 Replies View Related

Perl Security

Jan 27, 2007

ive been trying to install it for about 3 hours and ive finally got it working. now, how do i configure it to be nice and secure?

first thing is that i want to restrict which paths people can use in scripts. my site needs to access any paths but site users can only access their own directories. i want the exact same thing as in this thread but with perl instead of php

how do i block certain functions and which ones do i block? i heard perl and php are very similar so im guessing i want to block similar functions to the ones listed here

View 3 Replies View Related

Perl Attack

Jul 20, 2007

Tasks: 150 total, 7 running, 143 sleeping, 0 stopped, 0 zombie
Cpu(s): 76.9% us, 23.1% sy, 0.0% ni, 0.0% id, 0.0% wa, 0.0% hi, 0.0% si
Mem: 1026224k total, 604068k used, 422156k free, 61396k buffers
Swap: 1052248k total, 140736k used, 911512k free, 233200k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
12825 apache 25 0 6752 2040 936 R 33 0.2 1556:57 perl
15338 apache 25 0 7592 4068 1324 R 33 0.4 545:03.58 perl
5817 apache 25 0 6996 4052 1240 R 33 0.4 520:37.18 perl
27139 apache 25 0 6404 4068 1248 R 33 0.4 197:40.96 perl
29176 apache 25 0 7964 4092 1272 R 33 0.4 523:40.92 perl
14785 apache 25 0 7392 4088 1272 R 31 0.4 1158:41 perl
27420 root 16 0 3248 1000 760 R 1 0.1 0:00.04 top
27441 qmaild 16 0 4736 752 604 S 0 0.1 0:00.01 qmail-smtpd
1 root 16 0 1956 96 64 S 0 0.0 0:06.83 init
2 root RT 0 0 0 0 S 0 0.0 0:04.04 migration/0
3 root 34 19 0 0 0 S 0 0.0 0:00.56 ksoftirqd/0
4 root RT 0 0 0 0 S 0 0.0 0:02.36 migration/1
5 root 34 19 0 0 0 S 0 0.0 0:00.47 ksoftirqd/1
6 root 5 -10 0 0 0 S 0 0.0 0:00.12 events/0
7 root 5 -10 0 0 0 S 0 0.0 0:00.05 events/1
8 root 9 -10 0 0 0 S 0 0.0 0:00.00 khelper
9 root 15 -10 0 0 0 S 0 0.0 0:00.00 kacpid
24 root 5 -10 0 0 0 S 0 0.0 0:00.00 kblockd/0
25 root 5 -10 0 0 0 S 0 0.0 0:00.00 kblockd/1
44 root 15 0 0 0 0 S 0 0.0 0:24.16 pdflush
26 root 15 0 0 0 0 S 0 0.0 0:00.00 khubd
46 root 13 -10 0 0 0 S 0 0.0 0:00.00 aio/0
47 root 13 -10 0 0 0 S 0 0.0 0:00.00 aio/1
45 root 15 0 0 0 0 S 0 0.0 2:45.50 kswapd0
193 root 25 0 0 0 0 S 0 0.0 0:00.00 kseriod
308 root 15 0 0 0 0 S 0 0.0 4:29.19 kjournald
1393 root 6 -10 1968 4 0 S 0 0.0 0:00.02 udevd
1912 root 6 -10 0 0 0 S 0 0.0 0:00.00 kauditd
1976 root 7 -10 0 0 0 S 0 0.0 0:00.00 kmirrord
1995 root 22 0 0 0 0 S 0 0.0 0:00.00 kjournald
1996 root 15 0 0 0 0 S 0 0.0 0:01.55 kjournald
1997 root 20 0 0 0 0 S 0 0.0 0:00.00 kjournald
2769 root 15 0 2908 244 176 S 0 0.0 2:48.00 syslogd
2773 root 16 0 3348 196 140 S 0 0.0 0:00.00 klogd
2783 root 16 0 3092 272 208 S 0 0.0 0:08.25 irqbalance
2798 named 16 0 50760 4492 1408 S 0 0.4 2:59.58 named
2852 root 15 0 2664 260 104 S 0 0.0 0:00.13 smartd
2861 root 16 0 5220 380 264 S 0 0.0 0:15.04 sshd
[root@cl-t058-280cl tmp]#

I am suffering with perl scripts attack. Please help me to resolve this issue.

View 11 Replies View Related

Perl Process

Feb 14, 2007

How do I trace what user this is?

Code:
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND 9488 nobody 25 0 1612 1280 1108 S 21.1 0.2 619:37 1 perl bodyb3 200.101.193.42 0 5000
I also ran netstat -n and found this:
Code:
udp 15184 0 server.host.com:55936 ns1.datacenter.net:domain ESTABLISHED

View 3 Replies View Related

How Can Change Perl 5.8.8 To 5.8.7

Aug 15, 2007

How can change perl 5.8.8 to 5.8.7

Now I cant Install any Perl Module use CP.

all show me this :

Testing connection speed...(this could take a while)...Done
Ping:2.016 Testing connection speed to cpan.erlbaum.net using pureperl...(157450.00 bytes/s)...Done
Ping:2.316 Testing connection speed to cpan.belfry.net using pureperl...(157450.00 bytes/s)...Done
Ping:1.911 Testing connection speed to cpan.glines.org using pureperl...(104300.00 bytes/s)...Done
Three usable mirrors located
Mirror Check passed for cpan.erlbaum.net (/index.html)
Unknown config variable 'less'
commit: wrote '/usr/lib/perl5/5.8.8/CPAN/Config.pm'
CPAN: File::HomeDir loaded ok (v0.65)
CPAN: Storable loaded ok (v2.16)
Going to read /home/.cpan/Metadata
Database was generated on Wed, 15 Aug 2007 01:38:08 GMT
Acme:pork is up to date (0.0.7).
perlmod--Install done

View 10 Replies View Related

How Do You Secure The Tmp From Perl

Nov 11, 2007

i,m facing perl script on my server and i can,t find a way to protect it from perl

really i need the best way

i choose this forum because most of you here are expert in this filed . ... ..

View 1 Replies View Related

Perl Install

Dec 7, 2007

Want to apply this to a forum
[url]

I think I installed html2ps correctly, but I do not know how to get ps2pdf installed on Centos 4.5

I have cpanel as well

View 0 Replies View Related

Perl Process

Oct 24, 2007

We are using FreeBsd with Cpanel.

Some one has upload some scripts,they are running and attacking
to other systems.

last pid: 64017; load averages: 59.59, 60.75, 63.04 up 19+22:52:28 12:03:45
457 processes: 61 running, 315 sleeping, 81 zombie
CPU states: 52.4% user, 0.0% nice, 47.6% system, 0.0% interrupt, 0.0% idle
Mem: 465M Active, 212M Inact, 236M Wired, 22M Cache, 111M Buf, 62M Free
Swap: 2048M Total, 458M Used, 1590M Free, 22% Inuse

PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND
3282 root 128 0 37536K 30520K RUN 3:49 4.79% 4.79% perl
62953 root 128 0 30284K 25248K RUN 0:05 1.90% 1.90% perl
49249 root 128 0 33720K 28876K RUN 0:46 1.86% 1.86% perl
2981 root 128 0 40928K 30724K RUN 3:56 1.56% 1.56% perl
76809 nobody 127 0 4148K 2080K RUN 13:52 1.42% 1.42% perl5.8.8
19633 nobody 127 0 4148K 2128K RUN 2:34 1.42% 1.42% perl5.8.8
57451 nobody 126 0 4148K 2072K RUN 39:24 1.22% 1.22% perl5.8.8
76599 nobody 126 0 4148K 2080K RUN 13:53 1.22% 1.22% perl5.8.8
76966 nobody 126 0 4148K 2080K RUN 14:01 1.17% 1.17% perl5.8.8
60286 nobody 126 0 4148K 2072K RUN 38:42 1.12% 1.12% perl5.8.8
77488 nobody 126 0 4148K 2080K RUN 13:48 1.12% 1.12% perl5.8.8
77697 nobody 126 0 4148K 2080K RUN 13:47 1.12% 1.12% perl5.8.8
56573 nobody 126 0 4148K 2096K RUN 39:55 1.07% 1.07% perl5.8.8
58126 nobody 126 0 4148K 2072K RUN 39:11 1.07% 1.07% perl5.8.8
76513 nobody 126 0 4148K 2080K RUN 13:58 1.07% 1.07% perl5.8.8
76807 nobody 126 0 4148K 2080K RUN 13:57 1.07% 1.07% perl5.

View 6 Replies View Related

Allow Perl To Run Inside .htaccess

Aug 17, 2007

What would I have to add inside .htaccess to allow perl scripts to run?

View 1 Replies View Related

Rouge Perl Script

Apr 20, 2009

I've got a rouge perl script running on one of my servers and need help in tracking it down.

TOP

1877 apache 25 0 4856 3060 1252 R 49.9 0.3 13:51.98 perl

as soon as ps is killed it restarts

/tmp

-rw-r--r-- 1 apache apache 29572 Apr 15 01:11 blue
-rw-r--r-- 1 apache apache 29572 Apr 15 01:11 blue.1
-rw-r--r-- 1 apache apache 29572 Apr 15 01:11 blue.10
-rw-r--r-- 1 apache apache 29572 Apr 15 01:11 blue.11
-rw-r--r-- 1 apache apache 29572 Apr 15 01:11 blue.12
-rw-r--r-- 1 apache apache 29572 Apr 15 01:11 blue.13
-rw-r--r-- 1 apache apache 29572 Apr 15 01:11 blue.14
-rw-r--r-- 1 apache apache 29572 Apr 15 01:11 blue.15
-rw-r--r-- 1 apache apache 29572 Apr 15 01:11 blue.16
-rw-r--r-- 1 apache apache 29572 Apr 15 01:11 blue.17
-rw-r--r-- 1 apache apache 29572 Apr 15 01:11 blue.18
-rw-r--r-- 1 apache apache 29572 Apr 15 01:11 blue.2
-rw-r--r-- 1 apache apache 48444 Apr 15 01:11 blue.3
-rw-r--r-- 1 apache apache 29572 Apr 15 01:11 blue.4
-rw-r--r-- 1 apache apache 29572 Apr 15 01:11 blue.5
-rw-r--r-- 1 apache apache 29572 Apr 15 01:11 blue.6
-rw-r--r-- 1 apache apache 29572 Apr 15 01:11 blue.7
-rw-r--r-- 1 apache apache 29572 Apr 15 01:11 blue.8
-rw-r--r-- 1 apache apache 29572 Apr 15 01:11 blue.9

and over the past couple of days there's been a number of these

-rw------- 1 apache apache 99 Apr 20 02:22 sess_00f39873b47be556f0c047e96b726640
-rw------- 1 apache apache 68 Apr 20 08:20 sess_01d2ba3e471475384ea3c1d2ff1cde7f
-rw------- 1 apache apache 0 Apr 20 06:04 sess_01ea1b9ebe41331239ded82506f66090
-rw------- 1 apache apache 0 Apr 19 23:04 sess_0a83f93845da3fabce31d897f13735b0
-rw------- 1 apache apache 68 Apr 20 01:50 sess_0c83beb8ba2ce1f42833874b0d8a7470
-rw------- 1 apache apache 68 Apr 20 08:25 sess_0d5989b161d7d6434692de42faa248ab
-rw------- 1 apache apache 0 Apr 19 18:15 sess_10f858c3904a12a1e4c9e7da70e0fbb8
-rw------- 1 apache apache 26 Apr 20 09:39 sess_11a8b8d85883c8f2da146bb8f97bd25e
-rw------- 1 apache apache 68 Apr 19 14:22 sess_11f018952ec1cae08e6d8a95a0c99287
-rw------- 1 apache apache 26 Apr 19 21:18 sess_1706bf1b9e5d4b09e29cfbc3517d6755
-rw------- 1 apache apache 26 Apr 20 02:22 sess_1c48c7232dbc7087c312d43debb942a7
-rw------- 1 apache apache 0 Apr 20 06:46 sess_1cdf7ecf082c27f389b759adef50f932
-rw------- 1 apache apache 0 Apr 20 08:04 sess_1d6d06ea737c1eff71152a590cd420a4
-rw------- 1 apache apache 26 Apr 20 09:42 sess_26b16f5a5b59639af28f6bc49dba1ed5ly

View 7 Replies View Related

Perl System Mail

Jan 14, 2009

I am trying to write a perl script, it send's mail to a user i used system(mail -s test) and also send some messages using this.

but my issue is i receive mail with html code like <br> and so..

how to get a plain mail using this system command.

View 2 Replies View Related

Show All Perl Process

Jun 3, 2009

How can see just perl or exim runing process with ssh on linux?

View 2 Replies View Related

Perl File 500 Error

May 25, 2009

I'm getting a internal 500 on a test perl file that I placed inside cgi-bin

This is a cpanel box with suphp enabled ....

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved