X-Recipient: archive-cygwin@delorie.com
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4DC18385800A
Authentication-Results: sourceware.org; dmarc=none (p=none dis=none)
 header.from=SystematicSw.ab.ca
Authentication-Results: sourceware.org;
 spf=none smtp.mailfrom=brian.inglis@systematicsw.ab.ca
X-Authority-Analysis: v=2.4 cv=NYRYa0P4 c=1 sm=1 tr=0 ts=5fedf26d
 a=kiZT5GMN3KAWqtYcXc+/4Q==:117 a=kiZT5GMN3KAWqtYcXc+/4Q==:17
 a=IkcTkHD0fZMA:10 a=94nOnFI1EgyDtX4ev68A:9 a=QEXdDO2ut3YA:10
Subject: Re: Setting env var CYGWIN for Cygwin service?
To: cygwin@cygwin.com
References: <vriuwnwznjj7.fsf@gavenkoa.example.com>
 <CANV9t=S_nuHHOszBa3Q0-VEcGmxVO0VBL0rystJ3fL4ivDP6=A@mail.gmail.com>
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
Organization: Systematic Software
Message-ID: <4675947b-6fed-621f-8818-b9467d28114a@SystematicSw.ab.ca>
Date: Thu, 31 Dec 2020 08:46:51 -0700
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
 Thunderbird/78.6.0
MIME-Version: 1.0
In-Reply-To: <CANV9t=S_nuHHOszBa3Q0-VEcGmxVO0VBL0rystJ3fL4ivDP6=A@mail.gmail.com>
Content-Language: en-CA
X-CMAE-Envelope: MS4xfAjZ8PXwWqpnaJVSQ3S6tVPHdr6WlpWq0BuIu4OA6Rp2nS3m+vU+AqsvEblSQSCGTSKxPZccr+r4ft/0VjSJYSc+waA3YSc+BUrOAHoCjLjow86MOVK6
 t2QqK/SSs+X+t//mKkq0YhQmFPPDsDvlkRZY/T4fmf9amiumE532w/3dHMDSy48AL/k2PqyXc6pcPa4rdW+EfM9Rh1c/S4Ri+ic=
X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
 KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4,
 RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE,
 TXREP autolearn=ham autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
Reply-To: cygwin@cygwin.com
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: cygwin-bounces@cygwin.com
Sender: "Cygwin" <cygwin-bounces@cygwin.com>

On 2020-12-31 08:04, Bill Stewart wrote:
> On Wed, Dec 30, 2020 at 1:09 PM Oleksandr Gavenko wrote:
>> What way can I pass env var "CYGWIN" to the Cygwin service?
> cygrunsrv --help shows this:
> -e, --env <VAR=VALUE>    Optional environment strings which are added
> to the environment when service is started. You can add up to 255
> environment strings using the `--env' option.
> These are added as REG_SZ values in
> HKLM\SYSTEM\CurrentControlSet\Services\<servicename>\Parameters\Environment
> registry subkey.

The HKLM/System env vars are where I would expect to add env vars to be used by 
all services or any particular service.
For visibility, I would make them global HKLM/System env vars, or load them from 
/etc/config files.

The HKCU/HKU env vars are only used by processes running under a user login.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
