The service execution environment

Services on Windows run in a minimal environment. When a service is started, it inherits the environment of the Service Control Manager (normally the system environment) and defines HOME, LOGNAME, and TZ.

The following describes how psxrun.exe assigns values for particular environment variables:

Some system parameters, such as SYSTEMROOT and NUMBER_OF_PROCESSORS, are also available.

Interix daemons have to be installed and executed as services only if they have to run logged on with a Windows account, such as to access network resources. Otherwise, they can be run as conventional daemons using the same mechanism as conventional UNIX systems, by creating shell scripts in the /etc/rc2.d/ directory that directly start and stop the daemons. If you do this, init(1) can start the daemon when the Interix subsystem initializes. For more information, see Understanding services and daemons.