Cygwin in a Production Environment? 111
not-so-anonymous Anonymous Coward asks: "I'm working for a company that does all of its programming and script development in a Unix environment (90% of our work is either Bash or Perl scripts that communicate with an Oracle database). We've recently gotten a new customer and for reasons beyond our control, the server must be a Windows box. Since we want to reuse our existing scripts that we've spent a considerable amount of time developing, we're looking into Cygwin as an option. Has anyone run Cygwin in a production server environment for any extended period of time? If so, what were your experiences with it?"
using cygwin to run RSYNC (Score:3, Informative)
Re:using cygwin to run RSYNC (Score:2, Informative)
Cygwin will do much more, though - apache, postgresql(probably mysql too, but I haven't seen it), etc. - almost any unix app you can get the source for, you can compile(and use) in Cygwin.
I keep getting in jobs that require the use of windows. I'm a unix guy. I retain my sanity by doing everything in cygwin. I'm wasting an exceed license right now because while they can require that I have it
My thoughts on Cygwin (and ActiveState Perl) (Score:2)
It's pretty stable, but I don't know if I'd trust it for mission-critical work. Again, I don't trust Windoze for mission-critical work, either.
The fact that Cygwin usually runs as an app on top of Windoze and that it usually likes to run in a console window on top o
PostgreSQL on cygwin (Score:5, Informative)
cygwin is a really nice emulation layer, but it is an emulation layer and is not 24x7 ready. The timekeeping and IPC mechnisms aren't fully reliable for production-ready use, IMHO. It is amazing for what it does.
We've been running several production PostgreSQL-on-cygwin servers and have been experiencing random corruption and poor timekeeping. There's a bug (hopefully fixed now) in cygwin timekeeping that causes a rollover after 49 days of uptime. PostgreSQL on cygwin also experiences odd table and index corruption problems that I've never seen with it on Linux/FreeBSD.
We're cutting to Oracle for business reasons, or we'd switch to the newly free Win32 PostgreSQL ASAP.
Have you considered MS' Services for Unix? We've not used it, but I'd be interested in hearing about how well it works.
- Barrie
Re:haha... (Score:1)
But that was Win98, surely they are non running a DB server on Win98.
Re:PostgreSQL on cygwin (Score:2)
Why not run PostgreSQL on UNIX? Even buying new machines from a UNIX vendor (Apple, Dell, etc.) has to be cheaper than Oracle licenses.
The 49-day limit. (Score:2)
This is the same bug that occurs in native Windows 95, I believe. I think it's fixed in newer Cygwin DLLs.
Re:The 49-day limit. (Score:2)
--
New deal processing engine online: http://www.dealsites.net/livedeals.html [dealsites.net]
Support and Open Source (Score:1)
Re:The 49-day limit. (Score:2)
http://www.metatrontech.com
Re:The 49-day limit. (Score:2)
What are you doing with it? (Score:4, Informative)
At least, in my experience. I use it for development and it makes my life livable.
Re:What are you doing with it? (Score:4, Informative)
If the Windows environment becomes that much of a problem (and don't forget to try, as another poster suggested, things like Services For Unix (SFU)), set up a demo of the two things side by side to show the customer just how much more efficent running it on the Unix of your choice is than making it run on Windows. That might convince them if it comes to that.
Speaking of which, I would love to know WHY the client has to have Windows. Maybe there is something there that you can deal with that you don't realize.
Re:What are you doing with it? (Score:4, Insightful)
I'm not the original questioner, but may be able to give one plausible reason. Many slashdotters seem to have trouble grappling with this idea (Why can't your client just run Linux?). Typically a given client has existing infrastructure and admins. If they have lotsa Windows guys, they'll want a Windows box so they can admin it when you're done.
I work aa a consultant, and many clients will request an operating system that matches their existing systems. Unless you can really convince them otherwise, they'll look elsewhere if you don't come up with a solution on their platform.
Re:What are you doing with it? (Score:2)
Re:What are you doing with it? (Score:2)
Re:What are you doing with it? (Score:2)
Large business systems (database, web server, lotsa business logic) need maintenance. DBA's to tune the database, backup old data, etc; admins to monitor the system, run jobs, monitor logs to determine that jobs are running properly, etc.
Often a client will want a developer or two to fix minor bugs that may arise over time, or to make minor modifications
Re:What are you doing with it? (Score:2)
A database shouldn't depend on your environment, and is likely running on Oracle or DB2. (If it's running on Postgres, they're in trouble anyway.) The DBA is business as usual.
When modifications are made to the system (that's what the maintenance contract is for!) a developer is likely going to be on-site and making the change. If not, they should have an upgrade process that is as simple as "runme."
Re:What are you doing with it? (Score:2)
Perhaps my company is different. At some point we turn the system over to the client (if they want it), and leave. At that point their IT department (if they have one) takes over day-to-day maintenance and operating of the system, monitoring batch jobs, etc. For clients without an in-house IT department, we will maintain the system for a cost...
Re:What are you doing with it? (Score:2)
as for windows-only shops, it doesn't make sense to have *one* unix box, and have to get training for *one* application.
I don't think windows is a superior server operating system, but there are instances (small businesses in particular) where it can be more cost effective.
Re:What are you doing with it? (Score:2)
Re:What are you doing with it? (Score:3, Informative)
UNIX is designed in such a way that process creation is very cheap, therefore lots of UNIX programs use fork to achieve parallelism. OTOH, Windows is designed around the threading model, so no particular attention has been made to make process creation similarly cheap.
More info at this link [robelle.com] and this one [geeksalad.org].
--
Re:What are you doing with it? (Score:3, Interesting)
AFAIR Linux (and probably other Unices?) is unique in this regard - fork() on Linux is similar to threads in Windows when it comes to overheads. But I read this 3 years ago so I might have misremembered it.
SFU? (Score:5, Informative)
Re:Just Rembember (Score:4, Funny)
Much better flamebait would be:
See, I can do a real flamebait!
Compile your perl scripts? (Score:2)
The main downside is that you get an exe with a perl inteprete
cygwin terminal (Score:4, Insightful)
Re:cygwin terminal (Score:4, Informative)
C:\cygwin\bin\rxvt.exe -e ssh-agent bash --login -i
IIRC, rxvt isn't installed by default, but it's available under 'shells' when you run the cygwin setup.
Re:cygwin terminal (Score:2)
--
@echo off
C:
chdir C:\cygwin\bin
rem bash --login -i
rem c:\cygwin\bin\rxvt -geometry 80x60 -e cmd
c:\cygwin\bin\rxvt.exe -sl 500 -geometry 80x46 -fn courier -bg white -sr -e bash --rcfile H:\.bashrc
non cygwin way.. (Score:3, Insightful)
Cygwin is Jus' Fine (Score:3, Interesting)
I would recommend you use ActiveState's Perl distribution in conjuction with the Cygwin enbvironment.
It's reasonably prioed and well supported, without a lot of stuff you *don't* need thrown in.
Re:Cygwin is Jus' Fine (Score:2)
Maybe (Score:1)
It could be that my poor impressions of reliability are based on older versions (I've been using it since B19 or so) or a few buggy packages. Most of the weird e
Re:Maybe (Score:1)
Best is the enemy of better.
Cygwin + Unison (Score:1)
VMWare? Either Way? (Score:3, Insightful)
What about the possibility of either running Linux inside VMWare on a Windows machine or the reverse?
Admission: I don't have recent direct experience with VMWare myself; it used to be that the two systems needed different IP addresses, but I don't know if that would keep within the constraints your customer wants to impose.
[My two cents: the constraint sounds overly artificial. A network-presence appliance that's secure and does its job is good enough for most people. Think of network printers, for example. It's not like every single active IP presence is going to need a Windows XP update...
Finally, I've heard some people express a preference for MinGW [mingw.org] over Cygwin for some reason...
The Cygwin vs MinGW thing (Score:2)
Cygwin basically adds a nice layer of POSIX functionality to the Win32 subsystem. (Don't even mention "Windows has POSIX" -- it's a seperate subsystem, it's broken and incomplete and not going to be fixed, MS just added enough to be able to say to the US government "yes, NT is POSIX" with a straight face, so that they qualify for defense contracts.)
It also adds bunch of other things (mount points, IPC, etc), but the POSIX/*nix features are the main part of the DLL.
The downside to the layer is that it'
Re:The Cygwin vs MinGW thing (Score:2, Informative)
The last time I checked, msys was slower than cygwin.
Re:VMWare? Either Way? (Score:1)
Cooperative Linux is the first working free and open source method for optimally running Linux on Microsoft Windows natively. More generally, Cooperative Linux (short-named coLinux) is a port of the Linux kernel that allows it to run cooperatively alongside another operating system on a single machine
I've been using it with the Debian image in recent days with few problems. Check out the Manager [biermana.org] as well
Why not run your UNIX OS under Windows? (Score:2)
I dunno about CGYWIN, i wouldn't trust it....
Re:Why not run your UNIX OS under Windows? (Score:1)
Larger thoughts... (Score:5, Informative)
However, in a larger context:
Uhhh, you are taking on a customer for whom you have no tools and no infrastructure for? Who doesn't fit your current model, and fundamentally doesn't fit how you do business? Unless you are laying the ground work to bring in lots more revenue at a lower cost in the future, this might be stupid to do.
Now, a company has to grow, but remember the princepal that says, "Not all customers are profitable". You don't want customers who don't make you money. I remember a story about an advertising company that eliminated 70% of their existing customers and have revenue plumet, but their profits jumped by 30% (as a dollar value, not as a percentage of revenue, they made 2.5Mil instead of 1.5Mil in profit, I believe revenue went from 30Mil to 12Mil).
I know on more then on occasion, the smartest thing the guys in charge where I work is to fire customers. Some customers aren't worth the time or the trouble to deliver service to.
This isn't an anti-Window post, it's merely a matter of considering weather or not this is an area you are planning to expand into, or if this is a one-off, non-scalable solution for a single customer just to get the business.
We run into this quite often, around it's driven by sales people whose sales goals are about bringing in revenue, not bringing in profit. If it costs us $1000 in to bring in $500 in revenue, that's a stupid business proposition. If it's a big chunk of revenue, and you can build it while making money go for it.
Kirby
Re:Larger thoughts... (Score:2)
Not necessarily (Score:2)
It depends on the application, the cost of being cross-platform, and the potential value of the expanded market.
The likely answer is really that you can't afford to be cross-platform. Good cross-platform development is expensive. It's *not* just a matter of coding everything in (say) MONO/GTK#. You have to have installers for each platform. You have to have documentation for each platform. You have to have support for each platform. You have to have test infrastructure for each platform. It just goes on
Best bet is probably Cygwin (Score:2)
But it depends on what you need.
Re:Larger thoughts... (Score:2)
In other words, while it might be a rogue salesweasel causing the problem, it's more likely to be an idiot sales manager. Most likely of all: an executive team with dreams of going public and cashing in buckets of pre-IPO stock..
Cygwin Threading problem (Score:5, Informative)
If you spawn a bunch of processes (such as in a common loop), each of those will use up at least 1 TID. Any call to create new threads made through the cygwin dll makes that TID non-reusable in windows, and will eventually crash your box.
Shell Script that crashes your box:
integer i=70000
while ((i -= 1))
echo hello\\nworld | cat|cat|cat|grep h >&- #spawn some processes
done
While cygwin has its problems, I've had many more w/ Services for UNIX
Re:Cygwin Threading problem (Score:1)
Right now, the primary developers don't have a hyperthreaded or SMP machine free to use to reproduce the problem.
Re:Cygwin Threading problem (Score:1)
Re:Cygwin Threading problem (Score:2)
CYGWIN running on production servers... (Score:2, Interesting)
We use it to interface with both Oracle and MSSQL databases. Again we have found little to no problems at all running on production hosts.
Apache under Cygwin (Score:2)
UNXUtils and ActivePerl (Score:2, Interesting)
They always did the trick for me...
Re:UNXUtils and ActivePerl (Score:1)
However I use Win32 ports of GNU (and non-GNU) tools from GNUWin32 [sf.net].
They are quite up to date with frequent releases.
Get the permissions right (Score:1)
While this might not affect you if you are setting up the directories yourself, it might bite you if yo
Some glitches but overall OK (Score:2)
Everything goes well, but there are some small thing to notice:
- the performance usually is comparable to that on Unix. Sometimes I get the impression that the network operations are a bit slower (just an impression, but it repeats itself)
- some libraries/applications may need shared memory: configuring the ipc-daemon (or cygsrv), which provide IPC share memory, is sometimes rather tricky. Once they are configured
Interix, not Cygwin (Score:2)
(www.microsoft.com/windows/sfu/) instead
of GNU cygwin, and ksh instead of GNU bash.
For connecting to Oracle from ksh using
co-routines, a feature which bash doesn't
have (besides ksh using _less_ memory and
being _much_ faster on string ops), see
https://MirBSD.BSDadvocacy.org:8890/cvs.cgi/ c ontri b/samples/codesnippets/oracle-ksh-access.shar
For a portable version of a highly modern
pdksh derivate, the project has released
http://wiki.mirbsd.de/MirbsdKsh - it works
under In
Re:Interix, not Cygwin (Score:2)
Re:Interix, not Cygwin (Score:2)
programmers' standpoint, this sucks.
In fact, I'm thinking of porting most of the
userland portion of our OS to Interix, because
it looks like it's easily possible (except from
the object format being PE, not ELF, of course).
Perl on Windows (Score:1)
Re:Perl on Windows (Score:1)
Personal experience (Score:1)
Not quite the same situation as yours, but I think if it can handle running an X server (stable, for the past several
Good emulation is no substitute for polish (Score:2)
Obviously, though, you should take an intelligent approach. Some things don't make much sense to run under cygwin. cron comes to mind. It's available, but if you want it to be a little more integrated, I'd invest a little bit of effort to get those things that need to be cronned running as a windows service or under task scheduler or something native to Windows. Not only will
Cygwin's ssh under XP has issues (Score:2)
I tried numerous times today to scp a 1MB file from an XP box running the current version of Cygwin to a Linux box (#1) with the most recent OpenSSH.
It would xfer a random amount (0-43%) and hang every time I tried.
I finally ended up using Linux's SMB mounting capability to access the file and used the Linux box (#2) to scp the file - no problem.
The XP box and 2nd Linux box mentioned are on the same network, the 1st Linux box (that I was trying to scp to) was on another network many hops away.
I have no id
win4lin, co-linux? (Score:3, Insightful)
WinNT(and XP) - and not having tried either(i'm an end-user, not an admin, so i can't tinker...
there ought to be a good way to utilise one or the other to achieve acceptable results in a
production environment.
before anyone gets all huffy about XP, it is fairly stable, can be configured to be relatively
secure(!) and, a recent LinuxFormat Magazine had a co-linux/Gentoo dist on it.
anyone try either one out? philosophically, i'd prefer to use win4lin, but realise that it may be
more practical to try co-linux because of the peculiarities of XP(wierd system calls, etc.)
24x7 (Score:5, Informative)
I already made a post [slashdot.org] in a thread [slashdot.org] about SFU [microsoft.com] that was looking like (disclaimer: i love cygwin):
Now bout your particular problem (prod env, 24x7), I've experienced very few problems running CygWin in such an environment. I use it since at least 5 years (I remember downloading it at 56k, so it's probably more), but there's some things you need to be aware with cygwin:
<Job ID="MyJobID">
<script language=PerlScript>
#
</script
Re:24x7 (Score:2)
Re:24x7 (Score:3, Insightful)
Thanks.
Re:24x7 (Score:2)
Re:24x7 (Score:1)
This is pretty much common sense. If you are using a different version of program X on platform Y, you may run into trouble. Well, duh.
>Forks and threads are really badly implemented. Yet nobody else did better.
Odd how you would make such a strong statement with no apparent understanding of how "fork and threads" could be implemented b
Re:24x7 (Score:2)
Now, what is really common sense is reading the thing you try to troll on...
Guess who is in the middle of the crowd, and that peoples are looking at with a (little) smile?
Re:24x7 (Score:1)
I don't have to troll. I am one of the project leaders for cygwin. I understand the issues very well. Most of the problems you describe are just generic problems with porting to another system. Perhaps you have little experience porting between systems and are unaware of this.
Cygwin's fork is certainly slower than UNIX's fork, but since you lack any understanding of Cygwin fork internals, your assertion that it is badly implemented is uninformed. I thought people
Re:24x7 (Score:2)
In the original post i was trying to highlight the "do" and "don't" one needs to know when working with cygwin. The hard links for example is one problem peoples frequently stumble on. Most of the things you underlined are, of course, common sense. I just end up running into smart ones that think common sense is something only happening to other
Re:24x7 (Score:2)
So why didn't YOU answer the OP's question instead of merely criticizing other people's answers?
Of course I may have missed your answer because the posts can be read in several different orders. It's possible that you provided a great answer and I just haven't reached it yet. Apologies in advance if that's the case, but so far I haven't seen YOUR answer, though I've seen more than one of your comments
Re:24x7 (Score:1)
Of course I want to defend cygwin against charges like "fork is poorly implemented". I don't know why I have to explain this but if someone blindly criticizes something you contributed to without offering any supporting details, you don't just let the criticism sit. We're happy to hear about improvements to fork assuming that they ar
Re:24x7 (Score:1)
If you have quickview installed on your machine, you can see what DLLs a program use in its Import Section (from the PE header). Else i would recommend OllyDBG (free) or PE Explorer ($$$).
I can recommend the HT Editor [freshmeat.net] for editing all sorts of executable files (Windows and Linux/Unix).
Ulrik
Unix for Windows from ATT (Score:2, Informative)
GPL Warning (Score:3, Informative)
If you can get past the horrible, horrible installation, Cygwin is a pretty nifty piece of kit.
However, in a commercial environment there is one tremendous downfall to using Cygwin. The Cygwin.dll library that does all of the translation from Unix to Windows system calls is under the GPL. NOT the LGPL. This means that if you write an application and build it against the Cygwin libraries and plan to distribute it, the only license you can legally put your software under is the GPL. This is the only case of the "virulent" nature of the GPL that we've witnessed firsthand and I must say it is a particularly nasty one.
For more info:
read the FAQ [cygwin.com].
Re:GPL Warning (Score:3, Informative)
Re:GPL Warning (Score:1)
Re:GPL Warning (Score:2)
Yes, I will admin that I missed that point. My argument draws from a previous experience of my own where I wanted to distribute a Cygwin binary for a C program that I wrote and put under the BSD license. The BSD license does not conform to Red Hat's definition of "Open Source" and buying a commercial license for my tiny (but useful!) program would have been impractical.
Re:GPL Warning (Score:2)
Re:GPL Warning (Score:2)
IIRC, he said shell scripts yes, but also vaguely alluded to other kinds of development as well. Even if they *are* just doing shell scripts for now, once they're using Cygwin on a more permanent basis, they won't be able to move to C or C++ programs.
Re:GPL Warning (Score:3, Interesting)
This is NOT TRUE.
Re:GPL Warning (Score:2)
What's not true about it? I said that if you link against the cygwin dll and then distribute the result, the only license you can put your work under is GPL. The two clauses that you pasted support that, but also add the phrase "complies with the Open Source definition" which just looks like a summery of the GPL to me.
I got bit on Cygwin when I wanted to distribute a Cygwin-linked binary under the BSD license, which does NOT comply with the "Open Source" definition as stated by the GPL, Red Hat, and Bruce
inodes (Score:1)
Other issues are that it's better to do everything in cygwin, or everything in windows rather than mixing the two, as translating the paths from one to the other can cause a
Cygwin? (Score:2)
Microsoft has their Services for Unix (SFU) at version 3.5 and is now free for download. I'd say that in a mission-critical environment, SFU is much more rock solid and production-tested than cygwin.
(And if you're going to bash it just because it bears a Microsoft name, just remember that technically it's only sold by Microsoft and developed by someone else).
cygwin - sfu - mks (Score:2, Interesting)
I looked around for several solutions and came across cygwin, which did the job.
The problem was that at that time it was property of Red Hat [ http://www.redhat.de/software/cygwin/support/ [redhat.de]], who apparently were busy with anything but cygwin. Their website said something about $100.000 or something for a developer license,
Re:cygwin - sfu - mks (Score:1)
We use it in production -- but there are issues. (Score:1)
We have been very pleased with the functionality.
But, we have run into one major bug. On hyperthreaded machines or SMP machines the Cygwin1.dll has threading bugs.
These cause random errors, crashes, and hangs.
Since Cygwin is free, and supported by volunteer effort, there isn't any guaranteed support (other than the standard OSS mantra "You have the source, so fix it yourself!")
If you can live without guaranteed support, and understand that there are some bugs, C
Re:We use it in production -- but there are issues (Score:1)
Also, of those that ARE programmers how many of them will actually take the time to fix the problem? In my humble opinion, the programmers of the OSS should take the advice to heart and fix the problem! </offtopic>
coLinux (Score:2)
Instead of running an "emulation layer" (like Cygwin) or a "PC virtulization" (like vmWare), you could be running Linux alongside Windows.
Though it's a young project, I have been playing with it quite a bit, and haven't run into any problems re stability.
It might be faster than Cygwin too.
Use in Critical Production (Score:2)
I am the architect for Tracker, [trackernet.org] a project funded by the U.S. State Department and deployed in 9 countries.
This is a Java (J2EE) application using JBoss [jboss.org] as our application server. We need to develop as well as deploy on Mac OS X, linux (Redhat 9), Solaris 8, and windows XP.
We use Cygwin on windows in both development and deployment environments, so that all of our scripts (administrative, start, stop, build, etc) are completely cross platform. Works like a champ. No complaints in production at all, alt
Cygwin is the ultimate OS (Score:1)
I use it as a way to take Windows 2000 (let's face it, a stable but not secure, OS) and make it almost as smart as Unix. I'm a command line, vi loving, Perl programming geek and I've essentially eliminated 98% of all differences between a Linux/Unix platform and Windows. I hate dual booting.
I can use the best of Windows and the best of Unix
Services For Unix (Score:2)
I normally don't endorse MS products but in this case you'll actually get reasonable vendor support (something you can't really say with Cygwin).