Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 283340 - app-misc/lirc-0.8.5 user environmnet not set by "start-stop-daemon --start ..." in /etc/init.d/irexec
Summary: app-misc/lirc-0.8.5 user environmnet not set by "start-stop-daemon --start ....
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Television related Applications in Gentoo's Portage
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-31 16:11 UTC by Wilson M. Michaels
Modified: 2012-07-20 15:15 UTC (History)
1 user (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 Wilson M. Michaels 2009-08-31 16:11:27 UTC
The bug is: 
The remote control will not start my application if irexec is started by init when booting. 

The irexec was added to boot level default. I see the message "Starting irexec /home/wmichaels1/.lircrc ..." during boot. 

However: 
The remote control starts my application if irexec is started from a terminal using:
     sudo /etc/init.d/irexec start


The irexec program in the lirc package can be run as a system daemon by init using the files placed in /etc/iniit.d/irexec and /etc/conf.d/irexec when lirc is installed with portage. It recommends that the init script specify a real user other than the default "root". I edited /etc/conf.d/irexec to use wmichaels1, my normal user.

My fix: 
Add "--env HOME=/home/${IREXEC-USER}" to the start-stop-daemon arguments.

Here is what the start-stop-daemon command looks like for my fix:

        start-stop-daemon --start --chuid ${IREXEC_USER} --user ${IREXEC_USER} \
                --env HOME="/home/${IREXEC_USER}/" \
                --exec /usr/bin/irexec -- --daemon ${IREXEC_OPTS}

Note: 
The argument "--chdir /" was removed because it is not documented as a valid argument on the start-stop-daemon man page. 

Results: 
With the above start-stop-daemon arguments my remote control now starts my application when the /etc/init.d/irexec script is run during system boot.
Comment 1 Ian Stakenvicius (RETIRED) gentoo-dev 2012-07-19 20:20:46 UTC
With current baselayout, start-stop-daemon is supposed to update $HOME whenever --user is specified, to match that user's home.  Since $HOME for ${IREXEC_USER} in /etc/passwd is presumably the same as /home/${IREXEC_USER} , the proposed patch should not be necessary.

However, it could be possible that the actual fix for your issue was the removal of the "--chdir /" option (which is valid according to the start-stop-daemon manpage currently)

Please confirm if there are any issues with irexec and newer lirc's.
Comment 2 Wilson M. Michaels 2012-07-20 15:15:07 UTC
I confirm that the current version of /etc/init.d/irexec works properly for me.

Thanks for taking the time to look into this.

My working solution involves settings in /etc/conf.d/irexec:
  IREXEC_OPTS="/home/mythtv/.lircrc"
  IREXEC_USER="mythtv"

Everything works as expected without modifying /etc/init.d/irexec