This is the mail archive of the 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]

cygrunsrv logging OK; patch to --args handling

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       tel: +1.630.879.1312
Principal Consultant       fax: +1.630.879.1370
OntoSys, Inc             38W242 Deerpath Rd, Batavia, IL 60510, USA
RCS file: /home/cvs/cvsroot/src/cygrunsrv/,v
retrieving revision 1.5
diff -u -p -r1.5
---	2001/05/21 19:26:30	1.5
+++	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)
-	if (*c == ' ')
+	if (*c)
 	  *c = '\0';
2001-05-22  Fred Yankowski  <>

	* (eval_arglist): Fix handling of quoted options.

2001-05-21  Corinna Vinschen <>

	* Bump version to 0.93.

2001-05-21  Corinna Vinschen <>

	* (longopts): Add `--stdin', `--stdout' and `--stderr'
	(opts): Add `-0', `-1' and `-2' options.
	(install_registry_keys): Add handling for stdio redirection file names.
	(get_reg_entries): Ditto.
	(service_main): Ditto.
	(get_opt_string_entry): New function.
	(reeval_io_path): Ditto.
	(main): Add handling for stdio redirection options.
	* cygrunsrv.h (PARAM_STDIN): New registry name for stdin redirection
	file name.
	(PARAM_STDOUT): Ditto for stdout.
	(PARAM_STDERR): Ditto for stderr.
	(DEF_STDIN_PATH): New define, default path for stdin redirection.
	(DEF_LOG_PATH): New define, default directory where log files are
	* (reason_list): Add error strings for --std{in,out,err}
	(usage): Add help text for --std{in,out,err}.
	(redirect_fd): New function.
	(redirect_io): Ditto.
	(create_parent_directory): Ditto.
	* utils.h (reason_t): Add codes for --std{in,out,err} errors.
	Add declaration for new functions.

2001-05-21  Corinna Vinschen <>

	* (usage): Change --dep text slightly.

2001-05-21  Fred Yankowski  <>

	* (reason_list): Add error strings for --dep errors.
	(usage): Add help text for --dep.
	* utils.h (reason_t): Add codes for --dep errors.
	* cygrunsrv.h (MAX_DEPS): Number of --dep values allowed.
	(MAX_DEPS_STR): String value of MAX_DEPS.
	* (install_service): Create service with optional
	(add_dep): New function to save --dep command-line value.
	(main): Handle --dep option.
	(longopts): Add '--dep' option.
	(opts): Add 'y' option.

2001-05-21  Corinna Vinschen <>

	* (install_registry_keys): Create environment strings in
	subkey "Environment" now.
	(get_reg_entries): Read environment strings from subkey "Environment"
	(add_env_var): Drop test for illegal environment string names
	"AppPath" and "AppArgs".
	* cygrunsrv.h (PARAM_ENVIRON): New registry name for environment
	string subkey.

2001-05-18  Fred Yankowski  <>

	* (usage): Add help for --termsig option.
	(reason_list):  Add error strings for wrong --termsig usage.
	* (get_reg_entries): Get --termsig value from registry.
	(service_main): Set up global termsig value.
	(terminate_child): Send termsig signal to server process.
	(termsig):  Create new global variable to hold --termsig value.
	(install_registry_keys): Save --termsig value.
	(longopts): Add '--termsig' option.
	(opts): Add 's' option.
	(main): Handle '--termsig' option.
	* cygrunsrv.h (PARAM_TERMSIG): New registry name for --termsig value.
	* utils.h (reason_t): Add codes for '--termsig' errors.

2001-05-11  Corinna Vinschen <>

	* New file. Move several functions from to here.
	* utils.h: Ditto.
	(reason_t): Add error codes for wrong --type usage.
	* (winerror): New function providing strerror functionality for
	Win32 errors.
	(reason_list): Add error strings for wrong --type usage.
	(error): Add windows error message text to error output.
	(syslog_starterr): New function.
	* (longopts): Add `--type' option.
	(opts): Add `t' option.
	(type_t): New type.
	(usage): Add help for `--type' option.
	(install_service): Add parameter for service start type.
	(service_main): Use syslog_starterr function.
	(main): Add handling for `--type' option.
	* Bump version to 0.92.

2001-05-10  Corinna Vinschen <>

	* (get_reg_entries): Fix memory usage.
	* (install_service): Add interactive password request if password
	is omitted.
	* Control access to SERVICE_STATUS by using a critical section.
	Move access functions to new file Declare access functions
	in crit.h.
	* Bump version to 0.91.

2001-05-09  Corinna Vinschen <>

	* Initial version 0.9.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]