On Wednesday, December 30, 2015 07:30:49 PM Mick wrote:
> On 29 December 2015 at 17:51, J. Roeleveld <jo...@antarean.org> wrote:
> > On Tuesday, December 29, 2015 04:34:33 PM Mick wrote:
> > > Can you please advise what GRANTS did you use to create a dedicated
> > > postgresql user for akonadi?
> > 
> > Grants?
> 
> Yes, in the sense that the akonadi user will have certain privileges
> granted to be able to create tables, edit them, etc.  I assume your
> commands grant all privileges.

Within that database, yes.

> I did the following:
> > % createuser -P <akonadiuser>
> > (NOTE: You need to set a password, which is why I use the "-P" option)
> > 
> > % createdb -E UTF8 -O <akonadiuser> <akonadidb>
> > 
> > My config for this is:
> > 
> > % cat .config/akonadi/akonadiserverrc
> > [%General]
> > Driver=QPSQL
> > 
> > [QPSQL]
> > Name=<akonadidb>
> > Host=localhost
> > Options=
> > ServerPath=/usr/bin/pg_ctl
> > InitDbPath=/usr/bin/initdb
> > StartServer=false
> > User=<akonadiuser>
> > Password=<akonadipassword>
> > Port=5432
> > 
> > [Debug]
> > Tracer=null
> > 
> > --
> > Joost
> 
> Having been away from postgres for the best part of 7 years now, it is a
> struggle to find my feet again.  As a result I have been chasing my tail on
> this task today, not making much progress.  :-(

I was actually under the impression you had recent experience.
In this case, I would suggest to use the default, eg. let akonadi handle the 
full database.

> Ideally, I'd like to keep any akonadi databases in ~/.local/share/akonadi/
> for simplicity of backups.  I tried creating a symlink from the default
> directory /var/lib/postgresql/9.4/data, but all sort of fs access problems
> ensued when I tried to run 'emerge --config dev-db/postgresql:9.4'.  I
> tried different ownerships and access rights and eventually I abandoned
> this idea just to get things going.  I let pg to install its files in the
> default data directory.

I run postgresql under a different user and use the backup tools of the 
database to generate backup files.
I prefer not to have a full database inside my home directory.

> Then I created a database and user.  The initial user (akonadidbuser) could
> not access the database, so I created a different user the same as my unix
> user (michael):
> 
> $ psql -U postgres -d postgres
> psql (9.4.5)
> Type "help" for help.
> postgres=# \l
>                                        List of databases
>    Name    |     Owner     | Encoding | Collate |    Ctype    |
> Access privileges
> -----------+---------------+----------+---------+-------------+-------------
> -------------------- akonadidb | michael | UTF8     | C       | en_GB.UTF-8
> | =Tc/michael +
> 
> michael=CTc/michael
>  postgres  | postgres      | UTF8     | C       | en_GB.UTF-8 |
>  template0 | postgres      | UTF8     | C       | en_GB.UTF-8 |
> =c/postgres                    +
> 
> postgres=CTc/postgres
>  template1 | postgres      | UTF8     | C       | en_GB.UTF-8 |
> =c/postgres                    +
> 
> postgres=CTc/postgres
> (4 rows)
> 
> 
> However, when I try to start akonadi it fails because michael is not
> allowed to login ...:
> 
> Failed to use database "akonadidb"
> Database error: "FATAL:  role "michael" is not permitted to log in
> QPSQL: Unable to connect"
> Trying to create database now...
> QSqlDatabasePrivate::removeDatabase: connection 'initConnection' is still
> in use, all queries will cease to work.
> Database error: Cannot open database.
> Last driver error: "QPSQL: Unable to connect"
> Last database error: "FATAL:  role "michael" is not permitted to log in
> "
> Unable to open database "FATAL:  role "michael" is not permitted to log in
> QPSQL: Unable to connect"
> 
> 
> So eventually, I setup user 'postgres' in
> ~/.config/akonadi/akonadiserverrc, with no passwd and akonadi was able to
> start.  Can you please help me to configure this correctly, so that the
> database is saved in my ~/.local fs and akonadi can use it?
> 
> This is my akonadiserverrc at the moment:
> 
> [%General]
> Driver=QPSQL
> SizeThreshold=4096
> ExternalPayload=false
> 
> [QPSQL]
> Name=akonadidb
> Host=localhost
> User=postgres
> Password=
> Options=
> ServerPath=/usr/bin/pg_ctl
> InitDbPath=/usr/bin/initdb
> StartServer=false
> Port=5432

Yipes!

Seriously, unless you know what you are doing, let akonadi do it itself.
Stop akonadi, wipe the files, and restart akonadi.

Eg. run de database embedded.

You're making things far more complicated than necessary by trying to change 
settings away from the default this much.

--
Joost

Reply via email to