Setting env var CYGWIN for Cygwin service?

Brian Inglis Brian.Inglis@SystematicSw.ab.ca
Thu Dec 31 15:46:51 GMT 2020


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.]


More information about the Cygwin mailing list