This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Newbie: cygrunsrv using strange PATH variable


On Fri, 27 Aug 2004, Alder wrote:

> After removing a previous Cygwin installation from my system and
> reinstalling from the harddrive using Setup, running cygrunsrv from any
> account (administrator or user) produces a Windows dialog reporting that
> the DLL cannot be found in the path:
>
> 	D:\cygwin\usr\sbin;.;<Windows system folders>;.
>
> I'm pretty sure I have my bash startup files in the same state as in my
> previous installation, but here are the relevant bits from these files
> to show how the PATH variable is created:
>
> [/etc/profile]
> PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:$PATH:."
>
> [~/.bash_profile]
> PATH="~/bin:${PATH}"
>
> [~/.bashrc]
> <empty>
>
> If I echo the PATH variable when I first log in with rxvt, it shows:
>
> $ echo $PATH
> /usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/cygdrive/c/WINNT/system32:/cygdrive/c/WINNT:/cygdrive/c/WINNT/System32/Wbem:/cygdrive/c/Program Files/ATI Technologies/ATI Control Panel:/cygdrive/d/Program Files/Common Files/GTK/2.0/bin:.
>
> My question is, then, where is cygrunsrv pulling its PATH information
> from and how do I get it to recognize the environment of the shell its
> run in?

There are two separate problems here.  One is a misconception that the
same PATH you get from your bash startup files will be available to the
services -- that is most certainly not true.  The services executed via
cygrunsrv are invoked directly, with the PATH supposedly inherited from
the Windows system environment.

The second problem, the one I intend to investigate further, is that the
environment doesn't seem to make it through to the subprocesses spawned by
the services (perhaps the solution is as easy as adding "export" to the
CYGWIN variable, but I'll need to experiment).  In other words, on my new
system the default sshd installation didn't work OOTB, and I needed to add
a '-e PATH="/usr/bin:/bin:$PATH"' to the sshd definition.  I'll get back
to the list with the results, whenever I have them.  Not attaching the
cygcheck output because I want to investigate this myself for a bit before
bothering the list with it.

HTH,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Happiness lies in being privileged to work hard for long hours in doing
whatever you think is worth doing."  -- Dr. Jubal Harshaw

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]