delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/06/15/01:28:07

X-Spam-Check-By: sourceware.org
Message-ID: <4490EE7A.9060408@engr.colostate.edu>
Date: Wed, 14 Jun 2006 22:22:02 -0700
From: Rich Chase <rac47 DOT 02 AT engr DOT colostate DOT edu>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: cygrunsrv: error while starting PRNGD service
References: <448FA458 DOT 8060500 AT engr DOT colostate DOT edu> <Pine DOT GSO DOT 4 DOT 63 DOT 0606141102290 DOT 20913 AT access1 DOT cims DOT nyu DOT edu>
In-Reply-To: <Pine.GSO.4.63.0606141102290.20913@access1.cims.nyu.edu>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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

Igor Peshansky wrote:

>On Tue, 13 Jun 2006, Rich Chase wrote:
>
>  
>
>>I compiled PRNGD against cygwin and installed it as a cygrunsrv service.
>>
>>When I try to start the service, I get the infamous:
>>
>>"Could not start the PRNGD service on Local Computer. The service did
>>not return an error.  This could be an internal Windows error or an
>>internal service error. If the problem persists, contact your system
>>administrator."
>>    
>>
>
>This message is usually an indication that you are trying to run a
>daemon-type program (one that forks off the actual daemon and returns)
>with cygrunsrv.  The whole intent of cygrunsrv is to take a program that
>needs to run continuously in the foreground, and turn it into a daemon.
>
>  
>
>>However, I am running sshd as a service, and vnc as well -- both using
>>cygrunsrv.
>>    
>>
>
>Notice that you needed to give the -D option to sshd to prevent it from
>going into the daemon mode.
>
>  
>
>>I also am able to run prngd.exe manually without any errors or log
>>output. It successfully generates random numbers, as verified by the egd
>>testing perl script, and it does not terminate prematurely.
>>    
>>
>
>Ah, but does it run from the SYSTEM account?
>
>  
>
>>PRNGD does start an "entropy gatherer" program, which returns and
>>terminates. Could this child process's termination and return value be
>>causing cygrunsrv to 'think' that prngd.exe runs and then terminates? If
>>it did, would prngd.exe still be running (it isn't)?
>>    
>>
>
>Not likely.
>
>  
>
>>Everything seems to run fine, but doesn't start as a service.
>>Suggestions Please?
>>    
>>
>
>You have two options here: find out if there is a way to run PRNGD in
>non-daemon mode (via a command-line option, for example), or read about
>the --pidfile option to cygrunsrv.
>
>Dave may also be correct that this is a permission issue -- try starting a
>"SYSTEM-owned bash shell" (Google for it), and see if the program works
>from there.
>HTH,
>	Igor
>  
>
Solved. Thanks to both Igor and Dave. As it turns out, I needed both 
pieces of advice -- my problem
was a combination of both!

Igor, you were dead on. I needed to tell prngd to create a pid file, and 
tell cygrunsrv where to put it:

#> cygrunsrv -I PRNGD -p /usr/sbin/prngd.exe -d PRNGD -f "Pseudo-random 
Number Generator" \
                    -a "-p /var/run/prngd.pid -s /etc/prngd-seed 
/var/run/egd-pool" -o -x /var/run/prngd.pid

Also, by looking at my errors in the event log, I saw: "failed: 
redirect_fd: open (1, /var/log/PRNGD.log): \
                    13, Permission denied.

 >From this I discovered that I had a left-over PRNGD.log file (windows 
doesn't recognize the case difference)
that did not have SYSTEM write permissions.

After fixing these two problems, prngd starts as a system service 
without a hitch.

Thank you both.
Rich

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