Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user <gentoo-user@l.g.o>
Subject: Re: [gentoo-user] Kmail2 - I have not given up ... yet
Date: Wed, 30 Dec 2015 19:31:01
Message-Id: CAGOe-eygDa_Kn2pO6p9X5aMiKcc_zYUq4T4RG2PU0zXQR39yOw@mail.gmail.com
In Reply to: Re: [gentoo-user] Kmail2 - I have not given up ... yet by "J. Roeleveld"
1 On 29 December 2015 at 17:51, J. Roeleveld <joost@××××××××.org> wrote:
2
3 > On Tuesday, December 29, 2015 04:34:33 PM Mick wrote:
4 >
5 > > Can you please advise what GRANTS did you use to create a dedicated
6 > > postgresql user for akonadi?
7 >
8 > Grants?
9 >
10
11 Yes, in the sense that the akonadi user will have certain privileges
12 granted to be able to create tables, edit them, etc. I assume your
13 commands grant all privileges.
14
15 I did the following:
16 > % createuser -P <akonadiuser>
17 > (NOTE: You need to set a password, which is why I use the "-P" option)
18 >
19 > % createdb -E UTF8 -O <akonadiuser> <akonadidb>
20 >
21 > My config for this is:
22 >
23 > % cat .config/akonadi/akonadiserverrc
24 > [%General]
25 > Driver=QPSQL
26 >
27 > [QPSQL]
28 > Name=<akonadidb>
29 > Host=localhost
30 > Options=
31 > ServerPath=/usr/bin/pg_ctl
32 > InitDbPath=/usr/bin/initdb
33 > StartServer=false
34 > User=<akonadiuser>
35 > Password=<akonadipassword>
36 > Port=5432
37 >
38 > [Debug]
39 > Tracer=null
40 >
41 > --
42 > Joost
43
44
45 Having been away from postgres for the best part of 7 years now, it is a
46 struggle to find my feet again. As a result I have been chasing my tail on
47 this task today, not making much progress. :-(
48
49 Ideally, I'd like to keep any akonadi databases in ~/.local/share/akonadi/
50 for simplicity of backups. I tried creating a symlink from the default
51 directory /var/lib/postgresql/9.4/data, but all sort of fs access problems
52 ensued when I tried to run 'emerge --config dev-db/postgresql:9.4'. I
53 tried different ownerships and access rights and eventually I abandoned
54 this idea just to get things going. I let pg to install its files in the
55 default data directory.
56
57 Then I created a database and user. The initial user (akonadidbuser) could
58 not access the database, so I created a different user the same as my unix
59 user (michael):
60
61 $ psql -U postgres -d postgres
62 psql (9.4.5)
63 Type "help" for help.
64 postgres=# \l
65 List of databases
66 Name | Owner | Encoding | Collate | Ctype |
67 Access privileges
68 -----------+---------------+----------+---------+-------------+---------------------------------
69 akonadidb | michael | UTF8 | C | en_GB.UTF-8 | =Tc/michael
70 +
71 | | | | |
72 michael=CTc/michael
73 postgres | postgres | UTF8 | C | en_GB.UTF-8 |
74 template0 | postgres | UTF8 | C | en_GB.UTF-8 |
75 =c/postgres +
76 | | | | |
77 postgres=CTc/postgres
78 template1 | postgres | UTF8 | C | en_GB.UTF-8 |
79 =c/postgres +
80 | | | | |
81 postgres=CTc/postgres
82 (4 rows)
83
84
85 However, when I try to start akonadi it fails because michael is not
86 allowed to login ...:
87
88 Failed to use database "akonadidb"
89 Database error: "FATAL: role "michael" is not permitted to log in
90 QPSQL: Unable to connect"
91 Trying to create database now...
92 QSqlDatabasePrivate::removeDatabase: connection 'initConnection' is still
93 in use, all queries will cease to work.
94 Database error: Cannot open database.
95 Last driver error: "QPSQL: Unable to connect"
96 Last database error: "FATAL: role "michael" is not permitted to log in
97 "
98 Unable to open database "FATAL: role "michael" is not permitted to log in
99 QPSQL: Unable to connect"
100
101
102 So eventually, I setup user 'postgres' in
103 ~/.config/akonadi/akonadiserverrc, with no passwd and akonadi was able to
104 start. Can you please help me to configure this correctly, so that the
105 database is saved in my ~/.local fs and akonadi can use it?
106
107 This is my akonadiserverrc at the moment:
108
109 [%General]
110 Driver=QPSQL
111 SizeThreshold=4096
112 ExternalPayload=false
113
114 [QPSQL]
115 Name=akonadidb
116 Host=localhost
117 User=postgres
118 Password=
119 Options=
120 ServerPath=/usr/bin/pg_ctl
121 InitDbPath=/usr/bin/initdb
122 StartServer=false
123 Port=5432
124
125 --
126 Regards,
127 Mick

Replies

Subject Author
Re: [gentoo-user] Kmail2 - I have not given up ... yet "J. Roeleveld" <joost@××××××××.org>