cygrunsrv logging OK; patch to --args handling
Fred Yankowski
fcy@ontosys.com
Tue May 22 09:53:00 GMT 2001
Corinna Vinschen wrote:
> I have added the stdio redirection facility now. It's in CVS.
> Is anybody interested to test it before releasing it?
The --stdin and --stderr options seem to work well for me, and the
default of logging to /var/log/<svc_name>.log also works well.
OT: The code to handle quotes in the --args value didn't work for me
until I applied the attached small patch. I've tested it in a few
cases, but it deserves a careful inspection.
With this change, cygrunsrv does a good job of wrapping a PostgreSQL
service, except for the NT-shutdown case (which I haven't tested yet).
Here is how I'm setting up that service:
/usr/local/src/cygrunsrv-cvs/cygrunsrv.exe --install postmaster2 \
--path /usr/local/pgsql/bin/postmaster \
--args "-D /usr/local/pgsql/data -i -d 2 -o '-o /var/log/postgres.log'"
\
--dep ipc-daemon --termsig INT --user postgresql
I was using --stderr too, but the default works just as well.
--
Fred Yankowski fred@OntoSys.com tel: +1.630.879.1312
Principal Consultant www.OntoSys.com fax: +1.630.879.1370
OntoSys, Inc 38W242 Deerpath Rd, Batavia, IL 60510, USA
Index: cygrunsrv.cc
===================================================================
RCS file: /home/cvs/cvsroot/src/cygrunsrv/cygrunsrv.cc,v
retrieving revision 1.5
diff -u -p -r1.5 cygrunsrv.cc
--- cygrunsrv.cc 2001/05/21 19:26:30 1.5
+++ cygrunsrv.cc 2001/05/22 16:51:41
@@ -424,9 +424,9 @@ eval_arglist (const char *path, char *ar
arglist = tmp;
arglist[count - 2] = c;
arglist[count - 1] = NULL;
- while (*c && *c != ' ')
+ while (*c && *c != stopchar)
++c;
- if (*c == ' ')
+ if (*c)
*c = '\0';
else
--c;
More information about the Cygwin-apps
mailing list