Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 19th November 2006, 02:43 AM
fw12 Offline
Registered User
 
Join Date: Jun 2006
Posts: 23
How to execute a command remotely

When I execute this command on my machine:
/usr/bin/tvtime

It fires up the TV program (TVTIME).

I want to be able to do the same thing remotely via ssh. But when I do, I get this error:

Running tvtime 1.0.1.
Reading configuration from /etc/tvtime/tvtime.xml
Reading configuration from /root/.tvtime/tvtime.xml
xcommon: No DISPLAY set, so no output possible!

[1]+ Exit 1 /usr/bin/tvtime

Any suggestions on how to run tvtime remotely?
I don't have to have any output on my ssh client, I just want the program to run on the remote machine.

Thx.
Reply With Quote
  #2  
Old 19th November 2006, 02:50 AM
nick.stumpos's Avatar
nick.stumpos Offline
Registered User
 
Join Date: Feb 2005
Location: Lansing, Mi
Age: 28
Posts: 2,222
if you can turn off the X output in tvtime then that would work( I dont use the prog though so i dont know, if you are on a maching with a x server use the -X flag in ssh, if it is from a windows client I know there are progs for it, but i never used them google should tell you what the are.
__________________
As always
Love, Life, Loyalty, Wisdom, Knowledge, And Understanding
FC6: Common Questions answered
Reply With Quote
  #3  
Old 19th November 2006, 04:32 AM
fw12 Offline
Registered User
 
Join Date: Jun 2006
Posts: 23
Thanks for your input. I've searched online, and I've looked in the config file, tvtime.xml. Nothing points to how to turn off X output in tvtime.

I came across some discussion about setting display=:n. E.g.

/usr/bin/tvtime display=:0

I don't know what that means, but it did not work anyway.
Reply With Quote
  #4  
Old 19th November 2006, 04:38 AM
nick.stumpos's Avatar
nick.stumpos Offline
Registered User
 
Join Date: Feb 2005
Location: Lansing, Mi
Age: 28
Posts: 2,222
that just sets the display, what are you using to ssh in is it ssh on another linux box or a windows one
__________________
As always
Love, Life, Loyalty, Wisdom, Knowledge, And Understanding
FC6: Common Questions answered
Reply With Quote
  #5  
Old 19th November 2006, 08:46 AM
fw12 Offline
Registered User
 
Join Date: Jun 2006
Posts: 23
putty on win xp

I am trying to use PHP to change the parameters of my tvcard. That way I can just go to a webpage from any remote location and send a command to my machine from there.

I've tried PHP's exec(), system() to no avail. An example is:

exec("/usr/bin/mplayer [options]");

Since my web server is running under apache user, I've given permission in sudoers file for apache to run /usr/bin/mplayer. Hence, the final command is:

$command = "sudo /usr/bin/mplayer [options]";
exec("$command");
exec("echo '$command' > /tvoutput");

I know exec() works because exec("echo '$command' > /tvoutput"); worked.
I can issue /usr/bin/mplayer [options] from an ssh terminal and get the desired effect.

I'm just baffled as to why I can't do it via a PHP script.

I've tried:
exec("/usr/bin/mplayer [options] > /dev/null");
No luck.
Runs over ssh, but not from a script.


Any ideas?

Last edited by fw12; 19th November 2006 at 08:16 PM.
Reply With Quote
  #6  
Old 12th April 2011, 07:35 PM
fliddell Offline
Registered User
 
Join Date: Oct 2006
Posts: 1
macosfirefox
Re: How to execute a command remotely

As this last post is about 5 years old, this may no longer be an issue or care.

If you don't care about security, you can edit your httpd.conf file and change the user that apache uses to load web pages.
Change:
Code:
User apache
Group apache
To
Code:
User <your username>
Reply With Quote
Reply

Tags
command, execute, remotely

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MAKE command won't execute... senile2 Servers & Networking 4 11th February 2008 09:17 PM
Execute command at runlevel-1 ??? buttari Using Fedora 2 21st January 2007 04:15 PM
how-to execute a command with an email paul_mat Servers & Networking 3 5th September 2006 03:37 PM
execute command on startup bwonderve Using Fedora 6 12th May 2006 11:09 AM
How do I Execute command on display :1 pobman Using Fedora 2 5th May 2006 08:49 AM


Current GMT-time: 20:22 (Wednesday, 22-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat