pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedhow to properly start postgresql with no TCP listeners in ubuntu 16.04 LTS
4+ messages / 3 participants
[nested] [flat]
* how to properly start postgresql with no TCP listeners in ubuntu 16.04 LTS
@ 2019-01-24 02:08 Alex Morris <alex.morris@twelvemountain.com>
2019-01-24 02:15 ` Re: how to properly start postgresql with no TCP listeners in ubuntu 16.04 LTS Stephen Frost <sfrost@snowman.net>
0 siblings, 1 reply; 4+ messages in thread
From: Alex Morris @ 2019-01-24 02:08 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
Greetings,
This question may simply be my ignorance of what piece of the systemd /
systemctl puzzle needs attention. Any clues are appreciated.
Using postgreSQL version 9.5 as obtained from ubuntu repo. Install was
fine. initdb and subsequent database use is fine.
Nothing is out of the ordinary except me being able to alter how
postgres starts on boot (eg how postgres is called by init scripts or
systemd ).
I wish to start postgres on boot with no TCP listeners, only unix-domain
sockets.
I can achieve this goal by executing the following command as postgres
user in a normal terminal session;
postgres -D /space/postgres -h '' -c listen_addresses=''
Starting the database in this manner results in stdout and stderr from
postgres to show up in the terminal and not the default log file, but I
can fix that. Stopping the database cleanly when started in the above
manner requires user postgres to give 'pg_ctl stop' command in another
terminal. Of course I can press ctrl-C in the terminal it was started
from, and it dies..
I can also achieve the no TCP socket goal using a pg_ctl command, as
postgres in a terminal;
pg_ctl start -D /space/postgres -o '-h "" -c listen_addresses=""'
where in the pg_ctl command, the single quotes protect the double
quotes, which are placeholders for the empty parameter values needing to
be passed to the actual postgres command..
I thought I could edit the postgresql.service / postgresql@.service
files and use the systemctl method. I have not yet discovered a way to
pass the needed options and empty quotes, or any "special character"
(special as seen by systemd I guess when reading in postgresql*.service
files..) into the startup process. Postgres will start but it's the
default install values, and not my needed command line.
Seems like there ought to be a way to do what I need. I just haven't
found it yet. Suggestions on what systemctl magic fruits or other
system startup tool needs attention are most welcome.
Thanks in advance,
alex
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: how to properly start postgresql with no TCP listeners in ubuntu 16.04 LTS
2019-01-24 02:08 how to properly start postgresql with no TCP listeners in ubuntu 16.04 LTS Alex Morris <alex.morris@twelvemountain.com>
@ 2019-01-24 02:15 ` Stephen Frost <sfrost@snowman.net>
2019-01-24 02:41 ` Re: how to properly start postgresql with no TCP listeners in ubuntu 16.04 LTS Alex Morris <alex.morris@twelvemountain.com>
0 siblings, 1 reply; 4+ messages in thread
From: Stephen Frost @ 2019-01-24 02:15 UTC (permalink / raw)
To: Alex Morris <alex.morris@twelvemountain.com>; +Cc: pgsql-general@lists.postgresql.org
Greetings,
* Alex Morris (alex.morris@twelvemountain.com) wrote:
> This question may simply be my ignorance of what piece of the systemd /
> systemctl puzzle needs attention. Any clues are appreciated.
The simplest approach is to just modify the postgresql.conf file in
/etc/postgresql/9.5/main to update listen_addresses to be ''.
Thanks!
Stephen
Attachments:
signature.asc (application/pgp-signature, 818B) download
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: how to properly start postgresql with no TCP listeners in ubuntu 16.04 LTS
2019-01-24 02:08 how to properly start postgresql with no TCP listeners in ubuntu 16.04 LTS Alex Morris <alex.morris@twelvemountain.com>
2019-01-24 02:15 ` Re: how to properly start postgresql with no TCP listeners in ubuntu 16.04 LTS Stephen Frost <sfrost@snowman.net>
@ 2019-01-24 02:41 ` Alex Morris <alex.morris@twelvemountain.com>
2019-01-24 07:06 ` Re: how to properly start postgresql with no TCP listeners in ubuntu 16.04 LTS Ron <ronljohnsonjr@gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Alex Morris @ 2019-01-24 02:41 UTC (permalink / raw)
To: Stephen Frost <sfrost@snowman.net>; +Cc: pgsql-general@lists.postgresql.org
On 1/23/19 19:15, Stephen Frost wrote:
> Greetings,
>
> * Alex Morris (alex.morris@twelvemountain.com) wrote:
>> This question may simply be my ignorance of what piece of the systemd /
>> systemctl puzzle needs attention. Any clues are appreciated.
>
> The simplest approach is to just modify the postgresql.conf file in
> /etc/postgresql/9.5/main to update listen_addresses to be ''.
>
> Thanks!
>
> Stephen
>
Thanks for the fast reply. I had tried that earlier with no luck. But
it's working properly now. I must have misspelled listener_addresses or
used incorrect quote marks. My issue is resolved. Joy!
Thanks very much, Stephen!
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: how to properly start postgresql with no TCP listeners in ubuntu 16.04 LTS
2019-01-24 02:08 how to properly start postgresql with no TCP listeners in ubuntu 16.04 LTS Alex Morris <alex.morris@twelvemountain.com>
2019-01-24 02:15 ` Re: how to properly start postgresql with no TCP listeners in ubuntu 16.04 LTS Stephen Frost <sfrost@snowman.net>
2019-01-24 02:41 ` Re: how to properly start postgresql with no TCP listeners in ubuntu 16.04 LTS Alex Morris <alex.morris@twelvemountain.com>
@ 2019-01-24 07:06 ` Ron <ronljohnsonjr@gmail.com>
0 siblings, 0 replies; 4+ messages in thread
From: Ron @ 2019-01-24 07:06 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
On 1/23/19 8:41 PM, Alex Morris wrote:
> On 1/23/19 19:15, Stephen Frost wrote:
>> Greetings,
>>
>> * Alex Morris (alex.morris@twelvemountain.com) wrote:
>>> This question may simply be my ignorance of what piece of the systemd /
>>> systemctl puzzle needs attention. Any clues are appreciated.
>>
>> The simplest approach is to just modify the postgresql.conf file in
>> /etc/postgresql/9.5/main to update listen_addresses to be ''.
>>
>> Thanks!
>>
>> Stephen
>>
>
> Thanks for the fast reply. I had tried that earlier with no luck. But
> it's working properly now. I must have misspelled listener_addresses or
> used incorrect quote marks. My issue is resolved. Joy!
Note that Postgres has a repository for Ubuntu. From there, you can install
9.6, 10 and 11.
https://www.postgresql.org/download/linux/ubuntu/
--
Angular momentum makes the world go 'round.
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2019-01-24 07:06 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-01-24 02:08 how to properly start postgresql with no TCP listeners in ubuntu 16.04 LTS Alex Morris <alex.morris@twelvemountain.com>
2019-01-24 02:15 ` Stephen Frost <sfrost@snowman.net>
2019-01-24 02:41 ` Alex Morris <alex.morris@twelvemountain.com>
2019-01-24 07:06 ` Ron <ronljohnsonjr@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox