View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 16 posts ] 
Go to page 1, 2  Next

Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Sun Jun 19, 2005 3:48 pm 
Offline
Joined: Thu Jun 16, 2005 2:37 pm
Posts: 116
Location: St. Louis MO.
Hey ppl, I'v been tryin to get irexec to run as root at startup so that I can have the remote restart X when the frontend freezes or messes up.

I'v tried putting it in the bootmisc script right under lircd but it never loads there. i'v tried the apps script in .fluxbox under the mythtv user but that just runs it as mythtv who cant restart X then I put lircd in the sshd startup script sence it loads earlier then most of the other scripts and irexec in various scripts including gdm, mythbackend, samba, and mysql but it never loads! :evil: I'v been using the "-d" switch so it runs as a demon.

Can anyone help me out please :?:


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 19, 2005 6:22 pm 
Offline
Joined: Mon Oct 06, 2003 10:38 am
Posts: 4978
Location: Nashville, TN
hello? mcfly? irxevent let's break this down ir(infared)x(xwindows)event(went something happens) so irxevent is not going to run outside of xwindows, and it's very doubtfull that you'll be able to get it to restart X though you may be able to get it to run a script which uses sudo to restart gdm or something.

_________________
Have a question search the forum and have a look at the KnoppMythWiki.

Xsecrets


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 19, 2005 6:30 pm 
Offline
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location: Adelaide, Australia
He said irexec not irxevent. Not sure if the same problem would apply. Does it work if you run irexec as root from a console?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 20, 2005 2:03 pm 
Offline
Joined: Thu Jun 16, 2005 2:37 pm
Posts: 116
Location: St. Louis MO.
Yeah greg. IRExec works perfectly when I run it as root from the console and I have the lircrc file setup so it restarts xfree86 from the power button of the remote. I just need it to run as root from startup. Have any ideas?

_________________
Backend: HP NetServer LT 6000r U3; 6 700Mhz Xeon CPUs; 3GB PC133 ECC; LSI Ultra160 SCSI 4 18GB 10kRPM striped system; 7200RPM 160GB recordings; Ubuntu-server 7.04; HDHomeRun box.
Frontend: A64 3000+; 512MB DDR; Hauppauge grey; knoppmyth PXE/NFS.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 21, 2005 3:32 am 
Offline
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location: Adelaide, Australia
Find out where lircd starts because its a fair bet that the daemon would need to be running and ready to accept connections before irexec was run. In my case, I start lircd in /etc/init.d/bootmisc.sh
Then add a line after lircd is started that delays for a few seconds (to give it time to start up) then starts irexec. For example:
Code:
(sleep 5 ; irexec) &


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 21, 2005 2:14 pm 
Offline
Joined: Thu Jun 16, 2005 2:37 pm
Posts: 116
Location: St. Louis MO.
Thanks for the helpful reply Greg but unfortunately it didn't work :cry:
Here is what I put at the end of bootmisc.sh:
Code:
/usr/local/sbin/lircd
(sleep 15 ; /usr/local/bin/irexec -d) &

I tried the last line in the console and it worked but it just wont work at startup... :?
Maybe it has something to do with the permissions of the irexec file?
Could you try it on your Knoppmyth box? It would be easier for you to help me that way. Thanks!

_________________
Backend: HP NetServer LT 6000r U3; 6 700Mhz Xeon CPUs; 3GB PC133 ECC; LSI Ultra160 SCSI 4 18GB 10kRPM striped system; 7200RPM 160GB recordings; Ubuntu-server 7.04; HDHomeRun box.
Frontend: A64 3000+; 512MB DDR; Hauppauge grey; knoppmyth PXE/NFS.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 21, 2005 8:34 pm 
Offline
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location: Adelaide, Australia
I'll give it a go if I get a chance. I run my irexec in .fluxbox/apps, but as you say, this means it runs as mythtv user.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 22, 2005 6:55 am 
Offline
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location: Adelaide, Australia
OK, when I ran irexec as root I got an error about it not being able to find the .lircrc config file. This may be your problem too.

In my case, the config file is ~mythtv/.lircrc

You can pass the config file on the command line to irexec. Try:
Code:
/usr/local/sbin/lircd
(sleep 15 ; /usr/local/bin/irexec -d ~mythtv/.lircrc) &


Also on my system, irexec is in /usr/bin/irexec not /usr/local/bin/irexec so you might want to check that (although I have had to build lirc from source).

When I did this in bootmisc.sh it worked fine.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 23, 2005 5:35 pm 
Offline
Joined: Thu Jun 16, 2005 2:37 pm
Posts: 116
Location: St. Louis MO.
Thanks a LOT greg! :D That worked for me perfectly except I decided to go with 3 seconds instead.

