[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#294347: mysql-server: Cannot run /etc/init.d/mysql start if $TMPDIR is set



* Christian Hammers 

| On 2005-02-09 Gilbert Laycock wrote:
| > If you try to start/restart mysql-server as root, and root has TMPDIR
| > set to something not writable by the mysql user (eg if you are using
| > libpam-tmpdir, so TMPDIR is typically /tmp/user/0 during a login
| > session), then it fails to restart - you get errors like this:
| 
| Hm, generally spoken, environment variables exists for a reason, if you
| start a program with such a one, you want it to use it so I can't blame
| MySQL.
| 
| On the other hand, libpam-tmpdir seems to be a nice idea.
| 
| Do you have a suggestion how to solve this problem? Root often starts
| services that change their uids shortly after running i.e. do not
| use "su" or "sudo" which would give them the right env variables.
| 
| I Cc the libpam-tmpdir maintainer ;)

There's not much to do about it -- ideally, services should start a
new session (which would give them a new TMPDIR) and not just change
uids.  (From the PoV of a PAM maintainer at least. :)  However, this
can in practice be a bit icky, so I would just add something like 

[ -w "$TMPDIR" ] || { TMPDIR="/tmp"; export TMPDIR }
  
to the init script.

This should probably be considered good practice for daemons which
change their UID, I think.

I'm Cc-ing debian-devel to see if anybody has any better suggestions;
Mail-Followup-To set there.

-- 
Tollef Fog Heen                                                        ,''`.
UNIX is user friendly, it's just picky about who its friends are      : :' :
                                                                      `. `' 
                                                                        `-  



Reply to: