1 |
On Wednesday, December 30, 2015 07:30:49 PM Mick wrote: |
2 |
> On 29 December 2015 at 17:51, J. Roeleveld <joost@××××××××.org> wrote: |
3 |
> > On Tuesday, December 29, 2015 04:34:33 PM Mick wrote: |
4 |
> > > Can you please advise what GRANTS did you use to create a dedicated |
5 |
> > > postgresql user for akonadi? |
6 |
> > |
7 |
> > Grants? |
8 |
> |
9 |
> Yes, in the sense that the akonadi user will have certain privileges |
10 |
> granted to be able to create tables, edit them, etc. I assume your |
11 |
> commands grant all privileges. |
12 |
|
13 |
Within that database, yes. |
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 |
> Having been away from postgres for the best part of 7 years now, it is a |
45 |
> struggle to find my feet again. As a result I have been chasing my tail on |
46 |
> this task today, not making much progress. :-( |
47 |
|
48 |
I was actually under the impression you had recent experience. |
49 |
In this case, I would suggest to use the default, eg. let akonadi handle the |
50 |
full database. |
51 |
|
52 |
> Ideally, I'd like to keep any akonadi databases in ~/.local/share/akonadi/ |
53 |
> for simplicity of backups. I tried creating a symlink from the default |
54 |
> directory /var/lib/postgresql/9.4/data, but all sort of fs access problems |
55 |
> ensued when I tried to run 'emerge --config dev-db/postgresql:9.4'. I |
56 |
> tried different ownerships and access rights and eventually I abandoned |
57 |
> this idea just to get things going. I let pg to install its files in the |
58 |
> default data directory. |
59 |
|
60 |
I run postgresql under a different user and use the backup tools of the |
61 |
database to generate backup files. |
62 |
I prefer not to have a full database inside my home directory. |
63 |
|
64 |
> Then I created a database and user. The initial user (akonadidbuser) could |
65 |
> not access the database, so I created a different user the same as my unix |
66 |
> user (michael): |
67 |
> |
68 |
> $ psql -U postgres -d postgres |
69 |
> psql (9.4.5) |
70 |
> Type "help" for help. |
71 |
> postgres=# \l |
72 |
> List of databases |
73 |
> Name | Owner | Encoding | Collate | Ctype | |
74 |
> Access privileges |
75 |
> -----------+---------------+----------+---------+-------------+------------- |
76 |
> -------------------- akonadidb | michael | UTF8 | C | en_GB.UTF-8 |
77 |
> | =Tc/michael + |
78 |
> |
79 |
> michael=CTc/michael |
80 |
> postgres | postgres | UTF8 | C | en_GB.UTF-8 | |
81 |
> template0 | postgres | UTF8 | C | en_GB.UTF-8 | |
82 |
> =c/postgres + |
83 |
> |
84 |
> postgres=CTc/postgres |
85 |
> template1 | postgres | UTF8 | C | en_GB.UTF-8 | |
86 |
> =c/postgres + |
87 |
> |
88 |
> postgres=CTc/postgres |
89 |
> (4 rows) |
90 |
> |
91 |
> |
92 |
> However, when I try to start akonadi it fails because michael is not |
93 |
> allowed to login ...: |
94 |
> |
95 |
> Failed to use database "akonadidb" |
96 |
> Database error: "FATAL: role "michael" is not permitted to log in |
97 |
> QPSQL: Unable to connect" |
98 |
> Trying to create database now... |
99 |
> QSqlDatabasePrivate::removeDatabase: connection 'initConnection' is still |
100 |
> in use, all queries will cease to work. |
101 |
> Database error: Cannot open database. |
102 |
> Last driver error: "QPSQL: Unable to connect" |
103 |
> Last database error: "FATAL: role "michael" is not permitted to log in |
104 |
> " |
105 |
> Unable to open database "FATAL: role "michael" is not permitted to log in |
106 |
> QPSQL: Unable to connect" |
107 |
> |
108 |
> |
109 |
> So eventually, I setup user 'postgres' in |
110 |
> ~/.config/akonadi/akonadiserverrc, with no passwd and akonadi was able to |
111 |
> start. Can you please help me to configure this correctly, so that the |
112 |
> database is saved in my ~/.local fs and akonadi can use it? |
113 |
> |
114 |
> This is my akonadiserverrc at the moment: |
115 |
> |
116 |
> [%General] |
117 |
> Driver=QPSQL |
118 |
> SizeThreshold=4096 |
119 |
> ExternalPayload=false |
120 |
> |
121 |
> [QPSQL] |
122 |
> Name=akonadidb |
123 |
> Host=localhost |
124 |
> User=postgres |
125 |
> Password= |
126 |
> Options= |
127 |
> ServerPath=/usr/bin/pg_ctl |
128 |
> InitDbPath=/usr/bin/initdb |
129 |
> StartServer=false |
130 |
> Port=5432 |
131 |
|
132 |
Yipes! |
133 |
|
134 |
Seriously, unless you know what you are doing, let akonadi do it itself. |
135 |
Stop akonadi, wipe the files, and restart akonadi. |
136 |
|
137 |
Eg. run de database embedded. |
138 |
|
139 |
You're making things far more complicated than necessary by trying to change |
140 |
settings away from the default this much. |
141 |
|
142 |
-- |
143 |
Joost |