Posts: 476
Joined: Nov 2007
2009-05-21, 22:58
Hey guys,
finally got my general suspend problem fixed, so I am able to put my machine to sleep just fine now. Now the next problem is "irexec". I use it to assign remote buttons in ubuntu 9.04 to specific actions, e.g. start xbmc, or shutdown the PC.
Problem is, after resuming, irexec process is gone and thus my mapped buttons in .lircrc don't work.
I tried adding restart scripts in /etc/pm/sleep.d and/or in /etc/acpi/resume.d (what is the difference between these dirs btw?). But irexec don't seem to restart. I think there might be a problem anyway. Since irexec is started by the gnome startup applications manager at bootup, I would have to restart it the same way, thus ubuntu still has the same display assigned to it.
Anyway, if someone who uses irexec + suspend/resume could give me some tipps that would be great ...
thanks
boba
Posts: 2,529
Joined: Apr 2009
Reputation:
8
Does it work if you manually run the script (kill + start irexec)?
I have seen that other people having problem with lirc after resume and you may need relead also lirc.
Posts: 476
Joined: Nov 2007
2009-05-22, 11:09
(This post was last modified: 2009-05-22, 11:11 by User 29008.)
Hey man,
lircd is not the problem, I got that working rock solid, meaning after suspend and resume remote inside xbmc (which is not managed by irexec or irxevent) is working perfectly fine. Its just my mappings for "outside" xbmc, e.g. start xbmc from ubuntu desktop or shutdown the system while on the desktop don't work. Since these are handled by mappings in .lircrc / irexec.
But anyway, I DO restart lircd and unload / reload it's modules anyway, since without that, my machine refuses to go into standby more than once per session ;-) Though lirc is restarted anyway.
If I run the script manually in /etc/pm/sleep.d it seems to work, though not always I think, it seems a bit unreliable.
pm-suspend.log shows the script running as well, with no obvious errors .... strange. And irexec IS restarted, I can tell from the changing process ID. Could it still be a X / Display variable problem? I exported DISPLAY=:0.0 in the scripts I wrote ...
boba
Posts: 476
Joined: Nov 2007
Alright, I think I got irexec to reload after resume now. I can shutdown my machine from the Ubuntu desktop just fine with the assigned button from .lircrc, which didn't work before after resume. Still I cannot use all my assigned buttons from .lircrc, the button for launching xbmc does nothing. Only after resume. After a clean boot the button works. irexec is running, as I said, shutdown button works.
Here is my .lircrc:
# Start XBMC
begin
prog = irexec
button = PCPower
config = /home/boba/scripts/startXBMC.sh
end
# Kill XBMC
begin
prog = irexec
button = TV
config = /home/boba/scripts/killXBMC.sh
end
# Shutdown
begin
prog = irexec
button = Red
config = sudo /home/boba/scripts/shutdown.sh
end
and here is my "startXBMC.sh" script which is assigned to the button that won't work after resume:
#!/bin/bash
export XBMC_HOME=/usr/share/xbmc
export DISPLAY=:0
# debug
echo "XBMC Start Script ran ..." > /home/boba/start.txt
# Test to see if XBMC is running first
if ps -ef|grep -v grep|grep -i xbmc.bin
then
# Do nothing
echo "XBMC already Running!"
else
# Startup XBMC
echo "XBMC Starting up NOW !!!" >> /home/boba/start.txt
gnome-screensaver-command -i &
/usr/bin/xbmc && killall -15 gnome-screensaver-command
#/usr/bin/xbmc
fi
exit
You can see the debug echos that I put in which shows me, that the button actually works, after each press the file "start.txt" is created and the expected text is in there.
Question now is, why xbmc won't launch.
From a ssh shell e.g. I can run the script just fine with:
export DISPLAY=:0 ; startXBMC.sh
So why won't xbmc start when triggered by script via irexec (only after resume)?
thanks for any help guys ...
boba
Posts: 2
Joined: May 2010
Reputation:
0
I am facing same problem with irexec being dead after resume from suspend on 9.10 32bit.
Everything works except this. I can provide all needed information if someone is willing to help a bit.
I had defeated so many issues with all this lirc/remote/suspend/resume thing and now there is only one left...
Posts: 476
Joined: Nov 2007
sollarman Wrote:I am facing same problem with irexec being dead after resume from suspend on 9.10 32bit.
Everything works except this. I can provide all needed information if someone is willing to help a bit.
I had defeated so many issues with all this lirc/remote/suspend/resume thing and now there is only one left...
Hey,
as I already wrote you via email, I am using monit to monitor the process and restart it if it dies. I didn't find another solution yet.
boba