This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: Running a shell script as a service
- From: "Gerrit P. Haase" <gp at familiehaase dot de>
- To: cygwin at cygwin dot com
- Date: Wed, 28 Nov 2001 23:14:36 +0100
- Subject: Re: Running a shell script as a service
- Organization: Esse keine toten Tiere
- References: <019201c17852$271edcf0$2701010a@crosstrust.com>
- Reply-to: "Gerrit P. Haase" <cygwin at cygwin dot com>
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/