Cygwin
Where would I be without Cygwin? The answer to that is "not using Windows".
The only thing better than Cygwin is a true Linux box, which admitadly is where I spend a lot more of my time these days.
This page contains patches, scripts, comments and observations that may be helpful regarding Cygwin that I've put together.
At the time of creating this page, without a Linux machine, Cygwin got most of my attention. Now with a Linux machine, while I still use it both at work and home a lot, I play with it less, hence this page is now updates less frequently.
Some of this may, obviously, also be applicable in Linux or other UN*X's.
Patched Software
The following are packages I've patched and/or built under cygwin.
Please note a few things.
- These are listed FYI. If they don't work, you're on your own.
- Cygwin is required. It's avaliable at www.cygwin.com. No cygwin binaries are stored on this site.
- ONLY cygwin patches are stored here. The original sources are also required and not found on this site.
- I install all non net release applications under /usr/local, NOT /usr. The patches are set up in this way.
Extract source to /tmp Extract patch to files /tmp/<package>/CYGWIN-PATCH % cd /tmp/<package> % patch -p1 < CYGWIN-PATCHES % CYGWIN-PATCHES/build.sh $version $build # (or read CYGWIN-PATCHES/README)
casu-3.3.3
Patch Source:http://test.home/homepage.new/cygwin/casu-3.3.3-1-cygwin-patch.tar.bz2
Patched:
Simple patch to fix cygwin problem with 'install/INSTALL' when '.' is in $PATH, and make to create non existant install directories, rather than assuming they exist (since the /usr/local hirachy doesn't by default in cygwin).
Added:
CYGWIN-PATCHES/casu.patch
CYGWIN-PATCHES/README
Build Notes:
Building is simple - apply the patch, and run build.sh. Or take a look at README and build.sh to make manually. There's very little to go wrong.
Cygwin Notes:
elm-2.5.6
Patch Source:http://test.home/homepage.new/cygwin/casu-3.3.3-1-cygwin-patch.tar.bz2
Patched:
Added:
CYGWIN-PATCHES/casu.patch
CYGWIN-PATCHES/README
Build Notes:
Cygwin Notes:
newmail notes:
- newmail does kill itself when the shell exits, under cygwin. It's written only to check it's parent's pid every interval, so because of how cygwin works, remote shells (ssh, telnet, etc.) will appear to hang (since they don't exit while there is still backgrounded processes running on the tty) for at most interval seconds. It will then correctly exit, and then connection will close. Although newmail could be patched to handle this cygwin quirk easily enough, use pkill -t `tty` ^newmail|NEWMAIL$ in your shell's logout script if you want it to die immediately at logout.
- Redirecting stderr (to supress the interval warning message) causes problems (newmail dies). wnewmail doesn't suffer this problem. My best guess is that it's a cygwin quirk - newmail backgrounding itself then having stderr redirected must make isatty(1) fail. (Having the shell background wnewmail while redirection stderr seems to work).
screen-3.9.10
http://dellelce.com/code/screen/
Patch Source:http://dellelce.com/code/screen/
Cygwin Notes:
screen-3.9.15
In anycase, my patch of screeen 3.9.15 disables detaching (re-attaching doesn't work in cygwin), which prevents accidental usage of the destructive ^A ^d keystroke.
Patch Source:http://dellelce.com/code/screen/
Patched:
Patched .c files simple guard code with __CYGWIN__ to suit cygwin (hence, patched code should compile on other systems). configure.h.in removes DETACH define, adds #ifdef DETACH to some other defines (which code checks, rather than checking DETACH - thus they shouldn't be defined if DETACH isn't).
Added:
CYGWIN-PATCHES/screen.patch
CYGWIN-PATCHES/screen.detach.patch
CYGWIN-PATCHES/README
Build Notes:
To re-enable detaching, first apply screen.patch, then screen.detach.patch. CYGWIN-PATCHES/README has more detailed instructions.
To enable debugging, you have to set OPTIONS=DEBUG in Makefile.in, then configure and make. (Since I'm not sure how to do this with configure).
Cygwin Notes:
Although this patch prevents accidental detaching with ^A ^d, ^A ^z (suspend) still works, leaving you with detached screens you can't get back to.
Scripts
killp.csh
- Process names in cygwin sometimes vary in case, while pkill is case sensative.
This is most likely a FAT vs. NTFS issue - while most process names under Win9x come up as uppercase (and sometimes lowercase), process names under XP (and maybe all NT's) come up as lowercase, as far as I know. The script users a case insensative regex, that will kill both upper and lower case process names. - This is not a cygwin issue, but by design pkill uses a regex pattern for killing processes - as cool as this is, it's annoying when you issue pkill ssh and having your sshd processes killed as well. killp.src passes the -x (match exactly) switch to pkill, so that it only kills process names that match exactly.
Random Comments
Monday, September , 2003 - remote connection from screen / dumb terminal
Saturday, September , 2003 - shutdown patch for win9x
Sunday, September , 2003 - shutdown patch for win9x in net release
Saturday, September , 2003 - cygwin-1.5.4 breaks fetchmail
Tuesday, September , 2003 - pgrep/pkill 01801-2 broken
9:08pm [ord@scholars ~] > /usr/bin/pgrep -t tty1 9:08pm [ord@scholars ~] >Rebuilding it from the source seems to work though. Weird...
9:08pm [ord@scholars ~] > /usr/local/bin/pgrep -t tty1 610175 784355 9:08pm [ord@scholars ~] >
Saturday, October , 2003 - cygwin-1.5.4 breaks fetchmail - fix
Saturday, October , 2003 - run daemons as 'daemon'
C:\cygwin\bin\su.exe -m -f -c "exec /sbin/init.exe -i INT" daemon
- -m preserves the environment. Otherwise sshd (hence ssh sessions) won't get things like $WINDIR, which some of my scripts depend on.
- -f skips the shell startup files for daemon, which contain environment variables I don't want ssh sessions to see.
- -c makes su run init.
- exec is supposed to make /sbin/init run in place of /bin/su (to conserve some resources), though it doesn't seem to work (su remains running).
Oh, and the 2 extra processes that run as a result (su and tcsh) as opposed to running /sbin/init directly. (On a Celeron 333MHz with 64MB RAM, I'm concious of such things.
Sunday, May , 2004 - W3C HTML Validator SGML Parser + cygwin
Switch Styles
About Style Switching.
Tuesday, July , 2003 - Fixed $TERM issues