[Pkg-xmpp-devel] Bug#1100030: why adduser in preinst?

Simon Josefsson simon at josefsson.org
Tue Mar 11 07:34:46 GMT 2025


Marc Haber <mh+debian-packages at zugschlus.de> writes:

> Package: jabberd2
> Version: 2.7.0-7
> Severity: minor
>
> Hi,
>
> I am the main maintainer of adduser and am always interested in usage
> patterns of my software. jabberd2 is one of the _very_ few (<5) packages
> in Debian that use adduser in their preinst.
>
> Since this might interfere with adduser's development (preinst might and
> probably will run with an un-updated adduser during upgrades), I would
> like to know why it was decided in jabberd2 to create the user in
> preinst.
>
> If there is no real reason, I'd love the usage of adduser being moved
> too postinst like hundreds of other packages do it.
>
> In addition, in trixie, the scaffolding you're using around your adduser
> calls is no longer necessary.
>
> A single call of
> adduser --system --group --home=/var/lib/jabberd2 --no-create-home jabber
> will already do it.

Thanks -- I suspect the actual reason may be lost in time.  What is the
exact patch you are thinking of, is it the one below?  I'm happy to
apply it and see of Salsa is happy and then upload and see if we get any
reports.

/Simon

diff --git a/debian/postinst b/debian/postinst
index aa845ab..4ed42c5 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -21,6 +21,17 @@ case "$1" in
     ;;
 esac
 
+if ! getent group | grep -q "^jabber:"
+then
+   addgroup --system jabber
+fi
+
+if ! getent passwd | grep -q "^jabber:"
+then
+   adduser --system --home /var/lib/jabberd2 --no-create-home \
+   --quiet --disabled-password --ingroup jabber jabber
+fi
+
 #DEBHELPER#
 
 exit 0
diff --git a/debian/preinst b/debian/preinst
index abc46e1..4843a2d 100644
--- a/debian/preinst
+++ b/debian/preinst
@@ -35,17 +35,6 @@ case "$1" in
     ;;
 esac
 
-if ! getent group | grep -q "^jabber:"
-then
-   addgroup --system jabber
-fi
-
-if ! getent passwd | grep -q "^jabber:"
-then
-   adduser --system --home /var/lib/jabberd2 --no-create-home \
-   --quiet --disabled-password --ingroup jabber jabber
-fi
-
 #DEBHELPER#
 
 exit 0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1251 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-xmpp-devel/attachments/20250311/1eddaa32/attachment.sig>


More information about the Pkg-xmpp-devel mailing list