[debian-mysql] Bug#1023778: TMPDIR behaviour in maintainer scripts [was: Re: Bug#1023778: mysql-server-8.0: fails to restart on upgrade with libpam-tmpdir]

Robie Basak robie.basak at ubuntu.com
Thu Nov 10 07:26:17 GMT 2022


Thank you for the report. Adding debian-devel@ and the libpam-tmpdir
maintainer for wider discussion.

On Thu, Nov 10, 2022 at 12:54:34AM +0000, brian m. carlson wrote:
> On my systems, I use libpam-tmpdir, which provides each user with a
> private temporary directory owned and accessible only by them under
> /tmp/user/UID (e.g., /tmp/user/1000).  PAM sets the TMPDIR variable to
> this value upon creating a session.
> 
> When I upgrade mysql-server-8.0, it is obviously as root, so TMPDIR is
> set to /tmp/user/0.  This value does not work since MySQL doesn't run as
> root, and so MySQL fails to start after upgrade in such a configuration,
> like so:

I think I understand the problem.

But are you in essence saying that libpam-tmpdir requires that *every
maintainer script* that runs things as non-root, or starts processes
that do that, unset TMPDIR first?

Wouldn't ignoring TMPDIR make it less useful for users who wish to set
it for other purposes, since maintainer scripts would stop respecting
this?

Or, if this universally is the right thing to do, then maybe dpkg should
be doing it rather than individual maintainer script?

I'd be happy to unset TMPDIR if there's clear consensus that this is
what such maintainer scripts should always do, but it isn't clear to me
that this is correct.

Note that in this case it's the database initialization that's affected,
which happens to be done by mysqld running as a daemon, but in a way
that is equivalent to it not being a daemon - the task will be complete,
with no lingering processes, before the maintainer script exits.

In searching all I could find was
https://lists.debian.org/debian-devel/2005/02/msg00374.html which is
a similar question but doesn't look like it ever concluded.

I think the answer to this should probably be established by the
libpam-tmpdir maintainer and documented first, for fear of someone else
later coming along and saying that the maintainer script incorrectly
ignores TMPDIR because we started ignoring it to resolve this bug. So I
copied debian-devel@ for comment.

Thanks,

Robie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-mysql-maint/attachments/20221110/fe8d40fc/attachment.sig>


More information about the pkg-mysql-maint mailing list