Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 246609 - app-misc/lirc-0.8.4: irexec fails to start applications when I type: /etc/init.d/irexec start
Summary: app-misc/lirc-0.8.4: irexec fails to start applications when I type: /etc/ini...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Television related Applications in Gentoo's Portage
URL:
Whiteboard:
Keywords: PMASKED
Depends on:
Blocks:
 
Reported: 2008-11-13 12:32 UTC by Szymon Zygmunt
Modified: 2012-09-05 08:06 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Szymon Zygmunt 2008-11-13 12:32:30 UTC
I changed my /etc/conf.d/irexec to fit my settings: IREXEC_OPTS and IREXEC_USER(not root) and when I press buttons to start some application, nothing happens. I removed --daemon options from /etc/init.d/irexec for watching what's wrong. When I press buttons i can see something like this in terminal:
Execing command "xdtv"

This is xdtv 2.2.0 running on Linux/i686 (2.6.24-gentoo-r8).
Error: Can't open display: 
Execing command "gnomeradio"

(gnomeradio:5590): Gtk-WARNING **: cannot open display: 
Execing command "audacious"
audacious: cannot open display: 
Try `audacious --help' for more information.

When I start irexec as a regular user it works perfectly.

Reproducible: Always

Steps to Reproduce:
1.Just start /etc/init.d/irexec start
Comment 1 Wilson M. Michaels 2008-12-06 23:12:43 UTC
This is an ugly bug. irexec works fine when invoked in a terminal. 

When invoked as a service using "/etc/init.d/irexec start" it insists on using the environment that was used when the system was booted. In my case that is a framebuffer. The environment has a bunch of framebuffer related scripts. irexec tries to run the application (mythfrontend in my case) in that environment. It crashes so hard even the emergency CTL-ALT-SYSRQ-b can not reboot.

In the .lircrc file I use:
 begin
   remote = DVICO_MCE
   button = dtv
   prog = irexec
   repeat = 0
   config = export DISPLAY=:0.1; mythfrontend
 end

This allows me to start mythfrontend on my secondary display connected to a big HDTV. It works fine when irexec is started from a terminal on my computer monitor (DISPLAY=:0.0). It fails when irexec is started with "/etc/init.d/irexec start"

As a test I tried" 
   config = export DISPLAY=:0.1; printenv >/home/wmichaels1/log 2>&1

"printenv" worked normally. The exported "DISPLAY=:0.1" was not listed in the log file created. Instead it was "DISPLAY=:0.0" with a bunch of framebuffer functions in the environment. Something is doing a wholesale replacement of the environment just before running printenv.

Comment 2 Wilson M. Michaels 2009-08-31 16:47:12 UTC
(In reply to comment #1)
Please disregard the above comment #1 as it is about a different bug (#283340).

Although the start-stop-daemon sets the IREXEC_USER user id as specified, it may not set the IREXEC_USER environment when starting irexec with  the /etc/init.d/irexec script.

A couple of suggestions for your problem:

1) It may be possible to add some arguments to xdtv so it can find the display. (I know nothing about xdtv, but mythfrontend has a -display argument.)

2) Consider writing a script that is started by a command in the .lircrc file.
This script can export "DISPLAY=:0.0" and any other variables that are expected by xdtv.

3) The fix in bug #283340 may solve your problem.
Comment 3 Sergey Popov gentoo-dev 2012-09-05 08:06:05 UTC
Try to reproduce it with new version, because this one in masked