cygrunsrv: error while starting PRNGD service
Rich Chase
rac47.02@engr.colostate.edu
Thu Jun 15 05:37:00 GMT 2006
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/
More information about the Cygwin
mailing list