LinHES Forums
http://forum.linhes.org/

Remote start the frontend
http://forum.linhes.org/viewtopic.php?f=6&t=8705
Page 1 of 1

Author:  MrFahrenheit [ Sat Feb 25, 2006 5:37 pm ]
Post subject:  Remote start the frontend

I know how to restart the backend remotely via ssh, /etc/init.d/mythbackend restart, how can i restart the frontend remotely?

Thanks

Author:  Xsecrets [ Sat Feb 25, 2006 5:56 pm ]
Post subject: 

/etc/init.d/gdm restart
will do it, it's ugly and restarts more than just the frontend, but will accomplish the goal probably more easily than anything else.

Author:  MrFahrenheit [ Sun Feb 26, 2006 9:05 am ]
Post subject: 

thanks for that!

Author:  khrusher [ Mon Feb 27, 2006 6:03 pm ]
Post subject: 

Code:
export DISPLAY=192.168.1.100:0
nohup mythfrontend &


use your own IP address in the DISPLAY command

Author:  wanttoknow [ Mon Feb 27, 2006 6:17 pm ]
Post subject: 

your own IP of the local machine or the myth machine? I am intersted in this as well.
Does that move the display over to the remote machine or does it just permit you to be able to start frontend via ssh?

Thanks so much!!

Author:  khrusher [ Tue Feb 28, 2006 7:49 am ]
Post subject: 

sorry for the quick response, I was in a hurry.

you need to ssh or telnet into the frontend box

Code:
ssh <ip address of frontend box>


once you have a terminal window on the frontend you can run any program you wish. It executes on te frontend. The trick is telling any X programs where to display the GUI. X uses a variable DISPLAY to determine this.

when you log into the console on the frontend it gets set automatically. Since you connected remotely, you need to set DISPLAY yourself.

Code:
DISPLAY=<ip of frontend>:0
export DISPLAY


now when you run mythfrontend, the gui will be displayed on the tv.

Couple ohter comments:

add an ampersand & to the end of the command to cause it to run in the background. this wiil return you to the command prompt to do more stuff or to logout.

add 'nohup' to the beginning of the command line. When you eventually logout of the terminal window, the shell will send a signal to all of the background process that the shell is exiting. the signal, HANGUP, causes the background processes to exit as well. so exiting the terminal will kill the mythfrontend process. by prepending nohup to the command line, the child process (mythfrontend) will ignore the hangup command.

If this something you plan to do offen, I would create a script to do it (use your own frontend box ip address)

Code:
MYTHFRONTEND_IP=192.168.1.50

DISPLAY=${MYTHFRONTEND_IP}:0
export DISPLAY

nohup mythfrontend &


This same script can be used by LIRC to start the frontend with a remote control button.

Author:  tmryan [ Wed Mar 01, 2006 3:09 pm ]
Post subject: 

khrusher wrote:
Code:
MYTHFRONTEND_IP=192.168.1.50

DISPLAY=${MYTHFRONTEND_IP}:0
export DISPLAY

nohup mythfrontend &


This same script can be used by LIRC to start the frontend with a remote control button.


To start the frontend using the remote control, wouldn't you just need the last line:
nohup mythfrontend &

because you're issuing the command on the myth machine and not remotely through ssh?

Author:  thornsoft [ Wed Mar 01, 2006 3:52 pm ]
Post subject: 

FWIW, I've been doing it this way:

cat /usr/local/bin/rfe.sh
#!/bin/sh
#rfe - reboot front end
#Purpose: restart the front-end when it's crashed.
#by Chris Thornton
#11/27/2005

/etc/init.d/gdm stop
echo Sleeping 4 secs...
sleep 4
/etc/init.d/gdm start
echo Done!


I've got it with the setuid bit set, and I just call it.
I don't have LIRC working yet, so I just use my RF keyboard to run from one of the other consoles. It's mainly useful in situations where the whole X envronment is messed up, and I want to "reboot X", as opposed to just starting the front end.

Author:  Dinki [ Wed Mar 01, 2006 7:09 pm ]
Post subject: 

Can someone tell me how to do this as user mythtv? Seems like running the above script needs to be done by root. Maybe I'm missing something simple. Many thanks!

Author:  khrusher [ Wed Mar 01, 2006 7:40 pm ]
Post subject: 

tmryan wrote:
khrusher wrote:
Code:
MYTHFRONTEND_IP=192.168.1.50

DISPLAY=${MYTHFRONTEND_IP}:0
export DISPLAY

nohup mythfrontend &


This same script can be used by LIRC to start the frontend with a remote control button.


To start the frontend using the remote control, wouldn't you just need the last line:
nohup mythfrontend &

because you're issuing the command on the myth machine and not remotely through ssh?


absolutly, but why have two scripts, the DISPLAY settings may be redundant for lirc but required for ssh...script works for both.

Dinki, my script will run for non-root users.

Author:  Dinki [ Wed Mar 01, 2006 9:20 pm ]
Post subject: 

Krusher, doesn't work for me.

export DISPLAY=192.168.0.100:0
nohup mythfrontend &

Produces:

[1] 844
(~)
mythtv@mythtv$ nohup: appending output to `nohup.out'

[I hit enter after a few seconds waiting for the frontend to start and:

[1]+ Exit 1 nohup mythfrontend

Author:  bonarez [ Sun Mar 12, 2006 4:52 am ]
Post subject: 

Quote:
export DISPLAY=192.168.0.100:0


there seems to be something wrong with the ip you're using: a 0 (zero) can not be right..
use ifconfig to see the ip (prolly 192.168.1.100)

Author:  abrendel [ Sun Mar 12, 2006 8:10 am ]
Post subject: 

bonarez wrote:
Quote:
export DISPLAY=192.168.0.100:0


there seems to be something wrong with the ip you're using: a 0 (zero) can not be right..
use ifconfig to see the ip (prolly 192.168.1.100)


A 0 as an octet in the network portion of an IP address is valid, although not very common.

If you binaryize (lemme see you find that word in the dictionary!) this out you will see it better.

Code:
   192      168       0       100
11000000.10101000.00000000.01100100
\------------------------/ \-------/
Network address          Host Address



The host portion of this address should not be all zeros, but there is nothing preventing a full octet of the network address from being all zeros.

Author:  LinuxSneaker [ Sun Mar 12, 2006 11:47 am ]
Post subject: 

Wow, are we off-topic. The last poster said that the last 8 bits are for the host address. This is only for a Class C address. Thus:
Code:
Class A: network.host.host.host
Class B: network.network.host.host
Class C: network.network.network.host

Just wanted to clarify. Now we return you to your regular broadcast station.

Author:  khrusher [ Sun Mar 12, 2006 12:20 pm ]
Post subject: 

Quote:
mythtv@mythtv$ nohup: appending output to `nohup.out'


Is there any clues in nohup.out?

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/