Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 144640

Summary: mythbackend init.d script depends on HOME from environment
Product: Gentoo Linux Reporter: Richard Freeman <rich0>
Component: Current packagesAssignee: Television related Applications in Gentoo's Portage <media-tv>
Status: RESOLVED FIXED    
Severity: minor    
Priority: High    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Richard Freeman gentoo-dev 2006-08-21 06:46:18 UTC
The mythbackend init.d script sets HOME, but does not export it.  If HOME is not exported when calling /etc/init.d/mythbackend, the service will not start.

As a result, mythbackend cannot be started by monit (daemon-monitoring application) - monit exports only a very minimal environment when calling init scripts.

Fix is just to add "export" to the start of the line HOME=/etc/mythtv .
Comment 1 Doug Goldstein (RETIRED) gentoo-dev 2006-09-29 07:48:35 UTC
This is still a WORKSFORME. Unless you provide some more details and info behind this.
Comment 2 Richard Freeman gentoo-dev 2006-09-29 08:09:17 UTC
(In reply to comment #1)
> This is still a WORKSFORME. Unless you provide some more details and info
> behind this.
> 

Still?  Hadn't seen any previous bugs on this - I figured this was a new issue.

Simple way to reproduce (run as root):

/etc/init.d/mythbackend stop
unset HOME
/etc/init.d/mythbackend start

mythbackend will fail to start.

Sure, running interactively people won't be unsetting home, but if monit or another automated package tries to run the init.d script without having a HOME exported it will not work.  It doesn't matter what HOME is set to since the init.d script changes it - it just has to be already exported for it to work.

If a variable is in the environment then changing it in bash changes it in the environment.  If the variable is not already exported then setting it makes it a bash variable and not an environment variable.

In any case, I don't see any harm arising from making the export explicit.
Comment 3 Doug Goldstein (RETIRED) gentoo-dev 2006-10-05 19:41:51 UTC
Fixed.