Re: pg_ctl behavior on Windows - Mailing list pgsql-hackers

From Chapman Flack
Subject Re: pg_ctl behavior on Windows
Date
Msg-id 5F12F289.3050705@anastigmatix.net
Whole thread Raw
In response to Re: pg_ctl behavior on Windows  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: pg_ctl behavior on Windows  (Amit Kapila <amit.kapila16@gmail.com>)
List 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



pgsql-hackers by date:

Previous
From: vignesh C
Date:
Subject: Re: Add header support to text format and matching feature
Next
From: Andrew Dunstan
Date:
Subject: Re: pg_ctl behavior on Windows