Re: pg_ctl behavior on Windows

From: Chapman Flack <chap(at)anastigmatix(dot)net>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_ctl behavior on Windows
Date: 2020-07-18 13:00:57
Message-ID: 5F12F289.3050705@anastigmatix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 07/18/20 05:46, Amit Kapila wrote:
> I don't think so. I think you can use 'pg_ctl start' to achieve that.
> I think the JOBS stuff is primarily required when we use 'register'
> operation (aka runs server via service). For example, if you see one
> of the Job options "JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION", it
> suppresses dialog box for a certain type of errors and causes a
> termination of the process with the exception code as the exit status

Thanks very much, that helps a lot. I still wonder, though, about some
of the other limits also placed on that job object, such as
JOB_OBJECT_SECURITY_NO_ADMIN | JOB_OBJECT_SECURITY_ONLY_TOKEN

Those seem closely related to the purpose of CreateRestrictedProcess.
Does the NOTE! mean that, when not running as a service, the job object
disappears as soon as pg_ctl exits, and does the job object's disappearance
simply mean those limits are no longer enforced for the remaining life
of the process? Or do they remain in effect for the process even after
the job object is reclaimed (and if so, what does the NOTE! really mean)?

I could add that for my current purpose, running a few tests on a CI
virtual host where everything is admin anyway and it all gets wiped
after the test, I don't really care whether those restrictions are
enforced, and in fact the whole "I refuse to start as admin" check seems
a punctilious headache. But for other uses, what that NOTE! means about
those restrictions might matter more, or even be worth mentioning
in the docs.

Regards,
-Chap

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2020-07-18 13:18:11 Re: pg_ctl behavior on Windows
Previous Message vignesh C 2020-07-18 11:23:19 Re: Add header support to text format and matching feature