On 16/02/2008, <b class="gmail_sendername">Michael T. Dean</b> <<a href="mailto:mtdean@thirdcontact.com">mtdean@thirdcontact.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 02/16/2008 02:40 PM, Ashley Bostock wrote:<br>> On 16/02/2008, Michael T. Dean <<a href="mailto:mtdean@thirdcontact.com">mtdean@thirdcontact.com</a>> wrote:<br>><br>>> On 02/16/2008 01:01 PM, Paul Harrison wrote:<br>
>><br>>>> Ashley Bostock wrote:<br>>>>> In mythwelcome if I bring up the menu and choose the "Shutdown Now"<br>>>>> option, nothing happens (used to work) and in the mythwelcome log I<br>
>>>> get this...<br>>>>><br>>>>> mythshutdown --startup returned: 1<br>>>>> mythshutdown: Could not initialize myth context. Exiting.<br>>>>><br>>>>> I've seen people talk about it is due to the $HOME variable not being<br>
>>>> set, but running echo $HOME before starting mythwelcome does output<br>>>>> the correct directory. I've also tried adding sudo -H to every place<br>>>>> I can find which runs mythshutdown but that makes no difference either.<br>
>>>><br>>>>> My auto shutdown/wake up is working perfectly still, so it's only the<br>>>>> "Shutdown Now" option that's broken.<br>>>>> Is it working for anyone else?<br>
>>>><br>>>> It's probably something to do with the way mythwelcome does the<br>>>> shutdown. The command it uses is hardcoded to this:-<br>>>> system("sudo " + m_installDir + "/bin/mythshutdown --shutdown")<br>
>>><br>>>> Not sure at this stage why some people are suddenly having problems, my<br>>>> parents machine has been running mythwelcome/mythshutdown for well over<br>>>> 2 years now with no problems although they are still running svn that is<br>
>>> probably 6 months old now. Most problems can be traced to the user not<br>>>> having things setup right but if it was working and now isn't then I<br>>>> suspect the new auto-discovery stuff may have a hand in it.<br>
>>><br>>> Exactly! Fix the environment in which mythwelcome/mythshutdown is<br>>> executed to have a properly-exported HOME directory and everything will<br>>> work.<br>> Thanks for the info. Any pointers on what a "properly exported HOME<br>
> directory" requires?<br>><br>> If I type export, I can see HOME listed and set to the correct value.<br>> If I type echo $HOME, it shows the correct value. But then running sudo<br>> mythshutdown, gives me the error.<br>
><br>> I accept my system configuration is broken, but it's a stock Ubuntu install<br>> so if I can get some help in figuring out what needs to be fixed, then I'm<br>> sure it'll save a lot of threads like this from others when 0.21 gets<br>
> released to the masses.</blockquote><div><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Depending on the value specified for env_reset in your sudoers file, the<br>
handling of the HOME environment variable can differ. If env_reset is<br>enabled (the default, and really the configuration you should use), only<br>a few variables (including HOME) are passed to the environment in which<br>
the sudone ;) command is executed.</blockquote><div><br>
My sudoers file doesn't have env_reset in it, so I'm using the default setting of it being enabled.<br>
</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">However, the value may be determined<br>by the sudo default depending on the values of env_keep, env_delete,<br>
and/or env_check.</blockquote><div><br>
I don't change/set any of these either in my sudoers file.<br>
</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">See the sudo and sudoers man page (and especially the SECURITY NOTES<br>section of the sudo man page), and check your /etc/sudoers to see if<br>
you're changing the HOME variable handling.</blockquote><div><br>
Cross referencing each line and setting (there are hardly any) in my
sudoers file with the description from the man pages, I can't find any
thing in it that would change it.<br>
</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Also, run "sudo -V" as root to see more info on your sudo config.</blockquote>
<div><br>
Running that gives me...<br>
Environment variables to check for sanity:<br>
XAUTHORIZATION<br>
XAUTHORITY<br>
DISPLAY<br>
LOGNAME<br>
HOME<br>
TERM<br>
LANGUAGE<br>
LANG<br>
LC_*<br>
<br>
Which I assume is saying that the HOME variable should be exported and
set correctly when I use sudo. No other line on the output talks about
the HOME setting or anything regarding removing, modifying, not
setting, etc... its value.<br>
</div><div><br>
So I'm completely confused as to what a properly configured sudo setup
should look like, as based off what you've said and what the man page
states I'm not specifically telling it to not set HOME, in fact
everything seems to imply that it should be set.<br>
</div><br>
Any one else out there who has this working, could you post your sudoers file?<br>
Mike I assume you do have this working, do you have any extra settings in your sudoers file?<br>
<br>
Ash<br></div></div><br>