Setting env var CYGWIN for Cygwin service?
Oleksandr Gavenko
gavenkoa@gmail.com
Thu Dec 31 15:20:03 GMT 2020
On 2020-12-31, Franz Fehringer via Cygwin wrote:
> Cygwin inherits Windows environment variables, this should be the simplest take.
Normally does, no doubt.
So I made `srv.c`:
#include <unistd.h>
int main() {
sleep(60);
}
compiled:
gcc -o srv.exe srv.c
registered:
cygrunsrv -I mysrv -t manual -p $PWD/srv.exe -c $PWD -e MY=hello -d "My Srv" -f "Testing Cyg Service"
$ cygrunsrv -L
exim
mysrv
launched:
cygrunsrv --start mysrv
Finally checked with Process Explorer:
* corresponding `cygrunsrv` had many env vars
* my `srv.exe` had only:
> PATH
> SYSTEMDRIVE
> SYSTEMROOT
> WINDIR
Same was for exim as I wrote earlier. `cygrunsrv` has everything, `exim` only
4 env vars.
uname -r
3.1.7(0.340/5/3)
--
http://defun.work/
More information about the Cygwin
mailing list