_________________
Backend: HP NetServer LT 6000r U3; 6 700Mhz Xeon CPUs; 3GB PC133 ECC; LSI Ultra160 SCSI 4 18GB 10kRPM striped system; 7200RPM 160GB recordings; Ubuntu-server 7.04; HDHomeRun box.
Frontend: A64 3000+; 512MB DDR; Hauppauge grey; knoppmyth PXE/NFS.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 14, 2005 11:37 am 
Offline
Joined: Thu Jun 16, 2005 2:37 pm
Posts: 116
Location: St. Louis MO.
I got a new problem with this now. I upgraded to R5A22 and now it doesn't work. First I found that irexec is in a diffrent location so I updated the command to this "(sleep 1 ; /usr/bin/irexec -d /home/mythtv/.lircrc) &" I changed the location to the new one and the sleep time to 1sec because lirc starts before this now, right?
So after thoes changes it still wont load up at boot...
However it will start by manually typing irexec -d as usual.
What's with this?
THANKS!

P.S. Remeber this is in bootmisc.sh

_________________
Backend: HP NetServer LT 6000r U3; 6 700Mhz Xeon CPUs; 3GB PC133 ECC; LSI Ultra160 SCSI 4 18GB 10kRPM striped system; 7200RPM 160GB recordings; Ubuntu-server 7.04; HDHomeRun box.
Frontend: A64 3000+; 512MB DDR; Hauppauge grey; knoppmyth PXE/NFS.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 14, 2005 9:46 pm 
Offline
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location: Adelaide, Australia
Can you redirect the output to a log file (including stderr 2>&1) so that you can see if it is reporting an error.? I think A22 automatically runs irexec as mythtv by calling launch_irx.sh from ~/.fluxbox/apps if your lircrc file uses it. Could this be causing you problems?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 16, 2005 1:04 pm 
Offline
Joined: Thu Jun 16, 2005 2:37 pm
Posts: 116
Location: St. Louis MO.
ok I tried "(sleep 1 ; /usr/bin/irexec -d /home/mythtv/.lircrc) & > /myth/irexecout" but that just made a blank file. Mayb it doesn't give output?
What's "stderr 2>&1"? I'm not a pro programmer like u guys.
I looked in /home/mythtv/.fluxbox/apps and there is no line to run the launch_irx.sh script but that would run it as the mythtv user.

_________________
Backend: HP NetServer LT 6000r U3; 6 700Mhz Xeon CPUs; 3GB PC133 ECC; LSI Ultra160 SCSI 4 18GB 10kRPM striped system; 7200RPM 160GB recordings; Ubuntu-server 7.04; HDHomeRun box.
Frontend: A64 3000+; 512MB DDR; Hauppauge grey; knoppmyth PXE/NFS.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 16, 2005 7:36 pm 
Offline
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location: Adelaide, Australia
2>&1 means that data written to standard error (which most error messages probably are) will be written to standard output. I can never remember were on the command line it should go.

Try something like this:

Code:
(sleep 1 ; /usr/bin/irexec -d /home/mythtv/.lircrc > /myth/irexecout 2>&1 ) &


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 16, 2005 7:53 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
That looks more correct. The way to remember this is that redirection on the command line is processed left to right in the order that you would read it, and something like 2>&1 sends 2 to the same place that 1 is currently going. If you redirect 1 again later, 2 gets left behind.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 19, 2005 6:02 pm 
Offline
Joined: Thu Jun 16, 2005 2:37 pm
Posts: 116
Location: St. Louis MO.
I tried "(sleep 1 ; /usr/bin/irexec -d /home/mythtv/.lircrc > /myth/irexecout 2>&1 ) &" but theres still no output. Then I thought it might be because of the daemon mode "-d" so i took that out and still nothing... So I figure that irexec just doesnt give any verbose output at all, it doesnt even have a verbose command switch.
Then I messed wtih the command a bit and tried "/usr/bin/irexec -d /home/mythtv/.lircrc" but that STILL didn't have any effect.
Now i'm wondering if lirc is actually starting before bootmisc.sh or not. :?

_________________
Backend: HP NetServer LT 6000r U3; 6 700Mhz Xeon CPUs; 3GB PC133 ECC; LSI Ultra160 SCSI 4 18GB 10kRPM striped system; 7200RPM 160GB recordings; Ubuntu-server 7.04; HDHomeRun box.
Frontend: A64 3000+; 512MB DDR; Hauppauge grey; knoppmyth PXE/NFS.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ] 
Go to page 1, 2  Next



All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu