This is the mail archive of the cygwin@cygwin.com 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: Running a shell script as a service


Hallo Daniel,

Am 2001-11-28 um 22:17 schriebst du:

> OK, this part works ok:
> cygrunsrv --install KSEZip --path /home/user/test.sh

> but starting the service gives me a dialog box:
> "Could not start the KSEZip service on \\KILO.
> Error 2140: An internal Windows NT error occurred."

> The application event log contains:
> "The description for Event ID (0) in Source (KSEZip) could not be found. It
> contains the following insertion string(s)" KSEZip: Win32 process Id =
> 0x195: Cygwin Process Id = 0x195: 'KSEZip' service stopped."

Is it a daemon?  If the script terminates itself it cannot run as service.
I tried with a terminating perl script, it is executed but after exiting I
get exactly this error.

And I suggest better call bash with the script as argument:

$ cygrunsrv -I cygtest -d "Cygwin test" -p /bin/perl.exe -a /test.pl

Start the service (two tests):

$ cat /var/log/cygtest.log
Test.
Test.

$ cat test.pl
#!/usr/bin/perl

print "Test.\n";

$ delsrv cygtest
The command completed successfully.

Ciao,

Gerrit P. Haase                            mailto:gp@familiehaase.de
-- 
=^..^=


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.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]