Re: [Patch]: mkdir -p and network drives

2005-05-19 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Wrong list.  Redirecting.

According to Vance Turner on 5/18/2005 11:06 PM:
 I usually don't write you guys, I follow the thread to see how development
 is going.
 
 Just a note. The ls command is't quite right.
 
  Ls -lRC wil not recursively list the files and directories in verbose mode.
 The l flag seems to be ignored.

Per POSIX,
http://www.opengroup.org/onlinepubs/009695399/utilities/ls.html, -C and -l
are mutually exclusive, and the last one specified wins.  You are right
that the -l flag is ignored in your example, but it is not a bug.

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCjIVH84KuGfSFAYARAs53AJ9yVbtYsTOixPy09xEmMoJnA4InDQCg2XqZ
UVT2dXJWEg5kLgrnZ22cqm4=
=b5ty
-END PGP SIGNATURE-


[patch] several new features for cygrunsrv

2005-05-19 Thread Brian Dessent

(I realize this list is technically only for patches on cygwin, but cygrunsrv is
close enough...)

I've implemented some new features for cygrunsrv that I think might be useful to
people.  Examples follow.

A new command -L / --list can be specified that will list all installed
cygrunsrv services:

$ cygrunsrv --list
apache cron cygserver mailtun sshd 

This is meant to facilitate scripting, e.g. if you wanted to disable all running
Cygwin services you can now do something like:

for S in `cygrunsrv -L`; do cygrunsrv -E $S; done

If a service name contains spaces it will be double-quoted.

The other major change is a new flag -V / --verbose which adds a lot more
output to both the --list and the --query commands.  The output of --query is
also made more sensible, for example the Own Process attribute is pretty much
a given so I moved it into the --verbose mode.

I had in mind a goal to add complete dumping of all information about services
to cygcheck to aid in troubleshooting, and this makes it so that cygcheck can
simply system(cygrunsrv --list --verbose).  Some examples:

$ cygrunsrv -Q sshd
Service : sshd
Display name: ssh daemon
Description : Cygwin: Accepts remote ssh sessions
Current State   : Stopped
Command : /usr/sbin/sshd -D

$ cygrunsrv -Q sshd --verbose
Service : sshd
Display name: ssh daemon
Description : Cygwin: Accepts remote ssh sessions
Current State   : Stopped
Command : /usr/sbin/sshd -D
stdin path  : /dev/null
stdout path : /var/log/sshd.log
stderr path : /var/log/sshd.log
Environment : CYGWIN=ntsec 
Process Type: Own Process
Startup : Manual
Account : LocalSystem

Most every aspect of the service will be listed in verbose mode.  Below you can
see that with both new options you get a wealth of information:

$ cygrunsrv --list --verbose
Service : apache
Description : Cygwin: Apache httpd server
Current State   : Stopped
Command : /usr/sbin/httpd -F
stdin path  : /dev/null
stdout path : /var/log/apache.log
stderr path : /var/log/apache.log
Process Type: Own Process
Startup : Manual
Account : LocalSystem

Service : cron
Display name: cron daemon
Description : Cygwin: Provides scheduled execution of commands
Current State   : Running
Controls Accepted   : Stop
Command : /usr/sbin/cron -D
stdin path  : /dev/null
stdout path : /var/log/cron.log
stderr path : /var/log/cron.log
Process Type: Own Process
Startup : Automatic
Account : LocalSystem

Service : cygserver
Description : Cygwin: helper service for security, semaphores, ipc, etc
Current State   : Running
Controls Accepted   : Stop
Command : /usr/sbin/cygserver
stdin path  : /dev/null
stdout path : /var/log/cygserver.log
stderr path : /var/log/cygserver.log
Process Type: Own Process
Startup : Automatic
Account : LocalSystem

Service : mailtun
Description : Cygwin: SSH tunnel for dessent.net POP3 and SMTP services
Current State   : Running
Controls Accepted   : Stop, Shutdown
Command : /bin/autossh.exe -M 29038 -N -L 25:localhost:25 -L
110:localhost:110 -l tunnel dessent.net
stdin path  : /dev/null
stdout path : /var/log/mailtun.log
stderr path : /var/log/mailtun.log
Special flags   : --shutdown 
Process Type: Own Process
Startup : Automatic
Dependencies: Tcpip, cygserver, named
Account : .\brian

Service : sshd
Display name: ssh daemon
Description : Cygwin: Accepts remote ssh sessions
Current State   : Stopped
Command : /usr/sbin/sshd -D
stdin path  : /dev/null
stdout path : /var/log/sshd.log
stderr path : /var/log/sshd.log
Environment : CYGWIN=ntsec 
Process Type: Own Process
Startup : Manual
Account : LocalSystem


As you can see, if we simply add this to cygcheck we can now diagnose problems
with services much quicker since nearly every bit of information is displayed. 
It also makes it easier if you want to modify some aspect of a service that is
currently installed, because --verbose mode essentially gives you a blueprint of
all the options that were used installing the service.  In fact that was one of
the additional things I had planned on doing but didn't make it into this patch:
A command that says tell me what command I would use to install service X. 
That way if you wanted to modify any aspect of the service the pain of
uninstalling and reinstalling is gone, especially if you no longer remember the
options you used when creating the service.

I apologise if the patch is a little large, 

Re: [patch] several new features for cygrunsrv

2005-05-19 Thread Brian Dessent
Brian Dessent wrote:

 -controlsToString(DWORD controls)
 +  char *base, *end;
 +  static char buf[34];
 +  int used = 0, dsiz = strlen (delim);

Crap, that is a mistake.  buf[34] should be something more generous like
128 or 256.  I had it set small to test to make sure it couldn't
overflow and forgot to put it back.

Brian