Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old May 6th, 2008, 11:34 AM
lokisapocalypse lokisapocalypse is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 415 lokisapocalypse User rank is Sergeant Major (2000 - 5000 Reputation Level)lokisapocalypse User rank is Sergeant Major (2000 - 5000 Reputation Level)lokisapocalypse User rank is Sergeant Major (2000 - 5000 Reputation Level)lokisapocalypse User rank is Sergeant Major (2000 - 5000 Reputation Level)lokisapocalypse User rank is Sergeant Major (2000 - 5000 Reputation Level)lokisapocalypse User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 4 Days 11 h 41 m 45 sec
Reputation Power: 53
System commands not executing

Hello all,

I have inherited a Perl script that executes several system commands:

Code:
mkdir /tmp/n3Z7
chmod 777 /tmp/n3Z7

hmmsearch --cut_tc /AMP-binding.hmm /outfiles/OUT_afumigatus.input > /tmp/n3Z7/hmm_AMP.out
hmmsearch --cut_tc /Acyl_transf_1.hmm  /outfiles/OUT_afumigatus.input > /tmp/n3Z7/hmm_Acyl_transf.out
hmmsearch --cut_tc /Condensation.hmm /outfiles/OUT_afumigatus.input > /tmp/n3Z7/hmm_Condensation.out

rm -rf /tmp/n3Z7


For some reason, the hmmsearch functions are no longer being executed but the mkdir and chmod commands work correctly. Could it be that the daemon user (which is executing these commands) does not have sufficient privileges to execute the hmmsearch command?

Reply With Quote
  #2  
Old May 6th, 2008, 02:33 PM
awatson awatson is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2008
Posts: 19 awatson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 42 m 31 sec
Reputation Power: 0
Yes, it could be. Or something else wrong with hmmsearch - have you tried running the commands yourself or looking in the error logs?

Reply With Quote
  #3  
Old May 6th, 2008, 03:42 PM
lokisapocalypse lokisapocalypse is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 415 lokisapocalypse User rank is Sergeant Major (2000 - 5000 Reputation Level)lokisapocalypse User rank is Sergeant Major (2000 - 5000 Reputation Level)lokisapocalypse User rank is Sergeant Major (2000 - 5000 Reputation Level)lokisapocalypse User rank is Sergeant Major (2000 - 5000 Reputation Level)lokisapocalypse User rank is Sergeant Major (2000 - 5000 Reputation Level)lokisapocalypse User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 4 Days 11 h 41 m 45 sec
Reputation Power: 53
Quote:
Originally Posted by awatson
Yes, it could be. Or something else wrong with hmmsearch - have you tried running the commands yourself or looking in the error logs?


Sorry, I should have added that executing the commands through a command prompt works fine.

Reply With Quote
  #4  
Old May 6th, 2008, 04:14 PM
ishnid's Avatar
ishnid ishnid is offline
kill 9, $$;
Dev Shed God (5000 - 5499 posts)
 
Join Date: Sep 2001
Location: Dublin, Eire
Posts: 5,394 ishnid User rank is General 4th Grade (Above 100000 Reputation Level)ishnid User rank is General 4th Grade (Above 100000 Reputation Level)ishnid User rank is General 4th Grade (Above 100000 Reputation Level)ishnid User rank is General 4th Grade (Above 100000 Reputation Level)ishnid User rank is General 4th Grade (Above 100000 Reputation Level)ishnid User rank is General 4th Grade (Above 100000 Reputation Level)ishnid User rank is General 4th Grade (Above 100000 Reputation Level)ishnid User rank is General 4th Grade (Above 100000 Reputation Level)ishnid User rank is General 4th Grade (Above 100000 Reputation Level)ishnid User rank is General 4th Grade (Above 100000 Reputation Level)ishnid User rank is General 4th Grade (Above 100000 Reputation Level)ishnid User rank is General 4th Grade (Above 100000 Reputation Level)ishnid User rank is General 4th Grade (Above 100000 Reputation Level)ishnid User rank is General 4th Grade (Above 100000 Reputation Level)ishnid User rank is General 4th Grade (Above 100000 Reputation Level)ishnid User rank is General 4th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 5 Days 14 h 14 m 24 sec
Reputation Power: 1259
There's no Perl in what you've posted. What OS are you on - I can move this to Linux/Unix help as appropriate.

Reply With Quote
  #5  
Old May 6th, 2008, 04:16 PM
Axweildr's Avatar
Axweildr Axweildr is offline
CPAN medic ...
Click here for more information.
 
Join Date: Mar 2003
Location: Location: Location:
Posts: 10,905 Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)  Folding Points: 119844 Folding Title: Super Ultimate Folder - Level 1Folding Points: 119844 Folding Title: Super Ultimate Folder - Level 1Folding Points: 119844 Folding Title: Super Ultimate Folder - Level 1Folding Points: 119844 Folding Title: Super Ultimate Folder - Level 1Folding Points: 119844 Folding Title: Super Ultimate Folder - Level 1Folding Points: 119844 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 3 Weeks 6 Days 3 h 56 m 58 sec
Reputation Power: 2304
Send a message via Google Talk to Axweildr
Orkut
can you log in as the daemon user and see what happens when you run them on the command line?

Did the logs show up anything?
__________________
--Ax
without exception, there is no rule ...
The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones


09 F9 11 02
9D 74 E3 5B
D8 41 56 C5
63 56 88 C0
Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.
-- Jamie Zawinski

Reply With Quote
  #6  
