[Pkg-roundcube-maintainers] Roundcube over Postgres on Debian 11.

Kaz Kylheku kaz at kylheku.com
Tue Mar 8 02:21:48 GMT 2022


On 2022-03-07 17:04, Guilhem Moulin wrote:
> On Mon, 07 Mar 2022 at 14:17:10 -0800, Kaz Kylheku wrote:
>> I installed the package roundcube-pgsql. That didn't install postgres 
>> as a
>> dependency,
> 
> That's intentional, since some prefer remote database engines.  The
> package has ‘Suggests: postgresql’ though.
> 
>> So far I had to do things like:
>> 
>> - Add /sbin to PATH: otherwise the package configuration wasn't able 
>> to
>> execute runuser.
> 
> That's suspicious, don't you unpack/configure as root?  Anyway per
> Debian Policy §6.1 we don't have to add /sbin to the maintainer script.
> 
>> runuser: options --{shell,fast,command,session-command,login} and 
>> --user
>> are mutually exclusive .
> 
> Which Roundcube version?  Did you edit the postinst script?  Roundcube
> 1.4.13+dfsg.1-1~deb11u1 from Debian 11 doesn't use runuser(8) in
> maintainer scripts.  As of debian/1.5.1+dfsg-1 from Debian sid the only
> place where we use runuser(8) is as follows

Thanks for the reply, much appreciated!

After sending the above e-mail, I dug into it more with strace
(strace -o log -f dpkg-reconfigure ...).

What was happening is that in the dbconfig
scriptology, a variable called $localuser is passed as to runuser,
unquoted.

The function which calculates bails with a return 1 and an error 
message,
but since that is being captured as a string with $(...) syntax, the 
error
is swept under the rug and $localuser ends up blank.

Then it looks like runuser is being invoked for the user "--", and the
rest of the arguments still belong to runuser:

    /sbin/runuser --user -- rest of args ...

some of rest of args look like conflicting options.

:)


> and I don't see any conflict between runuser(8) options.  You may want
> to ‘set -x’ that postinst to see what the above expands to.

The actual script where that user name is determined is:

   /usr/share/dbconfig-common/internal/pgsql

in _dbc_psql_local_user_name.  That's all postgres specific; nothing
to do with the roundcube package; it's some kind of binding glue
between different databases and some abstract db configuration.
When you dpkg-reconfigure roundcube-core, it interacts with this
stuff for database access.

So from there I sorted out the user name business. There was some
default user name being suggested in the roundcube-core config like
rouncube at local or some funny domain. I changed that to roundcube,
and went into postgres to create a matching user, with password
and so on.

So roundcube is up and running.

I gave up on migrating my old data.   Roundcube can export your
contacts, so that's a big time saver. I had some 25 identities, which
I just entered manually.  My old config was on PG 8; PG 13's psql and
pg_restore programs didn't like any of the dumps I was trying to 
restore.
It would take more time to get working than to re-enter the bit of
remaining data.




More information about the Pkg-roundcube-maintainers mailing list