AW: Ububtu 22.04 Server

Stefan Csomor csomor at advancedconcepts.ch
Sun Feb 25 16:15:38 UTC 2024


Good point, yes, the places differ, between versions and between distros, I’ve only checked with PG 16 on Ubuntu 22.04 
So to be sure where to look in case it isn’t there where you think it should be, one idea may be that you check how postgres was launched 

ps aux | grep 'postgres *-D' 

on my machine I get this 

/usr/lib/postgresql/16/bin/postgres -D /var/lib/postgresql/16/main -c config_file=/etc/postgresql/16/main/postgresql.conf 

Indicating the data dir (-D …) and a separate place for the main config file (if this isn’t indicated it will reside inside the datadir), and if you look at this config file 

cat /etc/postgresql/16/main/postgresql.conf 

there after about thirty lines you should find the true location 


(….)
#------------------------------------------------------------------------------ 
# FILE LOCATIONS 
#------------------------------------------------------------------------------ 

# The default values of these variables are driven from the -D command-line 
# option or PGDATA environment variable, represented here as ConfigDir. 

data_directory = '/var/lib/postgresql/16/main' # use data in another directory 
# (change requires restart) 
hba_file = '/etc/postgresql/16/main/pg_hba.conf' # host-based authentication file 

HTH 

Stefan 

Von: omnisdev-en <omnisdev-en-bounces at lists.omnis-dev.com> im Auftrag von Doug Easterbrook via omnisdev-en <omnisdev-en at lists.omnis-dev.com>
Datum: Sonntag, 25. Februar 2024 um 16:41
An: OmnisDev List - English <omnisdev-en at lists.omnis-dev.com>
Cc: Doug Easterbrook <doug at artsman.com>
Betreff: Re: Ububtu 22.04 Server 

I did a little googling and this looks close to what I’m thinking. In this linux install, the pg_hba.conf is in /var rather than /etc. don’t get fooled by that.. replace anything that refers to the full path of the pg_hba.conf with your pathname, since various linux distributions can put stuff in various places.


https://stackoverflow.com/questions/30340417/postgres-service-doesnot-start <https://stackoverflow.com/questions/30340417/postgres-service-doesnot-start>



anyhow, I”m thinking a little chmod here and there to the right permissions will get you further. I just know that permissions on postgres are exact. on the mac, the whole data directory if owned postgres:daemon with permissions rwx——— (700, I think)








Doug Easterbrook
Arts Management Systems Ltd.
mailto:doug at artsman.com <mailto:doug at artsman.com>
http://www.artsman.com <http://www.artsman.com>
Phone (403) 650-1978

> On Feb 25, 2024, at 7:26 AM, Doug Easterbrook via omnisdev-en <omnisdev-en at lists.omnis-dev.com> wrote:
> 
> hi Chris.
> 
> I think the phrase ‘permission denied’ is the clue good clue in
> 
>> "/etc/postgresql/14/main/pg_hba.conf": Permission denied
> 
> 
> 
> it means the postgres server processes cannot read it, and so wont start up.
> 
> 
> 
> 
> 
> Postges typically requires that it run under a non priveledged user id. (at least, its that way on mac and widows). Since mac = unix, the inference is you can’t run postgres as a super user.
> 
> that means ownership and permission to access those files must be correct all along the pathway.
> 
> 
> I’d check that the postgres user (or everyone) has read access to /etc. and within that the appropriate directories and sub directories
> 
> 
> I’ve seen this in the past. On linux, the config directories and database directories are often separated into different place, by convention.
> 
> 
> 
> 
> 
> 
> Doug Easterbrook
> Arts Management Systems Ltd.
> mailto:doug at artsman.com <mailto:doug at artsman.com>
> http://www.artsman.com <http://www.artsman.com>
> Phone (403) 650-1978
> 
>> On Feb 24, 2024, at 3:54 PM, Chris Hughes via omnisdev-en <omnisdev-en at lists.omnis-dev.com> wrote:
>> 
>> Here is the log
>> 
>> 
>> 2024-02-25 09:47:52.508 AEST [3557] @/ LOG: starting PostgreSQL 14.11 (Ubuntu 14.11-1.pgdg22.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit
>> 2024-02-25 09:47:52.508 AEST [3557] @/ LOG: listening on IPv4 address "0.0.0.0", port 5432
>> 2024-02-25 09:47:52.508 AEST [3557] @/ LOG: listening on IPv6 address "::", port 5432
>> 2024-02-25 09:47:52.508 AEST [3557] @/ LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
>> 2024-02-25 09:47:52.513 AEST [3557] @/ LOG: could not open configuration file "/etc/postgresql/14/main/pg_hba.conf": Permission denied
>> 2024-02-25 09:47:52.513 AEST [3557] @/ FATAL: could not load pg_hba.conf
>> 2024-02-25 09:47:52.514 AEST [3557] @/ LOG: database system is shut down
>> pg_ctl: could not start server
>> Examine the log output.
>> 
>> Assume Line 2 is the problem, was working yesterday. Where do I fix.
>> 
>> 
>> -- 
>> *Chris Hughes*
>> Phone No:-07 32086347
>> Mobile No :- 0409 263 349
>> Email :- ataddata at bigpond.net.au
>> Address:-
>> 3 Springwell Avenue
>> Springwood QLD 4127
>> _____________________________________________________________
>> Manage your list subscriptions at https://lists.omnis-dev.com <https://lists.omnis-dev.com>
>> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com <mailto:omnisdev-en at lists.omnis-dev.com>
> 
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com <https://lists.omnis-dev.com>
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com <mailto:omnisdev-en at lists.omnis-dev.com>

_____________________________________________________________
Manage your list subscriptions at https://lists.omnis-dev.com <https://lists.omnis-dev.com>
Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com <mailto:omnisdev-en at lists.omnis-dev.com> 






More information about the omnisdev-en mailing list