LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 05-02-2004, 01:59 AM   #1
gottin
Member
 
Registered: May 2004
Location: Sofia / Bulgaria
Distribution: Fedora Core 5
Posts: 38

Rep: Reputation: 15
Question running tc throught a web interface


hi U all

I'm developing a web interface for the tc program now. However a little problem occured . Throught the perl script I'm using I can't run the TC program . It just don't wants to execute. When I substitute tc with another program - ls , cat (for example) and everithing goes just as expected.

In the perl script I tried to do it by "system(/sbin/tc), `/sbin/tc` , open TC, "/sbin/tc | "
I tried to setuid (root) for the script.
I tried to solve my problem by sudo.

No results.

Do you have some ideas for solving this problem?
 
Old 05-02-2004, 02:26 PM   #2
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
It's possible that yuor /sbin directory might be the problem. For example, Perl will refuse to execute anything from a "noexec" directory.

Please try this:
1. See if you can execute a Perl "hello world" located in /sbin
2. Verify you can execute that same "hello world" from the command line or from a web browser.

Hope that helps .. PSM
 
Old 05-02-2004, 06:10 PM   #3
gottin
Member
 
Registered: May 2004
Location: Sofia / Bulgaria
Distribution: Fedora Core 5
Posts: 38

Original Poster
Rep: Reputation: 15
Unhappy

yes, I do can execute a Perl "Hello World" in /sbin
also I cat execute the Perl "Hello World" (/sbin/hw.pl) from a browser, but still can't execute /sbin/tc .

It looks that there's other problem , which's been unsovable for me for the last few days.

10 for trying to help me paulsm4.

I still accept help
 
Old 05-02-2004, 07:32 PM   #4
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
One other suggestion: instead of saying "system (myprog)" (or the equivalent), perhaps you might instead try some variation of "system ('su - c mycommand')"?
 
Old 05-03-2004, 04:46 PM   #5
gottin
Member
 
Registered: May 2004
Location: Sofia / Bulgaria
Distribution: Fedora Core 5
Posts: 38

Original Poster
Rep: Reputation: 15
paulsm4 10x for trying to help me again and for your suggestion.
btw, I found the answers for this problem )) yeaaaah.
It was first that 'tc' program was returning into STDERR ( 2> ) and that's why I coulnd correct implement my algoritham and see the output from 'tc'.
After that it was that it didn't had permissions for setting changes when run 'tc' by apache user.

if s.b. is interested the solution of the problem is:
1) add into /etc/sudoers:
apache <name_of_local_machine>=NOPASSWD: /sbin/tc
2) into the perl script use something like this:
$error = `sudo /sbin/tc <arguments> 2>&1`
print $error if $error;

hope I've helped
 
Old 05-03-2004, 07:39 PM   #6
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Congratulations - I'm glad you got it! And thank you for following up and sharing your results!

Sincerely .. PSM
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
web interface for iptables d0d0 Slackware 1 10-25-2005 04:46 PM
Need an interface for web development aroop Linux - Software 1 08-11-2005 07:46 AM
Web-interface for burning CD olleBolle Linux - Newbie 2 04-03-2005 04:23 PM
Web interface for FTP!? kith Linux - General 2 09-19-2003 10:30 PM
Fetchmail Web Interface RKris Linux - Software 1 03-11-2003 05:23 AM


All times are GMT -5. The time now is 07:51 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration