LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-01-2012, 03:18 PM   #1
kviliev
LQ Newbie
 
Registered: Nov 2011
Posts: 5

Rep: Reputation: Disabled
How to run properly perl script on RHEL with non root user


Hi All,

I am trying to run a perl script on RHEL 5.6 as different user than root. If I run the script as root the script get executed successfully. But with su - user -c perlscript.pl I am not able to run it properly. What should be the settings for that user to be able to run the script without any errors. For example I am getting:

ERROR with mkdir newdir
256 at perlscript.pl

Also I was getting:

"Can't locate mw.pm in @INC" if I try to use some file .pm

Thank you!
 
Old 02-01-2012, 07:16 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,358

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Well, first I'd collect all the erros ina logfile, then address them one by one.
eg
Code:
su - user -c "/dir/perlscript.pl >/dir/perlscript.log 2>&1"
You need to improve error handling in your script for error 1 (mkdir).
error 2 looks like user has wrong perl setting in their env.
Can you post your script?
 
  


Reply



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

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to run a shell script as root (when user is not root) taylorkh Linux - Newbie 10 09-12-2008 06:05 PM
How can I have a script owned as root and run as root by a user: setuid? stickey bit? abefroman Linux - Newbie 9 04-19-2008 05:15 PM
How to run script of another user from root? sikandar Linux - Software 4 09-05-2007 03:42 AM
How do I run a startup script as a user other than root? Questor21 Linux - Software 4 04-08-2006 11:51 AM
how do I make sure that the user that is going to run the script is a root user??? nikold01 Linux - General 3 09-10-2004 07:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration