delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/03/04/19:49:45

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Thu, 4 Mar 2004 19:49:12 -0500 (EST)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Peter Wisnovsky <peter AT wisnovsky DOT net>
cc: cygwin AT cygwin DOT com
Subject: Re: fetchmail password from cygrunsrv [Attn: Corinna]
In-Reply-To: <006001c40232$468ea3b0$ac050b0a@PWISNOVSKY>
Message-ID: <Pine.GSO.4.56.0403041913200.11159@slinky.cs.nyu.edu>
References: <002a01c4021e$a0b509b0$ac050b0a AT PWISNOVSKY> <Pine DOT GSO DOT 4 DOT 56 DOT 0403041504330 DOT 25200 AT slinky DOT cs DOT nyu DOT edu> <006001c40232$468ea3b0$ac050b0a AT PWISNOVSKY>
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 2.39

On Thu, 4 Mar 2004, Peter Wisnovsky wrote:

> > Look carefully at the cygrunsrv help output, in particular, the
> > --interactive and --type options.  I think the combination of those with
> > the --user option might get you what you want.  It might be harder to get
> > rid of the command window once fetchmail gets the password, though...
>
> Thanks, but I tried that and got an error setting up the service
>
> ~% cygrunsrv --install fetchmail --path /usr/bin/fetchmail --args "--daemon 300 --nodetach" --env HOME=/home/user--termsig TERM --user domain\user --shutdown --type manual --interactive
> Enter password of user `domain\user:
> Reenter, please:
> cygrunsrv: Error installing a service: CreateService:  Win32 error 87: The parameter is incorrect.
>
> I think this relates to the fact that only services logging in with the
> local system account can be configured to interact with the desktop...so it
> appears that the --user and --interactive flags are exclusive.
>
> Peter

Peter,

Whoops, you're quite right (confirmed on MSDN).  We should actually catch
that in cygrunsrv and print out an appropriate error message.  Corinna,
should I prepare a patch, or do I need a copyright assignment for
cygrunsrv?

Hmm, perhaps something along the following lines will work instead:

cygrunsrv --install fetchmail --path /usr/bin/su.exe --args "-p -c '/usr/bin/fetchmail --daemon 300 --nodetach </dev/conin 2>/dev/conout' domain\\user" --env HOME=/home/user --termsig TERM --shutdown --type manual --interactive

The above assumes that fetchmail prints the password prompt to stderr, and
the rest of the messages to stdout.  FWIW, I've tested this using a bash
script that used "read" to read a value...  And before people ask: yes,
you really *can* use "su" from a system-owned process.

Hope this helps,
	Igor
P.S. Corinna, there's a bunch of typos in the cygrunsrv messages as well
("neverexists" instead of "neverexits").
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019