Summary: | net-im/ejabberd-22.05-r1: repeated crashes caused by acct-user/ejabberd not updating ejabberd user's home | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Phil Stracchino (Unix Ronin) <phils> |
Component: | Current packages | Assignee: | ejabberd Project <ejabberd> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | phils |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Phil Stracchino (Unix Ronin)
2022-07-06 13:27:45 UTC
I suspect your ejabberd user has HOME set to /dev/null. Is it possible that you have acct-user/ejabberd-0 installed? If so, does upgrading to acct-user/ejabberd-1 help? Hi Florian, acct-user/ejabberd is version 1. However you're correct that user ejabberd's home is /dev/null. What is the recommended setting here? With acct-user/ejabberd-1 it should be /var/lib/ejabbberd (was /dev/null with acct-user/ejabberd-0). However I had expect acct-user/ejabberd-1 to automatically update the entry for HOME in the system's user database. Never mind, I removed and re-merged acct-user/ejabberd, and ~ejabberd is now /var/lib/ejabberd. I'll try re-merging 22.05 now. (In reply to Florian Schmaus from comment #3) > With acct-user/ejabberd-1 it should be /var/lib/ejabbberd (was /dev/null > with acct-user/ejabberd-0). However I had expect acct-user/ejabberd-1 to > automatically update the entry for HOME in the system's user database. Apparently it doesn't ... Confirmed that was the problem. Updating from acct-user/ejabberd-0 to acct-user/ejabberd-1 DOES NOT update the home directory of an already-existing ejabberd user, so ejabberd-22.05 fails to start. Not sure whether this should be patched by net-im/ejabberd, or fixed in acct-user/ejabberd. Works as intended here: $ emerge -1 =acct-user/ejabberd-0 $ getent passwd ejabberd ejabberd:x:980:114:User for net-im/ejabberd:/dev/null:/sbin/nologin $ emerge -1 =acct-user/ejabberd-1 $ getent passwd ejabberd ejabberd:x:980:114:User for net-im/ejabberd:/var/lib/ejabberd:/sbin/nologin I don't expect that you have some custom overrides in /etc/portage? (In reply to Florian Schmaus from comment #7) > Works as intended here: > > $ emerge -1 =acct-user/ejabberd-0 > $ getent passwd ejabberd > > ejabberd:x:980:114:User for net-im/ejabberd:/dev/null:/sbin/nologin > > $ emerge -1 =acct-user/ejabberd-1 > $ getent passwd ejabberd > ejabberd:x:980:114:User for net-im/ejabberd:/var/lib/ejabberd:/sbin/nologin > > I don't expect that you have some custom overrides in /etc/portage? Nope. If it worked for you, I have no idea why it didn't for me. Could you maybe dig into your logs? The should say something like "Updating home for user…" [1]. Can you reproduce the issue? If yes, then the debug logs while emerging acct-user/ejabberd-1 would be interesting, especially those of the pkg_postinst() phase [2]. 1: https://github.com/gentoo/gentoo/blob/cbfdb24008d7ff3c84e1e9674dfe1f42e916ad3e/eclass/user.eclass#L403-L404 2: https://github.com/gentoo/gentoo/blob/2588af0e4d08fae6e3ba3fbaa885c6500885444c/eclass/acct-user.eclass#L486 (In reply to Florian Schmaus from comment #9) > Could you maybe dig into your logs? The should say something like "Updating > home for user…" [1]. Can you reproduce the issue? If yes, then the debug > logs while emerging acct-user/ejabberd-1 would be interesting, especially > those of the pkg_postinst() phase [2]. > > 1: > https://github.com/gentoo/gentoo/blob/ > cbfdb24008d7ff3c84e1e9674dfe1f42e916ad3e/eclass/user.eclass#L403-L404 > 2: > https://github.com/gentoo/gentoo/blob/ > 2588af0e4d08fae6e3ba3fbaa885c6500885444c/eclass/acct-user.eclass#L486 No 'Updating home...' found in emerge.log. This is all that is in emerge.log for acct-user/ejabberd-1: 1652878282: Started emerge on: May 18, 2022 08:51:21 1652878282: *** emerge --verbose-conflicts --newuse --update --ask --deep --keep-going --with-bdeps=y --regex-search-auto=y --verbose world 1652878369: >>> emerge (1 of 3) acct-user/ejabberd-1 to / 1652878369: === (1 of 3) Cleaning (acct-user/ejabberd-1::/usr/portage/acct-user/ejabberd/ejabberd-1.ebuild) 1652878369: === (1 of 3) Compiling/Merging (acct-user/ejabberd-1::/usr/portage/acct-user/ejabberd/ejabberd-1.ebuild) 1652878376: === (1 of 3) Merging (acct-user/ejabberd-1::/usr/portage/acct-user/ejabberd/ejabberd-1.ebuild) 1652878379: >>> AUTOCLEAN: acct-user/ejabberd:0 1652878379: === Unmerging... (acct-user/ejabberd-0) 1652878381: >>> unmerge success: acct-user/ejabberd-0 1652878384: === (1 of 3) Post-Build Cleaning (acct-user/ejabberd-1::/usr/portage/acct-user/ejabberd/ejabberd-1.ebuild) 1652878384: ::: completed emerge (1 of 3) acct-user/ejabberd-1 to / I can force a downgrade to -0, manually adjust the home back to /dev/null, and then re-upgrade, if you wish. I found the root cause in my logs: * Updating home for user 'ejabberd' ... * - Home: /var/lib/ejabberd usermod: user ejabberd is currently used by process 434 * ejabberd is in use, cannot update home * There was an error when attempting to update the home directory for ejabberd * Please update it manually on your system (as root): * usermod -d "/var/lib/ejabberd" "ejabberd" (In reply to Florian Schmaus from comment #11) > I found the root cause in my logs: > > * Updating home for user 'ejabberd' ... > * - Home: /var/lib/ejabberd > usermod: user ejabberd is currently used by process 434 > * ejabberd is in use, cannot update home > * There was an error when attempting to update the home directory for > ejabberd > * Please update it manually on your system (as root): > * usermod -d "/var/lib/ejabberd" "ejabberd" Aaaaaaahhhhh. Can't update the user's home directory while it's in use. Makes perfect sense. So to work without manual fixing, this needs to stop ejabberd while it updates the user, then restart it. This is something to bear in mind for nearly every acct-user ebuild, I imagine. |