Old May 6th, 2008, 04:17 PM
awatson awatson is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2008
Posts: 19 awatson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 42 m 31 sec
Reputation Power: 0
Well, his perl script is using "system()" to call those commands.

Seems like a permissions problem then - can you try changing owner or permissions on hmmsearch to see if that works?

Reply With Quote
  #7  
Old May 6th, 2008, 06:40 PM
Axweildr's Avatar
Axweildr Axweildr is offline
CPAN medic ...
Click here for more information.
 
Join Date: Mar 2003
Location: Location: Location:
Posts: 10,905 Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)  Folding Points: 119844 Folding Title: Super Ultimate Folder - Level 1Folding Points: 119844 Folding Title: Super Ultimate Folder - Level 1Folding Points: 119844 Folding Title: Super Ultimate Folder - Level 1Folding Points: 119844 Folding Title: Super Ultimate Folder - Level 1Folding Points: 119844 Folding Title: Super Ultimate Folder - Level 1Folding Points: 119844 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 3 Weeks 6 Days 3 h 56 m 58 sec
Reputation Power: 2304
Send a message via Google Talk to Axweildr
Orkut
it'd be best to find out what the actual issue is before changing permissions, hence asking him to logon as the daemon user to see what feedback the OS gives him on the issue, or if it's possible to pipe the STDOUT and STDERR for the cron job to a text file and see if that yields any further information ... or using backticks or the qx operator to run the shell commands

perl Code:
Original - perl Code
  1. open LOG, ">logfile.txt";
  2. @results1= qx|command1|;
  3. for (@results1) {
  4.   print LOG $_;
  5. }
  6. @results2= qx|command2|;
  7. for (@results1) {
  8.   print LOG $_;
  9. }
  10. close LOG;

Last edited by Axweildr : May 6th, 2008 at 06:42 PM.

Reply With Quote
  #8  
Old May 7th, 2008, 07:25 AM
lokisapocalypse lokisapocalypse is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 415 lokisapocalypse User rank is Sergeant Major (2000 - 5000 Reputation Level)lokisapocalypse User rank is Sergeant Major (2000 - 5000 Reputation Level)lokisapocalypse User rank is Sergeant Major (2000 - 5000 Reputation Level)lokisapocalypse User rank is Sergeant Major (2000 - 5000 Reputation Level)lokisapocalypse User rank is Sergeant Major (2000 - 5000 Reputation Level)lokisapocalypse User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 4 Days 11 h 41 m 45 sec
Reputation Power: 53
I have confirmed that it is a permissions issue. Thanks for all your input.

Reply With Quote
  #9  
Old May 7th, 2008, 02:01 PM
Axweildr's Avatar
Axweildr Axweildr is offline
CPAN medic ...
Click here for more information.
 
Join Date: Mar 2003
Location: Location: Location:
Posts: 10,905 Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)  Folding Points: 119844 Folding Title: Super Ultimate Folder - Level 1Folding Points: 119844 Folding Title: Super Ultimate Folder - Level 1Folding Points: 119844 Folding Title: Super Ultimate Folder - Level 1Folding Points: 119844 Folding Title: Super Ultimate Folder - Level 1Folding Points: 119844 Folding Title: Super Ultimate Folder - Level 1Folding Points: 119844 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 3 Weeks 6 Days 3 h 56 m 58 sec
Reputation Power: 2304
Send a message via Google Talk to Axweildr
Orkut
can you be more specific, had the user profile changed, or did somebody 'do nothing', the old "It weren't me..." defense ...

Reply With Quote
  #10  
Old May 7th, 2008, 02:04 PM
lokisapocalypse lokisapocalypse is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 415 lokisapocalypse User rank is Sergeant Major (2000 - 5000 Reputation Level)lokisapocalypse User rank is Sergeant Major (2000 - 5000 Reputation Level)lokisapocalypse User rank is Sergeant Major (2000 - 5000 Reputation Level)lokisapocalypse User rank is Sergeant Major (2000 - 5000 Reputation Level)lokisapocalypse User rank is Sergeant Major (2000 - 5000 Reputation Level)lokisapocalypse User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 4 Days 11 h 41 m 45 sec
Reputation Power: 53
I executed the commands in PHP which gave a return code of 127 which I assumed meant insufficient permissions. However, upon further investigation the problem was that the web browser did not know the correct path to the hmmsearch function. Thus, changing hmmsearch to /usr/local/bin/hmmsearch resolved this issue.

In other words, it had absolutely nothing to do with Perl :-)

Reply With Quote
  #11  
Old May 7th, 2008, 02:07 PM
Axweildr's Avatar
Axweildr Axweildr is offline
CPAN medic ...
Click here for more information.
 
Join Date: Mar 2003
Location: Location: Location:
Posts: 10,905 Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)Axweildr User rank is General 20th Grade (Above 100000 Reputation Level)  Folding Points: 119844 Folding Title: Super Ultimate Folder - Level 1Folding Points: 119844 Folding Title: Super Ultimate Folder - Level 1Folding Points: 119844 Folding Title: Super Ultimate Folder - Level 1Folding Points: 119844 Folding Title: Super Ultimate Folder - Level 1Folding Points: 119844 Folding Title: Super Ultimate Folder - Level 1Folding Points: 119844 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 3 Weeks 6 Days 3 h 56 m 58 sec
Reputation Power: 2304
Send a message via Google Talk to Axweildr
Orkut
the browser?? I think you meant the server, there was probably a chdir or cd command above the hmmsearch calls that was obliterated, or the search path used to contain the path to the directory that contains hmmsearch.

Whether is the shell or perl, it still needs to know where stuff is to execute it

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > System commands not executing


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off