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

Restart LIRC (Solved)
http://forum.linhes.org/viewtopic.php?f=11&t=11966
Page 1 of 1

Author:  sgunther [ Tue Oct 03, 2006 12:01 am ]
Post subject:  Restart LIRC (Solved)

I am playing with my lircrc file. Rebooting i getting old to try out a small change. Is there any other way to get LIRC to re-load?

Using homebrew serial device.

I tried the /etc/init.d/lirc reload but it does not seem to work....

I can run /usr/sbin/lircd --nodameon and then irw works but no commands are getting passed to mythfrontend.....

Any ideas....?

UPDATE 2006/12/26 - See post below for the answer!

Author:  mad_paddler [ Tue Oct 03, 2006 2:05 am ]
Post subject: 

I've never been able to get mythfrontend to respond to changes in the lircrc file without rebooting :/

Author:  tjc [ Tue Oct 03, 2006 8:37 pm ]
Post subject: 

It's an ugly answer but I have to concur. The lirc stack is complex and convoluted enough that I've never really gotten everything completely sorted out short of a reboot.

Author:  sgunther [ Tue Dec 26, 2006 4:09 pm ]
Post subject:  Problem Solved

OK so I finally had some time to do some digging and figured out how to restart lirc witout rebooting.

lircd and lircmd are the two daemons that must be restarted. I had always assumed that using the standard command for lirc would work...

Code:
/etc/init.d/lirc restart


In theory this likely would work for anyone not using the serial homebrew but part of the restart (and start for that matter) trys to reset the port and for the serial device it does not work.

There are two choices as I saw it to fix the issue...
Option A: Patch /etc/init.d/lirc to fix the port reset issue.
Option B: Write a custom lirc restart routine.

There are three steps that must occur to restart lirc...
Step 1: Stop the lircd and lircmd daemons.
Step 2: Start the lircd and lircmd daemons.
Step 3: Restart any applications that the lirc update would affect.

Given that...
1. I will likely run this from a command prompt in an ssh session.
2. Choosing Option A would still require the application restarts

I chose Option B. Here are the steps.....

ssh into the myth box and su to root
Code:
touch /usr/bin/restartlirc.sh
chown root:mythtv /usr/bin/restartlirc.sh
chmod 770 /usr/bin/restartlirc.sh
nano /usr/bin/restartlirc.sh


Now paste the following into nano...

Code:
#!/bin/sh
echo "Stopping lircd"
start-stop-daemon --stop --quiet --signal 1 --exec /usr/sbin/lircd
echo "Stopping lircmd"
start-stop-daemon --stop --quiet --signal 1 --exec /usr/sbin/lircmd
echo "Starting lircmd"
start-stop-daemon --start --quiet --signal 1 --exec /usr/sbin/lircd
echo "Starting lircmd"
start-stop-daemon --start --quiet --signal 1 --exec /usr/sbin/lircmd
echo "Restarting mythfrontend "
killall -9 mythfrontend
/etc/init.d/gdm restart
exit


Exit and save....

Now when you can run restartlirc.sh. I chose to actuall restart X vs just restart mythfrontend because when I am running from an ssh session the display would not be local. Hope this helps.

Author:  mad_paddler [ Tue Dec 26, 2006 5:16 pm ]
Post subject: 

Nice one, can't wait to try this out!

In the latest release gdm is no longer there so you'll probably just need to start mythfrontend.

Author:  sgunther [ Tue Dec 26, 2006 5:22 pm ]
Post subject: 

Can you start mythfrontend from the command prompt for another display device? When I ssh into the mythtv box from my PC I am not on Display 0.0 and running mythfrontend will not work.

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